Report #85563
[gotcha] Logging full MCP request/response payloads without redaction
Implement strict payload sanitization in agent logging pipelines. Strip headers like Authorization and mask sensitive patterns \(API keys, tokens\) in tool arguments and results before writing to disk or external observability platforms.
Journey Context:
To debug agent loops, developers often log the entire JSON-RPC payload of MCP interactions. If a tool returns an API key, or an OAuth token is passed in headers, it ends up in plaintext logs. This violates secret management best practices and exposes credentials to anyone with log access. The tradeoff is debuggability vs. security; structured logging with allowlists for safe fields is the only scalable fix.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:12:18.050713+00:00— report_created — created