Repository navigation
MCP: Protect payloads and OAuth credentials in logs #2635
Description
Keep document contents, queries, and OAuth credentials out of normal MCP logs. The current message logging setting truncates payloads, which can still expose sensitive values. Production exposure has not been established. This work is required for the launch in #2408.
Disable normal payload logging and keep useful command categories, errors, and correlation IDs. Diagnostic logging must require explicit configuration and bounded retention. Credentials must stay redacted in diagnostic mode too.
This ticket is done when synthetic payload markers are absent from normal logs and synthetic credential markers are absent from normal logs, diagnostics, and errors. #2634 verifies the deployed configuration before release.
Status on October 23, 2026
PR #2648 implements this and is still open in the MCP stack. Its focused suite passed 85 tests locally. A new trace-to-log correlation test failed before the fix and passed after it in all three logging profiles. It has no CI run yet because it does not target main. Deployed logging and retention checks remain in #2634.
Implementation requirements and source references
Tracking issue: #2408.
Tracking correspondence: L6 credential-safe operational logging. Protocol notifications are #2625/#2626. Shared requirement IDs remain stable across the delivery plan and #2408.
Why
The checked-in configuration enables MCP traffic logging and truncates each message to 1,000 characters. That can still include document contents, queries, or returned data. Truncating a message does not remove sensitive values. Production log exposure has not been established.
This existing logging-default issue also owns credential-safe logging required for the OAuth launch.
Work
- Disable MCP message-payload logging in normal deployment configuration.
- Redact access/refresh tokens, authorization codes, PKCE verifiers, registration secrets and credential headers from normal logs, errors and diagnostics.
- Keep an explicit diagnostic opt-in with bounded duration/retention. Document its permitted payload exposure. Credentials must remain redacted even in diagnostic mode.
- Preserve useful operational command/error categories and correlation identifiers without exposing payloads or credentials.
Done when
Synthetic document/query markers are absent from normal logs. Synthetic credential markers are absent from both normal and diagnostic logs and error output. Operational logs remain useful, diagnostic logging requires explicit configuration and its bounded retention is documented.
This is a launch gate for #2634 (L6). Protocol-level notification opt-in/removal behavior belongs to #2625 and is verified by #2626. Related #2559 and #2330 cover broader command logging and metrics.
Changelog traceability
- M5 Remove obsolete utility methods, lines 20 — Required.
- m2 Propagate trace context, lines 33 — Recommended.
- D1 Avoid deprecated roots sampling and logging, lines 73–80 — No new feature.
Normative detail: Streamable HTTP, authorization, caching.
Activity
[-]Disable MCP payload logging by default[/-][+]MCP: Disable payload logging by default[/+][-]MCP: Disable payload logging by default[/-][+]MCP: Protect payloads and OAuth credentials in logs[/+]