Skip to content

fix(acp): redact secret-shaped env values from wire logs and observer feeds#2869

Open
jatinder14 wants to merge 1 commit into
block:mainfrom
jatinder14:fix/acp-redact-secret-shaped-env-logs
Open

fix(acp): redact secret-shaped env values from wire logs and observer feeds#2869
jatinder14 wants to merge 1 commit into
block:mainfrom
jatinder14:fix/acp-redact-secret-shaped-env-logs

Conversation

@jatinder14

Copy link
Copy Markdown

Summary

  • Redact secret-shaped keys (*_API_KEY, *_TOKEN, *_SECRET, camelCase apiKey, ACP {name,value} env pairs, …) before acp::wire debug logs and observer acp_read/acp_write emit.
  • Agent stdin/stdout is unchanged; only logging/observer copies are scrubbed.
  • Adds unit tests covering map env, ACP env arrays, and wire-line redaction.

Fixes #2819

Test plan

  • cargo test -p buzz-acp --lib redact::
  • Spot-check: with RUST_LOG=acp::wire=debug, trigger an agent notification containing MCP env and confirm keys land as [REDACTED] in logs/Raw Event rail

Made with Cursor

… feeds

Agents can rebroadcast MCP configs (including plaintext API keys) in custom
notifications. Scrub secret-shaped keys before acp::wire debug logs and
observer emit so traces/transcripts never persist those values. Agent
stdin/stdout is unchanged.

Closes block#2819

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Jatinder Mahajan <jatinder.mahajan@certifyos.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@jatinder14
jatinder14 force-pushed the fix/acp-redact-secret-shaped-env-logs branch from c8ca7dd to d44334b Compare July 25, 2026 17:57
@maikunari

Copy link
Copy Markdown

Reporter here — thanks for the fast pickup. Reviewed against the actual payload I observed: the array-form env: [{name, value}] handling matches what grok emits in _x.ai/mcp/servers_updated, and the sink coverage (observer + both wire directions + parse-error paths) looks complete for this crate. Two points:

  1. Suggest redacting all values inside mcpServers[].env, unconditionally — the secret-shaped heuristic misses credentials in non-secret-named variables (DATABASE_URL=postgres://user:password@host, AUTH_HEADER, etc.). Env values are agent config, never display data, so there's no cost to blanket redaction within that path; keep the heuristic for generic JSON elsewhere.
  2. The original report also mentioned desktop-side logging — if the managed-agent runtime logs raw notifications anywhere in desktop/src-tauri, that path isn't covered by this PR (fine as a follow-up, just noting scope).

With point 1 addressed I'd consider this a complete fix for the buzz-acp half. 🐝

@jatinder14

Copy link
Copy Markdown
Author

Thanks for the review and for confirming the array-form env: [{name, value}] path against the real _x.ai/mcp/servers_updated payload — that was the exact case this was written for. Appreciate you taking a look @maikunari.

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.

buzz-acp: scrub env values from agent notification logging

3 participants