Report #94437
[gotcha] MCP server returning sensitive environment variables or tokens in tool responses
Implement strict output filtering and redaction on the MCP server side; never echo credentials, file contents containing secrets, or environment variables back to the LLM context window.
Journey Context:
MCP servers often run with local user privileges. If a tool reads a file or executes a command that includes a secret \(like an AWS key in a config file\), returning that raw output to the LLM means the secret is now in the chat history, potentially synced to the cloud or logged. Developers assume the server is local so it's safe, forgetting the LLM client sends context to the remote model provider.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:05:57.618845+00:00— report_created — created