> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/warpdotdev/warp/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage secrets for cloud agents in Warp

> Store API keys, database credentials, and other sensitive values in Warp Managed Secrets and have them injected automatically into cloud agent runs.

Cloud agents often need to authenticate with external services — GitHub, third-party APIs, databases, and more. Warp Managed Secrets give you a secure place to store those credentials and a reliable mechanism for making them available inside agent containers at runtime, without ever putting sensitive values in your code or shell history.

Secrets are encrypted at rest and injected as environment variables when an agent run starts. The agent itself can read them like any other environment variable, and they are never logged in the run transcript.

## Managing secrets

All secret commands are available under `oz secret`.

### Create a secret

```bash theme={null}
oz secret create my-github-token
```

By default, Oz prompts you to enter the secret value interactively. To read the value from a file instead, use `--value-file`:

```bash theme={null}
oz secret create my-service-key --value-file ./service-account.json
```

**`oz secret create` flags:**

| Flag            | Short | Description                                               |
| --------------- | ----- | --------------------------------------------------------- |
| `--type`        | `-t`  | Secret type: `raw-value` (default) or `anthropic-api-key` |
| `--description` | `-d`  | Optional description for this secret                      |
| `--value-file`  | `-f`  | File to read the secret value from instead of stdin       |

### Create a typed Anthropic secret

For agents that use the Claude Code harness, Oz supports provider-specific secret creation that validates the credential format automatically.

<Tabs>
  <Tab title="Direct API key">
    ```bash theme={null}
    oz secret create anthropic api-key my-anthropic-secret
    ```
  </Tab>

  <Tab title="Bedrock API key">
    ```bash theme={null}
    oz secret create anthropic bedrock-api-key my-bedrock-secret \
      --bedrock-api-key <key> \
      --region us-east-1
    ```
  </Tab>

  <Tab title="Bedrock access key">
    ```bash theme={null}
    oz secret create anthropic bedrock-access-key my-bedrock-secret \
      --access-key-id <id> \
      --secret-access-key <key> \
      --session-token <token> \
      --region us-east-1
    ```
  </Tab>
</Tabs>

If you omit any of the provider-specific flags, Oz prompts for them interactively.

### List secrets

```bash theme={null}
oz secret list
```

This lists the names and descriptions of all secrets in your account. Secret values are never returned.

### Update a secret

To rotate a secret's value, use `oz secret update`. Oz will prompt for the new value interactively, or you can supply a file.

```bash theme={null}
# Prompt for a new value
oz secret update my-github-token --value

# Read the new value from a file
oz secret update my-github-token --value-file ./new-token.txt

# Update only the description
oz secret update my-github-token --description "GitHub PAT for CI bot"
```

**`oz secret update` flags:**

| Flag            | Short | Description                                 |
| --------------- | ----- | ------------------------------------------- |
| `--value`       | —     | Prompt for a new secret value interactively |
| `--value-file`  | `-f`  | File to read the new secret value from      |
| `--description` | `-d`  | New description for the secret              |

### Delete a secret

```bash theme={null}
oz secret delete my-github-token

# Skip confirmation prompt
oz secret delete my-github-token --force
```

## How agents access secrets at runtime

When an agent run starts, Warp injects all secrets in the run's scope as environment variables inside the agent container. The variable name matches the secret name you chose when creating the secret.

For example, if you created a secret named `GITHUB_TOKEN`:

```bash theme={null}
oz secret create GITHUB_TOKEN
```

Your agent can then read it like any other environment variable:

```bash theme={null}
# Inside an agent-executed script
curl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/owner/repo
```

<Warning>
  Choose secret names that are valid environment variable names (uppercase letters, digits, and underscores).
  Names with hyphens or other special characters may not be accessible as environment variables in all shells.
</Warning>

## Secret scoping

By default, secrets are created in your personal scope. Use `--team` to create a secret shared across your team, or `--personal` to explicitly create a private secret:

```bash theme={null}
# Create a secret scoped to your team (shared with teammates)
oz secret create SHARED_API_KEY --team

# Create a private secret (default behavior)
oz secret create MY_PERSONAL_KEY --personal
```

Team-scoped secrets are available to any agent run that belongs to the same team.

## Security considerations

<AccordionGroup>
  <Accordion title="Are secret values ever shown in output?">
    No. `oz secret list` only returns secret names and descriptions. The `oz secret update` command prompts for the value interactively and does not echo it. Values are never included in run transcripts or logs.
  </Accordion>

  <Accordion title="How are secrets stored?">
    Secrets are encrypted at rest in Warp's infrastructure. They are decrypted only at the moment they are injected into an agent container, and only for the duration of that run.
  </Accordion>

  <Accordion title="Can I use secrets with scheduled agents?">
    Yes. Secrets are injected into every run, whether triggered manually or by a schedule. As long as the secret exists in the right scope when the scheduled agent fires, it will be available.
  </Accordion>
</AccordionGroup>
