Report #81427
[gotcha] Passing secrets as MCP tool arguments exposes them to the LLM context
Use MCP server-side environment variables or the standard OAuth 2.0 flow for authentication. Never pass API keys or tokens as tool arguments.
Journey Context:
It is tempting to pass API keys as tool arguments so the server can authenticate to third-party services. However, the LLM sees all arguments. If the key is in the context, it can be exfiltrated by a prompt injection attack or logged in plaintext. The MCP spec explicitly requires keeping secrets out of the message stream by using server-side environment variables or standard OAuth.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T19:16:11.623783+00:00— report_created — created