Make network-secret redaction the default and require an explicit unsafe reveal flag

Author: yogurtearlCreated Sep 15, 2026Updated Sep 15, 2026
Labelscollecting-feedbackfeature

Is your feature request related to a problem? Please describe.

get_network_request can return request URLs, request headers, request bodies, response headers, and response bodies to an MCP client. These fields can contain bearer tokens, API keys, cookies, session identifiers, signed URL parameters, passwords, and other credentials. Once a value reaches the client or model context, client-side filtering is too late.

The existing --redact-network-headers option is a useful start, but it is disabled by default and only applies DevTools header sanitization. URL query parameters, request bodies, response bodies, saved body files, and other output paths can still contain secrets.

This creates an unsafe default for agents that inspect authenticated applications. A routine debugging request can expose authentication material without an explicit user decision.

Describe the solution you'd like

Enable network-secret redaction by default for the MCP server and CLI.

Apply the policy consistently to:

  • Markdown and structured network output
  • Request and response headers
  • Cookies and Set-Cookie values
  • URL user information, sensitive query parameters, and fragments
  • JSON, form, and multipart fields with common secret names
  • Redirect-chain details
  • Saved .network-request and .network-response body files
  • Logs and error messages that include network data

Preserve field names and non-sensitive diagnostic data. Replace each sensitive value with a stable marker such as <redacted>.

Provide a server-start option with an intentionally dangerous name, such as:

--unsafe-show-network-secrets

The option must default to false. When enabled, the server should print a prominent warning and mark each affected result as containing unredacted network secrets. No tool call or page content should be able to enable this mode.

Please support custom sensitive header names and body-field names for applications that use nonstandard credentials.

Suggested acceptance criteria:

  1. A default installation redacts common authentication headers, cookies, signed URL fields, and secret-like body fields.
  2. Redaction covers text output, structured output, redirects, saved files, logs, and errors.
  3. Non-sensitive request and response data remains useful for debugging.
  4. Only the explicit unsafe server-start option reveals raw secret values.
  5. Tests cover Authorization, Proxy-Authorization, Cookie, Set-Cookie, common API-key headers, sensitive query parameters, and nested body fields.
  6. Release notes describe the compatibility change and migration path.

Describe alternatives you've considered

  • Keep --redact-network-headers as an opt-in. This permits accidental exposure and does not protect URLs or bodies.
  • Filter results in the MCP client. The server has already sent the secret to the client at that point.
  • Disable the network tool category. This removes essential debugging functions.
  • Use an isolated browser profile. Authenticated test sessions can still contain secrets.

Additional context

Source: ChromeDevTools/chrome-devtools-mcp