> For the complete documentation index, see [llms.txt](https://docs.zerve.ai/zerve-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zerve.ai/zerve-docs/data-and-assets/constants-and-secrets.md).

# Constants and secrets

Store named values, such as API keys and configuration, and use them across notebooks.

A **constant** is a named value you store once and use across notebooks, such as a data provider's API key, a configuration setting or a risk threshold. Any constant can be marked as a **secret**, which hides its value.

Find them under **Assets → Constants**.

## Constants and secrets

|                                         | Constant                       | Secret                           |
| --------------------------------------- | ------------------------------ | -------------------------------- |
| **Value visible to people with access** | Yes                            | No, it's hidden in the interface |
| **Available to code when a block runs** | Yes                            | Yes                              |
| **Typical use**                         | Configuration, thresholds, IDs | API keys, passwords, tokens      |

You can turn a constant into a secret, or a secret back into a constant, at any time.

**Every value is stored in a secure vault**, including ordinary constants, not just secrets. That's why any constant can become a secret later without moving its value.

## Creating a constant

Go to **Assets → Constants** and create a new constant. Give it a name, a value and a description, and choose whether it's a secret.

## Versions

Constants are **versioned**. Each time you change a constant, you create a new version (v1, v2 and so on), with its own value, description and secret setting.

### Notebooks use a specific version

When you attach a constant to a notebook, the notebook uses a **specific version**. Creating a new version doesn't change notebooks that use an older one. Switch each notebook to the new version when you're ready.

This means you can roll out a change safely. For example, when you rotate a data provider's API key:

1. Create a new version of the constant with the new key.
2. Switch one notebook to the new version and check it works.
3. Switch the rest of your notebooks.

When you attach a constant, you can also give it an **alias**: a different name to use in that notebook.

## Sharing

Constants follow the same sharing rules as other assets, and each version can be shared separately. See [Sharing and privacy](/zerve-docs/administration/sharing-and-privacy.md).

## Secrets and agents

Agents never ask you to type a secret into a conversation. When a superagent needs a credential, you enter it in a secure form and it's stored as a secret. See [Decisions and recommendations](/zerve-docs/superagents/decisions-and-recommendations.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zerve.ai/zerve-docs/data-and-assets/constants-and-secrets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
