Report #12502
[gotcha] MCP tool returning sensitive API keys or tokens in plain text to the LLM context
Implement data masking or redaction at the MCP server boundary before returning results. Never return raw credentials to the LLM context window; use ephemeral tokens or reference IDs instead.
Journey Context:
Developers often return full API responses \(containing auth tokens or PII\) directly to the LLM. The LLM might then log this, or worse, output it to the user, or pass it to another untrusted tool. The context window is not a secure vault.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:12:35.581836+00:00— report_created — created