r/opencodeCLI • u/the__repeat • 15h ago
I built a small Mac CLI so Codex / Claude Code / Cursor can use API keys without seeing them
1
u/ProfessionalPut458 8h ago
smart approach. how are you preventing the agent from just dumping the environment variables or inspecting the child process output to grab the key anyway?
1
u/the__repeat 7h ago
It doesn't, honestly. The agent runs as your user, so it can run `ichain ns env` or a command that prints the key, and see it. Telling it not to in CLAUDE.md is a convention, not a boundary.
What ichain removes is the accidental path: keys sitting in .env that get read during normal work, and keys pasted into chat. In practice that's how most of mine leaked into transcripts. And the secrets sync across Macs via iCloud Keychain.
If you need a real boundary, you need a credential proxy that injects the key into outgoing requests so the agent never holds it (fnox has one), or run the agent as a separate user/VM without access to your keychain.
1
u/kantorcodes1 9h ago
Your setup keeps keys out of chat, which is where they usually leak into transcripts. The keys are stored in iCloud Keychain. The tool just uses a key without actually seeing it.
HOL Guard (the agent firewall I'm working on) has command extensions written by the authors of each tool. Would you want to write the ichain one?