secrets

Commands for storing and managing secrets such as API keys and other credentials in a local secret vault. The vault can use a file, environment variables, or the operating system keychain.

In plain words
What is it for?
Use them to save API keys and tokens, read them when needed, see which secret names exist, and remove credentials that are no longer used.
Why use it?
They keep credentials separate from source code and provide a way to set, retrieve, list, or delete them through one interface.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/thrashr888/agentkernel/secrets
Clone the repo
git clone --depth 1 https://github.com/thrashr888/agentkernel
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 445 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00445
Opus 5 $0.00000 $0.00222
Sonnet 5 $0.00000 $0.00089
Haiku 4.5 $0.00000 $0.00044

Measured yesterday against content hash 3911c7ee10ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

secrets scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/secrets.md · 70 lines

What it actually says

agentkernel secret

Manage secrets (API keys and credentials) in the secret vault.

Subcommands

Command Description
secret set <KEY> [VALUE] Store a secret (reads from stdin if value not provided)
secret get <KEY> Retrieve a secret value
secret list List all stored secret keys
secret delete <KEY> Delete a secret

Examples

Store a secret

# Set directly
agentkernel secret set ANTHROPIC_API_KEY sk-ant-...

# Read from stdin (more secure, avoids shell history)
echo "sk-ant-..." | agentkernel secret set ANTHROPIC_API_KEY

Retrieve a secret

agentkernel secret get ANTHROPIC_API_KEY

List secrets

$ agentkernel secret list
Keys:
  ANTHROPIC_API_KEY
  OPENAI_API_KEY
  GITHUB_TOKEN

Delete a secret

agentkernel secret delete GITHUB_TOKEN

Storage Backends

The vault supports three backends, configured in agentkernel.toml:

[secrets]
backend = "file"   # "file" (default), "env", or "keyring"
Backend Storage set/delete Best For
file ~/.agentkernel/secrets.json (base64-encoded, 0600 perms) Yes Local development
env Host environment variables No (read-only) CI/CD pipelines
keyring OS keychain (macOS Keychain, Linux secret-service) Yes Production workstations

The keyring backend requires building with the keyring Cargo feature.

See Also

  • Secrets Overview — proxy injection, placeholder tokens, file injection, SDK usage, and security model
  • Agents — agent-specific API key configuration
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 70 lines · 0 tokens per session scan A 3911c7ee10ce

Subscribe to this mod's changes

secrets is a command published in the GitHub repository thrashr888/agentkernel (58 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 445 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.