Skip to content

agentstack secrets

Terminal window
agentstack secrets <subcommand> [options]

The secrets command manages secret values such as API keys and tokens outside the canonical profile.

In the current model, your profile stores references such as MCP env_refs, while the secret values live in the local secrets store.

SubcommandDescription
set <name> <value>Store a secret value
get <name>Retrieve a secret value
delete <name>Remove a secret
listList stored secret names (never values)
FlagTypeDefaultDescription
--backend <backend>file|darwin-keychainplatform-dependentStorage backend
Store secret values
agentstack secrets set GITHUB_TOKEN ghp_xxxxxxxxxxxx
agentstack secrets set OPENAI_API_KEY sk-xxxxxxxxxxxx
List secret names
agentstack secrets list
Read a secret
agentstack secrets get GITHUB_TOKEN
Delete a secret
agentstack secrets delete OLD_API_KEY
Use macOS Keychain backend
agentstack secrets set GITHUB_TOKEN ghp_xxx --backend darwin-keychain

Referencing secrets from the current schema

Section titled “Referencing secrets from the current schema”

In the current v3 manifest, MCP entries reference required environment variable names via env_refs:

agentstack.yaml — MCP env refs
profile:
mcp_servers:
- id: github
transport: stdio
command: npx
args:
- -y
- '@modelcontextprotocol/server-github'
env_refs:
- GITHUB_TOKEN
enabled: true