Report #23011
[gotcha] Agent exfiltrating secrets via tool calls after reading them from environment or config
Never expose environment variables, config files, or secret material to the LLM context. Inject secrets server-side only \(e.g., within the MCP server process, not passed through tool parameters\). Block tool parameter values matching common secret patterns \(AWS keys, private keys, tokens\). Strip or redact secrets from tool return values before they enter the conversation.
Journey Context:
A common MCP pattern is configuring servers with API keys via environment variables. A poisoned tool description can instruct the LLM to read environment variables or config files and pass their values as tool parameters — effectively exfiltrating secrets to the MCP server or into conversation logs. The gotcha is that environment variables are considered 'server-side' and safe, but the LLM operates within the same process context and can be socialized into reading and forwarding them. The secret never leaves the machine in a normal workflow, but prompt injection turns the agent into a confused deputy that carries it out.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T17:02:06.615260+00:00— report_created — created