AgentKit
DocsKitsCLI ReferenceDesktop App
BetaYou are reading docs for the beta channel (3.2.0-beta.10). Features may change before the next stable release.Switch to stable →

sync

ak secrets sync rotate-recovery

Replace the recovery key, and optionally the vault password

Use ak secrets sync rotate-recovery for the operation described below. The command help records its arguments, effects, and options.

Command contract

Replace the recovery key, and optionally the vault password

Synopsis

Replace the recovery key, and optionally the password. The old recovery kit stops working. Use it when the recovery key or password may have leaked, or when a recovery enrollment appeared that you did not perform. --resume finishes a rotation that stopped after the new kit was handed out. Needs an email sign-in; an API-key sign-in asks for an emailed code in a terminal. On a vault an API-key sign-in created, which has no recovery bundle yet, it seals the first one: --password-file (or --new-password-file with --change-password) is the password the bundle is sealed under, prompted twice on a terminal. Refused when an AI agent runs it.

Effects: Appends a signed recovery-key rotation to the vault membership and uploads the recovery bundle resealed under the new recovery key. The new kit is shown once on the terminal (stderr), or written only to --recovery-kit-out with mode 0600, before anything is sent.

Exit status: 0 recovery key replaced, or the first recovery bundle sealed 1 wrong password, a stale stopped rotation (run again), or the server refused 2 invalid invocation, no kit destination, a short new password, no confirmation, or the store moved 3 --resume with nothing to resume, or no recovery bundle on the server 4 a rotation stopped earlier, or the kit file exists 5 local storage failure 6 refused: an AI agent is running this command 10 sync is not enabled on this device 11 the vault server is unavailable or busy; retry, or use --resume 13 integrity alarm; sync halted 14 not logged in, or this device was removed

ak secrets sync rotate-recovery [flags]

Examples

  ak secrets sync rotate-recovery --recovery-kit-out ./vault-recovery-kit-2.txt
  ak secrets sync rotate-recovery --change-password
  ak secrets sync rotate-recovery --resume

Options

      --backend string             Storage backend: keychain (default), file (age-encrypted vault), or memory (dev/test; values and its index are throwaway)
      --change-password            Also choose a new vault password
  -h, --help                       help for rotate-recovery
      --json                       Emit machine-readable JSON (implies --no-interactive)
      --new-password-file string   With --change-password, read the new password from this file, or - for stdin (default: prompt twice)
      --no-interactive             Disable interactive prompts (CI-safe)
      --password-file string       Read the current vault password (for a first bundle, the password to seal it under) from this file, or - for stdin (default: hidden prompt)
  -q, --quiet                      Suppress non-error output on stderr
      --recovery-kit-out string    Write the new recovery kit only to this new file (mode 0600), not the terminal; required with --json or without a terminal
      --resume                     Finish a rotation that stopped
      --unlock-with-recovery       Open the file backend's vault with a recovery private key and set a new passphrase
  -V, --verbose                    Extra diagnostic output on stderr (loses to --quiet)
      --wait-lock duration         How long to wait for another sync cycle to finish (default 30s)
  -y, --yes                        Assume yes for all prompts

SEE ALSO

  • ak secrets sync - Sync secrets across your machines with end-to-end encryption (preview)