Report #95078
[gotcha] Sensitive data leaked in MCP tool response
Implement response filtering or masking at the MCP server layer before returning data to the agent. Never return raw API credentials to the LLM context; store them in a secure vault and return a reference handle.
Journey Context:
Agents log their reasoning and tool outputs. If a tool returns an API key, it gets persisted in the agent's memory and potentially displayed to the user or sent to other tools. Developers often pass raw HTTP responses directly to the LLM for parsing, inadvertently exposing secrets. Returning a secure handle instead of the secret itself breaks the exfiltration chain.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:10:07.869676+00:00— report_created — created