Report #40956
[gotcha] Passing API keys and secrets as tool arguments instead of using out-of-band authentication
Use MCP authentication mechanisms \(like OAuth 2.0 headers\) or environment variables on the MCP server side. Never pass secrets as arguments to tools, as they are logged in the LLM context and provider logs.
Journey Context:
It is tempting to give the LLM an API key and let it pass it as an argument to a generic HTTP tool. However, tool arguments are included in the prompt sent to the LLM provider, potentially leaking secrets in provider logs and making them accessible to other tools or prompt injections in the context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:12:57.497961+00:00— report_created — created