> For the complete documentation index, see [llms.txt](https://docs.cortex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cortex.io/configure/settings/api-keys/secrets.md).

# Secrets

[Secrets](https://app.getcortexapp.com/admin/settings/secrets) are encrypted variables you can store in Cortex for your workspace environment. They can be accessed for use in various Cortex features, such as:

* [Plugin proxies](/streamline/plugins/creating-plugins/plugin-proxy.md), to allow secure authenticated access to various third-party APIs.
* [Workflows](/streamline/workflows.md), when configuring an HTTP Request action.

Secrets are securely encrypted and stored in Cortex’s database, and the secret values are not accessible via public or private APIs once saved.

### Accessing secrets

Secrets can only be accessed programmatically through features in Cortex. Secrets are generally referenced by configuration of the relevant feature through a templated string that uses Mustache-like syntax to reference the secret by tag. For instance, a plugin proxy header can reference a secret similar to the following example:

```json
{
  "name": "Authorization",
  "value": "Bearer {{ secrets.my_secret }}"
}
```

## Managing secrets

### Create a secret

Secrets can be created in the Cortex UI or via the Cortex API. Your user or API token must have the `Create secrets` permission.

{% tabs %}
{% tab title="Cortex UI" %}
For convenience, secrets can be optionally named in a human-friendly manner. For programmatic access, secrets must have a unique tag that contains only alphanumeric characters and dashes.

To create a secret:

1. Go to [**Settings > Secrets**](https://app.getcortexapp.com/admin/settings/secrets) then click **Add secret**.

   <figure><img src="/files/g48eg2uPfrF25XbtklbM" alt=""><figcaption></figcaption></figure>
2. In the modal, configure your secret:
   * **Name**: Enter a user-friendly name.
   * **Identifier**: Enter a unique identifier for the secret, made of letters, digits, and underscores.
     * Note that tags cannot be edited after they are created.
   * **Secret value**: Enter your secret value.
     * This is usually the value of an API token or some other value from a third-party integration.
3. Click **Add secret**.
   {% endtab %}

{% tab title="API" %}
It is possible to create, read, update, and delete secrets via the Cortex API. See the [API documentation](/api/readme/secrets.md) for more information.
{% endtab %}
{% endtabs %}

### Edit secrets in the Cortex UI

You must have the `Create secrets` permission to edit secrets.

To edit a secret:

1. Go to [**Settings > Secrets**](https://app.getcortexapp.com/admin/settings/secrets) then click the pencil icon next to the secret you want to edit.
2. In the modal, edit the secret name.
   * We recommend creating a user-friendly name for the secret.
3. Click **Save**.


---

# 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.cortex.io/configure/settings/api-keys/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.
