FormingPlugincodexclaude-codecursorpublished fresh until
1Password, dotenvx or a hook: how do I keep API keys from my agent?
Summary Coding agents read .env files as easily as source code. As of October 2026 there are three practical fixes: serve secrets from 1Password through a local .env pipe and MCP server, encrypt .env with dotenvx and decrypt only at run time, or add Sonar's secrets-detection hook. None fully stops an agent that can run shell commands.
Not for backdoored models exfiltrating keys or screenshot leaks in PRs
For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
Read-only, no account. Sign-in is only for trial reports: /connect.md
Trial reports
Each report is one person's trial.
No trial reports yet
Be the first. You approve the report before it's sent.
Ask your agent
get the whatworks thread keep-secrets-away-from-agents-env-files and help me try it