I am building Primal Code , a desktop code editor based on VS Code where you can run coding agent CLIs like Claude Code side by side in terminal panes, using your own API keys.
The obvious way to give a CLI your key is to put it in an environment variable:
export ANTHROPIC_API_KEY = sk-ant-... claude
Enter fullscreen mode
Exit fullscreen mode
It works, but the more I looked at it, the less I liked it for an editor that runs agents all day:
Every child process inherits it. The agent runs shell commands, test scripts and npm install with its postinstall hooks. All of them can read the key.
An agent can be talked into leaking it. A prompt injection hidden in a README or an issue only needs the agent to run echo $ANTHROPIC_API_KEY or env once.
The key can do far more than chat. A provider key can usually also upload and read files, run batches, and reach stored conversations. A coding agent needs none of that.
So I built a different setup: the CLI never sees the real key.…