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

# Secrets

Secrets stores sensitive credentials — API keys, connection strings, tokens — in an encrypted vault your app or agent reads at runtime.

Secrets is an encrypted vault for sensitive credentials. Your app or agent reads secrets at runtime as environment variables — they are never written into source code or exposed to the frontend.

Available in both the App builder and Agent builder via the **+** button.

<figure><img src="https://4203676568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmj3x7kCuQ8vAs0u0uIPo%2Fuploads%2F9VmxQy00MGf5YDqWGA9l%2Fimage.png?alt=media&amp;token=afa79ecc-f8ee-44a5-8ad8-5829833aa110" alt="The + button at the end of the app&#x27;s tab bar, highlighted"><figcaption></figcaption></figure>

## What you see

Three collapsible sections:

<div data-with-frame="true"><figure><img src="https://4203676568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmj3x7kCuQ8vAs0u0uIPo%2Fuploads%2FlrjWlMxh3OBgw0LXoBsY%2Fimage.png?alt=media&amp;token=e0a40332-2a0a-4a9d-b492-123e96cc5340" alt="The Secrets tab: Add from Team, and Add Secret for each of the three kinds of backend variable" width="563"><figcaption></figcaption></figure></div>

<table><thead><tr><th width="416.41082763671875">Section</th><th>When it applies</th></tr></thead><tbody><tr><td><strong>Variables for Backend</strong></td><td>Available in all environments (development and production)</td></tr><tr><td><strong>Variables for Backend, only in app workspace</strong></td><td>Development only</td></tr><tr><td><strong>Variables for Backend, only in deployed app</strong></td><td>Production only</td></tr></tbody></table>

Each variable row shows its name, a hidden value (click **Reveal & Edit** to view or change it), and a delete button. Variables from team-level integrations appear as read-only with a lock icon.

## Adding a secret

1. Expand the appropriate section
2. Click **Add secret**
3. Enter the key name (e.g. `ERP_API_KEY`) and value
4. Save — the Riff agent can use it immediately by referencing the key name

On enterprise accounts, click **Add from Team** to attach a shared account-level secret. It appears as a read-only variable once added — your project can use it without seeing the raw value.


---

# 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.riff.ai/reference/shared/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.
