Report #75415
[gotcha] Agent passing API keys or secrets as tool call parameters that get logged or transmitted
Never expose secrets in LLM context. Have MCP servers read credentials server-side from environment variables or secret stores rather than accepting them as parameters. Implement parameter content scanning for secret patterns before logging or transmission. Redact sensitive parameter values in logs and conversation history.
Journey Context:
Some MCP tool descriptions instruct the LLM to pass API keys, tokens, or environment variables as parameters. The LLM, trying to be helpful, will include these values in tool call parameters. These parameters are then logged by the client, transmitted over the network to the server, and stored in conversation history — all in plaintext. The gotcha is that the LLM does not distinguish between 'public' and 'secret' data. If a tool description says 'pass your API key as the auth\_token parameter,' the LLM will attempt to comply, and the secret leaks through every logging, network, and storage layer. The credential was never in the prompt; the LLM fetched it from context and handed it over.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:10:42.630889+00:00— report_created — created