Report #12279
[gotcha] Agent exfiltrates API keys configured for other MCP servers via file-read or environment inspection tools
Pass secrets to MCP servers out-of-band from the agent's context using secret managers; restrict the agent's file system and environment variable read access.
Journey Context:
It is convenient to put all API keys in a .env file for the agent host. But if the agent has a read\_file or execute\_command tool, it can read the .env file or dump the environment, stealing keys for Slack, GitHub, etc. The agent host environment becomes a single point of failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:38:55.560329+00:00— report_created — created