3.1.0-beta.10). Features may change before the next stable release.Switch to stable →secrets
ak secrets
Manage named secret values (API keys, tokens)
Use ak secrets for the operation described below. The command help records its arguments, effects, and options.
Choose the backend with --backend, then the AGENTKIT_SECRETS_BACKEND environment variable, then the secrets section of the user-level config.yaml in your AgentKit home, in that order. With none set, the OS keychain is used. Project config is never read for this choice. The environment variable and config.yaml accept only keychain or file; the throwaway memory backend must be requested with --backend memory on the command line.
The file backend reads its vault passphrase only from an interactive terminal. No flag or environment variable supplies it, so an unattended run against the file backend cannot open the vault, and a secret resolve that an agent hook triggers exits with status 7. Use the keychain backend for scripted runs.
Secret names compare by their Unicode NFC form, the same rule the sync dashboard uses. A name typed with a combining accent, as macOS input often produces, finds the secret stored under its precomposed spelling, and the reverse. A new secret is stored under the NFC spelling, and an update keeps the spelling already stored. Grants, blocks, and synced policies follow the same rule, so a grant or block on a name covers an agent's request in either spelling. If two stored secrets differ only in Unicode form, an agent's resolve of that name is refused until one is deleted or renamed.
Use ak secrets sync to inspect or manage vault sync. When sync is enabled,
ak secrets approvals list shows requests from other devices and approve or deny
answers them. See the vault guide for the device and
approval requirements.
Command contract
Manage named secret values (API keys, tokens)
Synopsis
Store, read, list, delete, and rotate small named secret values behind the OS keychain, an age-encrypted vault (--backend=file, for a host with no usable keychain; see ak secrets recovery), or an in-memory --backend=memory dev backend. Values are written only to the active backend; ~/.agentkit/secrets/index.json holds metadata (ref, creator, timestamps, a short value hint, and an optional searchable profile) and never a value. Use it for an API key, token, or certificate AgentKit or an adapter needs at runtime, instead of an unmanaged .env file or shell export. Opt-in end-to-end encrypted sync (preview) keeps refs, values and profiles in step on every machine you sign in on, through vault.agentkit.best; check whether it is on with ak secrets sync status --json, which makes no network request.
Examples
ak secrets set ${REF} # interactive prompt
ak secrets list --json # machine-readable metadata
ak secrets search stripe --environment production --json # find a ref by metadata
ak secrets sync status --json # is cloud sync on for this device?Options
-h, --help help for secrets
--json Emit machine-readable JSON (implies --no-interactive)
--no-interactive Disable interactive prompts (CI-safe)
-q, --quiet Suppress non-error output on stderr
-V, --verbose Extra diagnostic output on stderr (loses to --quiet)
-y, --yes Assume yes for all promptsSEE ALSO
- ak - AgentKit CLI
- ak secrets alias - Point an env var name at one of several stored secrets
- ak secrets annotate - Describe a stored secret without changing its value
- ak secrets approvals - Answer secret requests sent from another synced machine
- ak secrets approve - Answer the secret requests agents left waiting
- ak secrets audit - Show the secrets access ledger and matching grants
- ak secrets compare - Check whether a value matches a stored secret, printing neither
- ak secrets delete - Delete a stored secret
- ak secrets describe - Show one secret's full profile and provenance, never its value
- ak secrets export - Emit a versioned inventory of every stored secret
- ak secrets get - Show a secret's metadata, redacted by default
- ak secrets grant - Let a fingerprinted agent binary read a secret
- ak secrets grants - List recorded agent grants
- ak secrets import-env - Bulk-import secrets from a dotenv file or a project directory
- ak secrets list - List stored secret refs and metadata
- ak secrets recovery - Manage the file backend's vault and its recovery keys
- ak secrets request - Ask the operator for access to a secret without releasing it
- ak secrets revoke - Remove an agent's grants on a secret, or all of them
- ak secrets rotate - Replace an existing secret's value
- ak secrets run - Run one program with secrets in its environment, under exec grants
- ak secrets search - Find stored secrets by metadata, never by value
- ak secrets set - Store a secret value
- ak secrets sync - Sync secrets across your machines with end-to-end encryption (preview)
- ak secrets trust - Show or re-pin a coding agent's trusted binary