npx.
The examples below use the latest published
@lit-protocol/keychain. Pin an exact version
(@lit-protocol/keychain@2.0.6, for example) in anything you deploy, and check the
npm page for release notes before upgrading.1. Generate an agent identity
On the machine that will run the agent:publicKey. Share only the public key with the owner. The file is never overwritten if it already exists.
2. Sign in and store a secret
1
Sign in
Open keychain.litprotocol.com and sign in with Google, a wallet or a passkey. Each method can own a vault; Google needs neither a wallet nor a passkey. See Sign-in and recovery for the custody tradeoffs.
2
Add a secret
Choose Add secret, then either Store a secret (the agent receives the value) or Connect a service (the agent runs one reviewed action and never sees the key). Name it in
UPPER_SNAKE_CASE, for example OPENAI_API_KEY, and paste the value. It is encrypted in your browser before upload.3
Approve the agent
Open the secret, paste the agent’s public key under Authorized agents, give it a name and click Approve agent. One wallet prompt or passkey touch signs the policy. Permissions default to 30 days; you can pick any length or remove the expiry.
4
Download the agent config
Click Agent config to download
OPENAI_API_KEY.keychain.json. It contains public locators plus a scoped execution key that pays for Lit execution. It is not a backup and holds no secret value, but keep it private.An agent approved for several secrets needs only one file: click Config · all secrets next to its name under Authorized agents to download a config naming every secret in the vault that key may use. The keychain run, get and use commands take one config; the MCP server also accepts several.3. Read the secret
- Node SDK
- CLI: hand it to one command
- MCP: Claude Code, Codex, Cursor
4. Revoke, rotate, renew
Everything is on the secret’s page in the dashboard:- Revoke removes one agent. The action fetches the current policy on every request, so the agent’s next request is denied.
- Disable switches the secret off for every agent without deleting it.
- Rotate & approve encrypts a new value and moves the existing agents to it in one signature. Downloaded configs keep working.
- Renew permissions sets a new expiry any number of days from now, or Never expire removes it so access lasts until you revoke or disable it.
Next steps
SDK, CLI and MCP reference
Every command and tool, the three credential files, and what each
Access denied: message means.Connected services
Let an agent read a Stripe balance or post to Slack without ever holding the key.
Sign-in and recovery
Add a second owner credential and download a backup before storing anything valuable.
Security model
What the operator can see, what it can never do, and the limits of revocation.