3.4.0-beta.1). Features may change before the next stable release.Switch to stable →secrets
ak secrets approve
Answer the secret requests agents left waiting
Use ak secrets approve for the operation described below. The command help records its arguments, effects, and options.
With sync on, a request this device filed is also sent to your other devices,
which answer it with ak secrets approvals. The first answer
wins: answering here withdraws the remote request, and an answer given on
another device clears the entry from this inbox.
Approve across git worktrees
From AgentKit CLI v3.2.0-beta.12, ak secrets approve <ref> --state ttl --repo
records the allow for the same project path in every worktree of the request's
repository. Review the wider scope before using it. With --state deny, or if a
selected request lacks a supported git worktree, the command exits 2 before
recording any answer.
Command contract
Answer the secret requests agents left waiting
Synopsis
Answer the secrets that agents asked for and could not have. A resolve that no grant covers does not prompt — a hook has no terminal to prompt on, and one that stalled would be ignored rather than obeyed — so it files the request here and fails closed. This is where you answer it, in a terminal of your own.
There are four answers. Deny once refuses this request and stores nothing, so the next one asks again. Allow once releases the secret exactly once. Allow for a while is the default and expires on its own. Allow until revoked never expires. Each writes the same grant rows ak secrets grant does, keyed by the same four fields, so ak secrets grants and ak secrets revoke work on them unchanged.
With no --state and a terminal, each waiting request is shown in turn and answered by a single key. Without a terminal, or with --json, the command only lists: there is nobody at the keyboard to ask. --state answers without the prompt and needs the request named unambiguously.
The command refuses to run at all when an agent adapter sits above it in the process tree, and records that attempt in the audit ledger. An agent answering its own request would make the whole inbox theatre. This is a speed bump, not a guaranteed boundary: it depends on recognizing an adapter in the parent-process chain, and a detached process or a redirected AGENTKIT_HOME looks like an operator's own terminal to it.
A request made with ak secrets request --exec asks for an exec scope: the secret delivered only in one environment variable of one hashed program. Its EXEC column and prompt line name the variable, the program and its hash, and answering it writes an exec grant. --env narrows to the requests for one variable; --env "" narrows to the ordinary ones. The desktop app lists and answers exec requests too, with the same warnings.
--repo records each allow on the request's repository-wide slot instead of its own worktree, exactly as ak secrets grant --repo does: the same AK project in every git worktree of the repository then matches, including branches nobody has reviewed yet. It is refused for a request outside a git repository and with --state deny.
Effects: Reads the approval inbox and the alias file under AGENTKIT_HOME; a request for a name that is also a local alias carries a warning, since an allow reaches whatever secret is stored under that name, never the alias target. An answer writes one row into the grants file and clears that request; a denial writes an audit row and clears it. Stored secret values are never read or printed.
Exit status: 0 success 2 invalid flags, the answer matches no request or more than one, or --repo for a request outside a git repository 5 the inbox, grant file, or audit ledger could not be used 6 an agent adapter is above this process, or the check for one failed; an agent may not answer its own request
ak secrets approve [<ref>] [flags]Examples
ak secrets approve # review everything waiting
ak secrets approve ${REF} --state ttl --ttl 30d # allow for 30 days
ak secrets approve ${REF} --state ttl --repo # allow in every worktree of this repository
ak secrets approve ${REF} --state deny # refuse this requestOptions
--agent string Narrow to one agent fingerprint, sha256:<64 hex>
--env string Narrow to exec requests for one environment variable; an empty value names the ordinary requests
-h, --help help for approve
--json Emit machine-readable JSON (implies --no-interactive)
--no-interactive Disable interactive prompts (CI-safe)
--project string Narrow to one project slot
--purpose string Narrow to one purpose label; an empty value is a literal, not a wildcard
-q, --quiet Suppress non-error output on stderr
--repo Record each allow on the repository-wide slot so every git worktree of the request's repository matches (opt-in, wider scope)
--state string Answer without the prompt: deny, once, ttl, or persist
--ttl string How long an allow lives, e.g. 12h, 30d, 2w (default 24h)
-V, --verbose Extra diagnostic output on stderr (loses to --quiet)
-y, --yes Assume yes for all promptsSEE ALSO
- ak secrets - Manage named secret values (API keys, tokens)