Keep API keys out of your AI coding chats
The fastest way to leak an API key is to paste it into an AI chat. Once it's in the conversation, it's in the chat history, in the model's context, and possibly in a log you don't control. And the next AI that needs the same key makes you paste it again.
OwlMem's vault breaks that pattern: store the key once, and your AIs use it without ever seeing it.
How it works
The vault is end-to-end encrypted. Items are encrypted on your machine with a key only you hold, and OwlMem stores ciphertext it can't read — not even OwlMem can open it. The main account turns it on in the console under Vault; everyone in the organization can then use it. Keep the recovery code it shows you: it's only for emergencies.
From then on, the flow is:
- Your AI asks when it needs a password. You approve on your phone — passkey, authenticator app, or GitHub — for 15 minutes to 2 hours at a time. Deleting and exporting always need a fresh approval.
- The AI gets the value without seeing it.
owlmem runputs secrets into a command's environment. For jobs that run while you're away, turn on a standing grant: the AI can then use any vault item on computers you've approved, only throughowlmem runandvault_run. Viewing, saving, deleting, and exporting still ask you each time.
The rule the product itself enforces: never put passwords or API keys in documents, memory, or chat. Use the vault.
Set it up
The main account turns the vault on in the console under Vault. The first time on a computer, send your AI this sentence (quoted from the docs):
Please set up the OwlMem vault on this computer: follow the vault section at https://mcp.owlmem.com and tell me what you need from me.
For developers, the owlmem command (Node 18 or later) is the hands-on route:
npm install -g owlmem
owlmem login # paste a token for this agent
owlmem vault unlock # press Enter to approve in your browser with a passkey (or paste the recovery code)
owlmem run --env DB_PASSWORD=prod/db:password -- ./deploy.sh
owlmem run puts secrets into the command's environment, so the AI never sees them. To let an AI use the vault directly, add the local MCP server — decryption stays on your machine:
claude mcp add owlmem-vault -- npx -y owlmem mcp
When you press Enter at owlmem vault unlock, your browser opens a page showing the AI, the machine, and a code — check that the code matches your terminal, tap your passkey, and the key is sent to that machine only, encrypted for it.
Unlock with a passkey. Every passkey you add under Your approval methods is set up to unlock the vault too, using your device's fingerprint or face. After that, importing, exporting, and unlocking a new machine are one tap — the recovery code is only for emergencies.
You can import what you already have: Bitwarden, 1Password, KeePass, and .env files all import from the console, and export works the same way with one tap of your passkey. Changed or deleted items keep their previous version for 30 days, so a mistake is recoverable.
If a key already leaked into a chat
Stop pasting it, then clean up what already escaped:
- Rotate the key at the provider, and store the new one in the vault. Rotating is the only step that actually invalidates what leaked.
- Retire it from memory. If an AI saved the key as a fact, retire that memory with
kb_forget. If it ended up in a document, delete the page — every change is a git commit, so you can restore it if needed. - Check who can see it. An AI that already saw the key in a past chat can't unsee it, but the vault means no future chat needs the value at all. From now on, the AI asks, you approve, and the key itself never appears in a conversation again.
The habit to keep
The vault only helps if the key never goes into chat in the first place. Next time you're about to paste a key for an AI, store it in the vault instead — once. After that, every AI that needs it asks you, you approve on your phone, and the key never appears in a conversation again.
The Free plan includes 20 vault items, which covers the handful of keys most developers actually hand to an AI. The full setup is in the docs.
When not to use OwlMem
- If you need the AI to see the key value itself — to print it, compare it, or paste it somewhere — the vault can't help you: not showing the value is the whole point. Use a password manager directly instead.
- If you need enterprise secret management with automatic rotation, fine-grained audit trails, and per-secret access policies, use a dedicated secrets manager. The vault is built for one job: letting your AIs use credentials without seeing them.
- If you never give your AIs jobs that need a credential, you don't need a vault at all. Skip it until the day an AI asks you for a password — that's when it earns its place.
FAQ
Can OwlMem itself read my keys?
No. Items are encrypted on your machine with a key only you hold, and OwlMem stores ciphertext it can't read. Your AIs use the values through owlmem run or the local vault server, where decryption stays on your machine.
What if I lose the recovery code?
The recovery code is your emergency way back in — keep it somewhere safe, separate from the machine. With a passkey set up, day-to-day unlocking is one tap; but without a passkey and without the code, there is no other way in, because nobody else holds the key.
Can I import keys I already have?
Yes. Import from Bitwarden, 1Password, KeePass, and .env files from the console, or export the same way with one tap of your passkey. Previous versions are kept for 30 days when an item changes or is deleted.
Does the vault work for CI jobs?
For scripts and CI, use a token instead: create one in the console under Agents & tools → Connect an AI and send it as a bearer token. Tokens start with om_ and don't expire; revoke one in the console when you no longer need it. The vault is for interactive AIs on computers you approve.
What happens when an AI asks for a key I'm not around to approve?
OwlMem tells you right away: a notification on your phone or computer, and an email if no one has answered after a minute. For jobs that run while you're away, turn on a standing grant for that AI — it can then use vault items without asking, only through owlmem run and vault_run. Saving, deleting, and exporting still ask you each time.