Skip to content

Redact sensitive MCP data at logging and audit boundaries - #50775

Merged
pelikhan merged 6 commits into
mainfrom
copilot/redact-mcp-configuration
Aug 6, 2026
Merged

Redact sensitive MCP data at logging and audit boundaries#50775
pelikhan merged 6 commits into
mainfrom
copilot/redact-mcp-configuration

Conversation

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

MCP runtime logging exposed configuration secrets, tool payloads, and API error details. Audit records also persisted raw arguments and responses with permissive file permissions.

  • Redaction

    • Recognize tokens, API keys, authorization, headers, passwords, cookies, private keys, secrets, and credentials.
    • Recursively redact nested objects and arrays with case-insensitive key matching.
  • Runtime logging

    • Replace converted configuration and tool payloads with server names, counts, byte sizes, status, and timing.
    • Omit GraphQL request and response payloads from error logs.
  • Audit storage

    • Allowlist diagnostic metadata; exclude arguments, responses, URLs, paths, and raw errors.
    • Use 0700 directories and 0600 JSONL files.
    • Remove audit records older than 24 hours.
    • Sanitize server names used in audit filenames.

Copilot AI and others added 3 commits August 6, 2026 05:40
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Redact MCP configuration and tool calls at logging boundary Redact sensitive MCP data at logging and audit boundaries Aug 6, 2026
Copilot AI requested a review from pelikhan August 6, 2026 05:45
@pelikhan
pelikhan marked this pull request as ready for review August 6, 2026 05:47
Copilot AI balanced review requested due to automatic review settings August 6, 2026 05:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reduces sensitive-data exposure across MCP runtime logs, GraphQL errors, and audit storage.

Changes:

  • Adds recursive sensitive-key redaction.
  • Replaces payload logging with diagnostic metadata.
  • Hardens audit permissions, retention, and filenames.
Show a summary per file
File Description
safe_outputs_config_redact.cjs Expands secret-key detection.
safe_outputs_config_redact.test.cjs Tests recursive redaction.
mcp_cli_bridge.cjs Hardens runtime and audit logging.
mcp_cli_bridge.test.cjs Tests metadata, permissions, and retention.
github_api_helpers.cjs Omits GraphQL request/response data.
github_api_helpers.test.cjs Tests GraphQL payload omission.
convert_gateway_config_shared.cjs Stops logging converted configurations.
convert_gateway_config_shared.test.cjs Verifies configuration secrets are not logged.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Balanced

if (error.request) core.info(`Request: ${JSON.stringify(error.request, null, 2)}`);
if (error.data) core.info(`Response data: ${JSON.stringify(error.data, null, 2)}`);
if (error.request) core.info("Request details omitted");
if (error.data) core.info("Response data omitted");
statusCode: resp.statusCode,
elapsedMs,
response: resp.body,
responseBytes: serializedSize(resp.body),
@pelikhan
pelikhan merged commit 4151d37 into main Aug 6, 2026
9 checks passed
@pelikhan
pelikhan deleted the copilot/redact-mcp-configuration branch August 6, 2026 06:42
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.86.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redact MCP configuration, tool calls, and audit records at the logging boundary

3 participants