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

# Secrets

A secret is a named set of key-value pairs holding **credentials** your agents and services need: API tokens, database passwords, anything that should not sit in a configuration file. Secrets belong to the project and nothing outside it can read them.

Grouping matters here. One secret can carry a host, a user, and a password together rather than forcing three separate entries, so a secret usually maps to a system rather than to a single credential. Add the pairs one at a time, or paste a whole set in with Import from JSON.

Values are **write-only**. Once saved, a secret's keys stay visible but its values cannot be read back, so editing means supplying new ones. Individual keys can be replaced or removed without touching the rest.

<div data-with-frame="true"><figure><img src="https://708770081-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ICwJbq7EJdn5kBgXnQu%2Fuploads%2FOkf6vZQnQURIuy7wEyMc%2FScreenshot%202026-08-06%20at%2010.35.08.png?alt=media&amp;token=d2f87489-39bf-47c8-923f-9424b4f32f32" alt=""><figcaption></figcaption></figure></div>

### Using a secret

Agents and services attach secrets rather than copying values out of them. Select the ones a deployment needs, on an agent's Runtime step or a service's Environment and Secrets section, and every key inside each attached secret arrives as an environment variable when the container starts.

Those environment variables are what the `${...}` reference fields elsewhere in the platform read. A password field on an agent's database connection takes `${MY_SECRET_KEY}` rather than the password itself, so the credential never appears in a configuration or in its version history.

### Database secrets

Creating a database generates its credentials for you. Two secrets appear, typed `database` rather than `project`, one for application access and one for the superuser, each holding the connection details: database name, host, the connection URIs, and credentials. Attach the application one to whatever needs to connect and leave the superuser for administrative work.

{% hint style="info" %}
Secrets can also be managed from the command line. See the [CLI documentation](https://docs.interactive.ai/cli/) for `iai secrets`.
{% endhint %}


---

# 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.interactive.ai/infrastructure/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.
