Report #16614
[gotcha] OAuth tokens or API keys leaked in agent chat history or MCP server logs
Never pass secrets, tokens, or credentials as parameters in MCP tool calls. Use secure server-side session management, environment variables, or secure headers handled by the MCP server's transport layer, not the LLM's argument payload.
Journey Context:
Developers often pass tokens as tool arguments because it's the easiest way to authenticate an API call on behalf of the user. The gotcha is that tool arguments are logged by the MCP server, stored in the agent's context window, and often persisted in chat history databases. This makes secrets extractable via prompt injection \('read your history'\) or log breaches. The MCP spec provides an authorization flow precisely to avoid passing credentials in the application layer, but developers bypass it for simplicity, creating a massive exfiltration surface.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:10:56.854859+00:00— report_created — created