> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudthinker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Credentials

> Store API keys and tokens once so agents can use them in commands, without anyone pasting a secret into chat.

A credential is a secret, such as an API key or a service token, that you save once in a workspace. CloudThinker encrypts it and passes it to agents as an environment variable every time they run a command, so nobody has to paste it into chat. If a command prints the value, CloudThinker replaces it with a placeholder when the key has a secret-sounding name (containing `KEY`, `TOKEN`, `SECRET` or `PASSWORD`) and the value is 6 or more characters. Other values are masked only if they match a known secret format. See [Values stay out of chat](#how-agents-use-credentials).

## Credentials, connections, or BYOK?

CloudThinker keeps secrets in three places. Pick the one that matches what you're storing.

| You want to give agents | Use | Where |
| - | - | - |
| Access to a cloud account, database, or monitoring tool | [Connections](https://docs.cloudthinker.io/guide/connections/overview.md) | **More → Workspace settings → Connections** |
| Any other secret a command needs, such as a vendor API key or a webhook secret | **Credentials** (this page) | **More → Workspace settings → Credentials** |
| Your own LLM provider keys for model inference | [BYOK](https://docs.cloudthinker.io/guide/byok.md) | **Admin Settings → BYOK** for the organization key, or **More → Workspace settings → BYOK** for a workspace key |

## Prerequisites

* The **Admin** role in the workspace. Developers and Viewers see a "Credentials are restricted" card instead of the list. See [workspace roles](https://docs.cloudthinker.io/guide/workspace-users.md).
* One exception: the secure form an agent shows in chat (see [How agents use credentials](#how-agents-use-credentials)) doesn't check the workspace role. Any member who can chat, Developers included, can submit it.

## Add a credential

**1. Open the Credentials page**

In the sidebar, click **More → Workspace settings**, then **Credentials**. The list shows each credential's key, description, who added it, and when it was last updated. Values are never shown.

**2. Click Add Credential**

Fill in the form:

| Field | What to enter |
| - | - |
| **Key** | The environment variable name agents see, for example `STRIPE_API_KEY`. Uppercase letters, digits, and underscores only, and it can't start with a digit. Up to 255 characters. |
| **Value** | The secret itself. |
| **Description** | Optional, up to 1,024 characters. Say what the secret is for and where it came from, so the next admin knows whether it's safe to rotate. |

**3. Click Save**

**Success state:** the credential appears in the list with its key and description. Agents get it on their next command.

> [!NOTE]
>
> The form rejects reserved keys. Cloud and Git access comes from [Connections](https://docs.cloudthinker.io/guide/connections/overview.md), and Cyber manages its own login keys.
>
> * Any key starting with `AWS_`, `GOOGLE_`, `AZURE_`, `KUBECONFIG`, `GITHUB_TOKEN`, `GITLAB_TOKEN`, `BITBUCKET_TOKEN`, or `APPSEC_RUN_GENERATOR_INSTRUCTIONS_`
> * `CYBER_AUTH`, `CYBER_AUTH_JSON`, `CYBER_COOKIE`, `APPSEC_AUTH`, `APPSEC_AUTH_JSON`, `APPSEC_COOKIE`, and any key that starts with one of them followed by `_`

## Import a .env file

Use this when you already keep secrets in a dotenv file. The file is parsed in your browser, and only the rows you select are sent.

**1. Open the import dialog**

On **More → Workspace settings → Credentials**, click **Import .env**.

**2. Add your file**

Choose **Paste** and paste the contents, or choose **Upload a file** and pick a `.env`, `.env.local`, or other `.env.*` file. One import takes a file of 64 KiB or smaller with at most 50 keys. Click **Review credentials**.

| In the file | How it's read |
| - | - |
| `export KEY=value` | The `export` prefix is ignored. |
| `# comment`, or `value # comment` | Skipped. An unquoted `#` after a space starts a comment. |
| `"..."` or `'...'` | Quotes are removed. A quoted value can span several lines, which suits PEM keys and JSON. In double quotes, `\n`, `\t`, `\"`, and `\\` are unescaped. |
| `KEY=` | Skipped as empty. |
| An invalid key, such as `my-key`, or a key declared twice | Listed as a problem by line, for example "Line 4 has an invalid key." |

**3. Pick the rows to save**

Rows are split into two groups:

| Group | What selecting a row does |
| - | - |
| **New** | Creates the credential. |
| **Already in this workspace** | Overwrites the stored value. Leave it unselected to keep the current value. |

Rows with a reserved key are marked "This key is managed by the platform." and can't be imported.

**4. Click Import**

The button shows how many rows you selected, for example **Import 3**.

**Success state:** the imported keys appear in the list.

## Use a credential in chat

Type `$` in the chat box to open the credential picker, then pick a key. It's inserted as `$KEY`, so you can point an agent at a secret without pasting it.

```text theme={null}
Summarize this month's failed payments from the Stripe API using $STRIPE_API_KEY
```

The agent reads the value from its environment and reports back by key name only. The `$` picker shows only for members who can manage credentials. See [Commands and syntax](https://docs.cloudthinker.io/guide/commands.md) for the other tokens you can type.

## How agents use credentials

| Behavior | What it means for you |
| - | - |
| Every credential is available to every command | Agents get all workspace credentials as environment variables, whether or not your prompt mentions them. You can't limit a credential to one agent, run type, or Automation. Keep a secret that only some work should see in a separate workspace. |
| Agents can ask for a missing secret | If a task needs a key the workspace doesn't have, the agent shows a secure form in chat. What you submit is saved as a workspace credential, and the list shows "Added by" with the agent's name. The form doesn't check the workspace role, so any member who can chat, Developers included, can create a workspace credential this way, or overwrite an existing one. |
| Values stay out of chat | You and agents refer to a credential by key name, and the Credentials list never shows a value. When a command's output contains a credential value, CloudThinker swaps it for a placeholder before the model, the chat or stored output sees it. It matches your stored values exactly, plus known secret formats such as cloud keys. Exact matching covers values saved under a name that reads as a secret, such as one containing `KEY`, `TOKEN`, `SECRET` or `PASSWORD`. A value under a plain name like `REGION`, or one shorter than 6 characters, is only caught if it matches a known format, so `env` could still print it. See [Data Protection](https://docs.cloudthinker.io/guide/security/data-protection.md). |
| Commands that send a credential go through Approvals | A command that sends a credential to another service, such as `curl` with `$STRIPE_API_KEY` in a header, is checked by [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md) like a call to a connection. Prefer read-only or narrowly scoped vendor keys, so a mistaken write can't do much. |

> [!WARNING]
>
> If an agent asks for a key that already exists, submitting the form replaces the stored value, whoever submits it. Check the list first when the key might be used by another automation.

## Edit or delete a credential

* **Edit:** click the pencil icon on the credential's row (tooltip **Edit credential**). Change the description, or enter a new value to replace the secret. Leave the value blank to keep the stored secret. To rotate a secret, enter the new value here: commands pick it up from their next run.
* **Rename:** you can't rename a key. Add the credential under the new key, update anything that uses the old name, then delete the old one.
* **Delete:** click the trash icon (tooltip **Delete credential**) and confirm. Every agent that reads this credential loses access on its next command. This can't be undone.

## Security

* Values are encrypted at rest with Fernet (AES with an HMAC integrity check) and are never sent back to the browser.
* On Scale and Enterprise, each create, update, and delete is recorded in [Audit Logs](https://docs.cloudthinker.io/guide/security/audit-logs.md) under the Security category. Free and Team have no Audit Logs. The entry leaves out both the key name and the value, because more people can read audit logs than can manage credentials. To see which key changed, match the entry's time against the **Updated** date on each row of the Credentials list.

## Troubleshooting

> [accordion] The form says 'Uppercase letters, digits, and underscores only'
>
> The key has a lowercase letter, a dash, a space, or starts with a digit. Rename it, for example `stripe-key` becomes `STRIPE_KEY`.

> [accordion] The key is reserved ('uses reserved prefix')
>
> The key is on the reserved list above, either as an exact name such as `CYBER_AUTH` or by prefix such as `AWS_`. The message says "uses reserved prefix" in both cases. Add that access as a [connection](https://docs.cloudthinker.io/guide/connections/overview.md) instead, or rename the key if it's for a different service.

> [accordion] 'A credential named ... already exists'
>
> **Add Credential** never overwrites. Edit the existing credential to change its value, or use **Import .env** and select the row under **Already in this workspace**.

> [accordion] I can't see the Credentials list or the \$ picker
>
> Both need the workspace **Admin** role. Ask a workspace admin to add the secret, or to change your role.

## Next steps

> [card] [Connections](https://docs.cloudthinker.io/guide/connections/overview.md)
>
> Give agents access to your cloud accounts, databases, and tools

> [card] [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md)
>
> Decide which agent writes run alone and which wait for a person

> [card] [Bring your own key](https://docs.cloudthinker.io/guide/byok.md)
>
> Run model inference on your own LLM provider keys

> [card] [Audit Logs](https://docs.cloudthinker.io/guide/security/audit-logs.md)
>
> See when credentials were created, changed, or deleted, and by whom


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.