Make network-secret redaction the default and require an explicit unsafe reveal flag
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-Cookievalues - URL user information, sensitive query parameters, and fragments
- JSON, form, and multipart fields with common secret names
- Redirect-chain details
- Saved
.network-requestand.network-responsebody 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:
- A default installation redacts common authentication headers, cookies, signed URL fields, and secret-like body fields.
- Redaction covers text output, structured output, redirects, saved files, logs, and errors.
- Non-sensitive request and response data remains useful for debugging.
- Only the explicit unsafe server-start option reveals raw secret values.
- Tests cover
Authorization,Proxy-Authorization,Cookie,Set-Cookie, common API-key headers, sensitive query parameters, and nested body fields. - Release notes describe the compatibility change and migration path.
Describe alternatives you've considered
- Keep
--redact-network-headersas 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
- The current configuration documents
--redact-network-headerswith a default offalse: https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/configuration.md#L340-L342 - The formatter applies sanitization only to request and response headers: https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/formatters/NetworkFormatter.ts
- The network tool explicitly supports inspection of
CookieandSet-Cookie: https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/tool-reference.md#L503-L523 - PR #973 documented the exposure risk. A maintainer requested a feature request: https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/973
- PR #1848 added optional header redaction: https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/1848
- Issue #2261 requested broader approval controls, but it did not request default redaction: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2261
- Issue #2316 proposed default sensitive-header redaction for a separate snippet feature: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2316
Source: ChromeDevTools/chrome-devtools-mcp