Report #1506
[gotcha] MCP server authentication tokens exposed to the LLM context
Pass authentication tokens \(like Bearer tokens\) at the transport layer \(HTTP headers\) when connecting to remote MCP servers via SSE, never as tool arguments or environment variables injected into the LLM's system prompt.
Journey Context:
To authenticate with remote MCP servers, developers often instruct the LLM to append an API key to tool call arguments, or put the key in the system prompt. This exposes the credential to the LLM's logging, context window, and potential exfiltration via prompt injection. The MCP specification for remote transport supports standard HTTP authentication. Tokens must remain in the HTTP client layer, completely invisible to the LLM reasoning layer, to prevent the model from accidentally leaking them.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T00:31:41.955228+00:00— report_created — created