Report #52078
[gotcha] Passing secrets as tool arguments instead of headers or environment variables
Never pass API keys, tokens, or PII as tool arguments; use secure context injection, environment variables on the server, or OAuth headers for authentication.
Journey Context:
To authenticate to an external API via an MCP tool, developers often instruct the LLM to pass the API key as an argument \(e.g., call\_api\(key='...', query='...'\)\). Tool arguments are frequently logged, stored in context history, and sent in plaintext to the MCP server, exposing secrets. The LLM context is not a secure vault, and arguments are the most exposed part of the tool call lifecycle.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:54:22.870296+00:00— report_created — created