From .env to a vault, step by step.
Part 1 works today with the AgentKit CLI. Parts 2 and 3 describe the planned sync and agent commands; each planned step is marked and its syntax may change before release.
available works in the current ak CLI. planned is designed but not released; do not script against it yet. Sync is not generally available and the production sync API is switched off.
Keep secrets in the local vault available
Everything stays on this machine: values live in the OS keychain by default, or in an age-encrypted file vault, and agents read them through references you control.
Install the AgentKit CLI
availableThe local vault ships inside
ak, the AgentKit CLI. AgentKit is in closed beta; follow the install instructions at agentkit.best.Import an existing
available.envfileExisting keys are skipped unless you pass
--force. Check the result, then delete the plaintext file.$ ak secrets import-env .env $ ak secrets listAdd or replace a single secret
availablesetandrotateprompt for the value without echoing it, so it never lands in your shell history. They also accept--value=-from stdin or--value-file.$ ak secrets set OPENAI_API_KEY $ ak secrets rotate OPENAI_API_KEYInspect without revealing
availablegetshows metadata and prints the value as[redacted]. Add--revealonly when you need to see it; it asks you to confirm first.$ ak secrets get OPENAI_API_KEYReference secrets in agent configs
availablePut a reference where the value used to be.
akresolves it locally, and only for an agent binary you have granted.OPENAI_API_KEY=${secret:OPENAI_API_KEY}Decide which agents may read it
availableWhen an agent asks for a secret, the request waits for you. Answer it once, for a time window, or grant an agent fingerprint ahead of time. The audit ledger shows every access and the grant that allowed it.
$ ak secrets approve $ ak secrets grants $ ak secrets audit
Sync a second device planned
The end-to-end encrypted sync described on this site. Not available until the security review closes.
Sign in to your AgentKit account
available sync use plannedak loginexists today for your AgentKit account. Using that sign-in for vault sync is planned.$ ak loginOpt in to sync on your first device
plannedSync stays off until you turn it on. Enabling it creates the vault key on this device, wraps it to your device key, a password-derived key and a recovery key, and uploads only ciphertext.
# PLANNED: not available yet, syntax may change $ ak secrets sync enableSave your recovery key offline
plannedYou will be shown a 32-byte recovery key, written in Crockford base32. Store it on paper or in a password manager you trust. If you lose every device, your password and this key, nobody can decrypt the vault.
Enroll a second device with a six-digit code
plannedStart enrollment on the new device and approve it on one you already trust. Both screens show the same six digits; approve only if they match. A mismatch aborts. See how the code is derived.
Check that it worked
plannedThe new device verifies the signed member list before it unwraps anything. Change a secret on one device and expect it on the other within about a minute on a healthy connection (a design target, not a measured result).
Let agents discover and use secrets planned
Planned commands that let an agent find and request secrets without ever seeing values it was not granted.
Let agents find secrets by description
plannedsearchanddescribeare planned so an agent can find the right secret from its encrypted description without seeing any value.# PLANNED: not available yet, syntax may change $ ak secrets search "openai" $ ak secrets describe OPENAI_API_KEYLet agents ask for what they need
plannedrequestis planned so an agent can ask for a secret it has not been granted, and the request waits for your approval.Run a process with secrets injected
plannedrunis planned to start a child process with the approved values in its environment. That process receives plaintext by design, so grant it only to software you trust.# PLANNED: not available yet, syntax may change $ ak secrets run -- npm start
If a device is lost or stolen
Some of this works today on the local vault; the device-removal steps arrive with sync.
Revoke the lost device
plannedOnce sync ships, a removed device is checked on every request, so it is refused even with an unexpired token. Removal also moves the vault to a new key epoch before new writes.
Rotate what it could read
availableRevocation cannot take back values the device already decrypted. Rotate sensitive credentials at the provider, then store the new value. This works today.
$ ak secrets rotate OPENAI_API_KEYCut off agents on that machine
availableRemove an agent fingerprint's grants on one secret, or all of them at once.
$ ak secrets revoke OPENAI_API_KEY --agent sha256:<fingerprint> $ ak secrets revoke --agent sha256:<fingerprint> --allLost every device? Recover with your password or recovery key
plannedA fresh device can enroll itself through the encrypted recovery bundle, which also carries the owner's public trust anchor and the newest witnessed checkpoint so it does not have to trust the server.
Keep reading
Reading this with an AI assistant? Grab the Markdown version, or open it straight in your assistant.