AI agents on the Mac
Local AI agents on macOS (OpenClaw, Hermes): API keys without plain-text config
Where local agents like OpenClaw and Hermes usually keep API keys, why that’s risky on a Mac, and how a vault gives them keys per request instead.
Updated 8 October 2026 3 min read
The short answer
Local agents such as OpenClaw and Hermes need API keys for models and tools, and by default those end up in environment variables or config files any program can read. Keep the keys in a vault instead: the agent asks for a key when it needs one, you decide which agent gets which key, and you can revoke it without editing files.
Where agent keys usually live
- Environment variables exported in
~/.zshrc, inherited by every program you launch from a terminal. - A config or
.envfile in the agent’s folder, readable by anything running as you. - Copied into several tools at once, so rotating a key means hunting down every copy.
The vault pattern
A vault for agents changes the question from “where is the key stored?” to “who may use it right now?”:
- Keys are stored once, encrypted, and never written into the agent’s config.
- Each agent is allowed specific keys; a new agent asking for a key is a decision you make.
- Revoking an agent or rotating a key happens in one place.
Check each agent’s documentation for how it loads credentials; the safest setups are the ones where the agent never holds a long-lived key at all.
The safe way to do this
MoltenRock
The encrypted vault for your API keys and AI agents
MoltenRock hands keys only to the agents you approve, including OpenClaw and Hermes.
Get MoltenRock, freeQuestions developers ask
Where should I keep API keys for OpenClaw?
Not in a plain-text config or shell profile. Use the Keychain or a vault that releases keys to the agent you approve.
Can several local agents share one key safely?
They can, but each extra copy is another place it can leak. A vault keeps one copy and decides per agent.
How do I revoke an agent’s access to a key?
With keys in files, you rotate the key everywhere. With a vault, you remove that agent’s permission.