AgentKit
Tài liệuBộ kitTham chiếu CLIỨng dụng Desktop

secrets

ak secrets revoke

Gỡ grant của một agent trên một bí mật, hoặc gỡ toàn bộ.

Gỡ grant của một agent trên một bí mật, hoặc gỡ toàn bộ.

Dùng ak secrets revoke 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.

Thu hồi grant cấp repository

Từ AgentKit CLI v3.2.0-beta.12, chạy ak secrets revoke <ref> --agent sha256:<hash> --repo từ một worktree của repository. Nếu checkout đã bị xóa, truyền slot repo: đúng như ak secrets grants in ra cho --project. Grant riêng của từng worktree vẫn được lưu riêng. Dùng chung --repo và --all trả mã 2.

Contract và help của lệnh

Remove an agent's grants on a secret, or all of them

Synopsis

Delete the grants an agent binary holds. Without --all this removes every decision — allow and block alike — on one exact scope, which is also how a block is cleared. --all is the panic button: it removes every grant that fingerprint holds, across all secrets, projects, and purposes.

--agent takes a sha256:<64 hex> fingerprint or a pinned adapter name such as claude, which resolves to the adapter's current pin. A grant recorded before a re-pin keeps the old fingerprint; revoke it by the fingerprint ak secrets grants lists. --all takes only a fingerprint.

An exec grant is revoked by naming it the way it was granted, with --exec and --env; any program hash matches, so a grant to a program that has since changed or been removed can still be cleared; pass the program by the path ak secrets grants prints if it is gone. An ordinary revoke leaves exec grants on the same secret in place and says how many remain. --all removes exec grants too.

--repo revokes the grant recorded with --repo on the repository-wide slot of the project containing the current directory (or --project); the per-worktree grants are separate rows and stay. A repository-wide slot can also be named exactly as ak secrets grants prints it, with --project repo:<git dir>, after the repository itself is gone.

This revokes grants, not secrets. The stored values are untouched and any copy the agent already read is still out there, so treat a panic revoke as the first step and ak secrets rotate <ref> as the second.

Effects: Removes matching rows from the grants file under AGENTKIT_HOME. The stored secret values are untouched, and so is any copy an agent already read.

Exit status: 0 success, 1 command failure, 2 invalid flags or arguments

ak secrets revoke [<ref>] [flags]

Examples

  ak secrets revoke ${REF} --agent claude                  # one scope, the pinned claude binary
  ak secrets revoke ${REF} --agent sha256:${HASH} --repo   # the repository-wide grant
  ak secrets revoke --agent sha256:${HASH} --all           # panic button

Options

      --agent string     Agent to match: a pinned adapter name such as claude, or its full sha256:<64 hex> fingerprint (required)
      --all              Revoke every grant this agent holds, across all secrets
      --env string       Environment variable the program receives the secret in (needs --exec)
      --exec string      Program the secret is revoked for, by name on PATH or by path; makes this an exec scope (needs --env)
  -h, --help             help for revoke
      --json             Emit machine-readable JSON (implies --no-interactive)
      --no-interactive   Disable interactive prompts (CI-safe)
      --project string   Project slot; defaults to the AK project containing the current directory
      --purpose string   Purpose label of the grant to remove; matched literally
  -q, --quiet            Suppress non-error output on stderr
      --repo             Revoke the repository-wide grant recorded with --repo instead of this worktree's
  -V, --verbose          Extra diagnostic output on stderr (loses to --quiet)
  -y, --yes              Assume yes for all prompts

SEE ALSO

  • ak secrets - Manage named secret values (API keys, tokens)