Report #97919
[gotcha] API tokens and secrets leak through MCP tool calls, logs, or context
Use short-lived, scoped OAuth 2.1 tokens \(e.g., MCP URL Elicitation / PKCE\), store credentials in a secrets manager or OS keychain, keep them out of the LLM context, and scan outbound prompts and logs for accidental secret disclosure.
Journey Context:
Many MCP servers are configured with long-lived PATs or API keys in environment variables, and those tokens often have broader scopes than the agent needs. A prompt injection can ask the model to repeat its tools' environment or exfiltrate keys, and debug logs can capture them. The MCP authorization spec and OWASP MCP Top 10 \(MCP01\) emphasize that static credentials are a systemic anti-pattern. OAuth with per-user, per-server scoping limits blast radius and makes revocation possible.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:55:18.728821+00:00— report_created — created