> 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 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.

## What you see

Three collapsible sections:

<div data-with-frame="true"><figure><img src="/files/gjGuxls23mnzs8PY1ZoT" alt="" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.riff.ai/reference/shared/secrets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
