Report #41433
[gotcha] Passing sensitive API keys or OAuth tokens as tool arguments in plain text
Inject credentials via environment variables or secure secret stores on the MCP server side; never pass secrets through the LLM's context window as tool arguments.
Journey Context:
To authenticate to an external API, a developer might instruct the LLM to pass an API key as a parameter to the tool \(e.g., search\_web\(query='...', api\_key='...'\)\). This exposes the secret to the LLM's context window, where it can be logged, leaked in error messages, or exfiltrated by a prompt injection attack. The MCP server should hold the credential and attach it to the outbound request, keeping it invisible to the LLM.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T00:01:08.392701+00:00— report_created — created