3.4.0-beta.1). Tính năng có thể thay đổi trước bản stable tiếp theo.Chuyển sang stable →secrets
ak secrets approve
Trả lời các yêu cầu bí mật mà agent đang để chờ.
Trả lời các yêu cầu bí mật mà agent đang để chờ.
Dùng ak secrets approve với đối số và tùy chọn dưới đây. Phần help nguyên bản giữ nguyên thuật ngữ, cú pháp, tác động và điều kiện thực thi của CLI để đối chiếu chính xác.
Khi bật sync, yêu cầu mà thiết bị này ghi nhận cũng được gửi tới các thiết bị
khác của bạn, nơi bạn trả lời bằng ak secrets approvals. Câu
trả lời đầu tiên được tính: trả lời ở đây sẽ rút yêu cầu ở xa, còn câu trả lời
từ thiết bị khác sẽ xóa mục đó khỏi hộp duyệt của máy này.
Duyệt cho các git worktree
Từ AgentKit CLI v3.2.0-beta.12, ak secrets approve <ref> --state ttl --repo
lưu quyền cho cùng đường dẫn dự án trong mọi worktree của repository gắn với
yêu cầu. Hãy kiểm tra phạm vi trước khi dùng. Nếu truyền --state deny hoặc một
yêu cầu đã chọn thiếu git worktree được hỗ trợ, lệnh thoát 2 trước khi lưu câu
trả lời.
Contract và help của lệnh
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)