Report #45074
[gotcha] Passing secrets as tool arguments instead of using server-side environment variables
Bind secrets to the MCP server's environment variables or use OAuth flows; never pass API keys or credentials as arguments from the client LLM.
Journey Context:
Agents need to authenticate to APIs. Developers create a tool \`call\_api\(api\_key, query\)\`. The LLM passes the API key in the tool call arguments, which get logged by the MCP server or exposed in the agent's UI/logs. Secrets should be bound to the server environment, keeping them out of the chat context and tool payloads.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:07:28.888996+00:00— report_created — created