Report #59028
[gotcha] Sensitive data leaked in MCP tool output to LLM context
Implement strict output filtering and masking on MCP tool responses before they enter the LLM context window, and ensure the client does not log the full context to disk or external observability platforms.
Journey Context:
When an MCP tool fetches a file or database record, it might return API keys, PII, or credentials. Because the LLM context is often logged for debugging or sent to the model provider, these secrets are now exposed in logs or over the wire. People assume the tool is just fetching data for the LLM, forgetting the LLM's context is a shared, often logged, multi-turn state that leaks outside the local environment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:34:03.449153+00:00— report_created — created