fix(acp): redact secret-shaped env values from wire logs and observer feeds - #2869
fix(acp): redact secret-shaped env values from wire logs and observer feeds#2869jatinder14 wants to merge 2 commits into
Conversation
… 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>
c8ca7dd to
d44334b
Compare
|
Reporter here — thanks for the fast pickup. Reviewed against the actual payload I observed: the array-form
With point 1 addressed I'd consider this a complete fix for the buzz-acp half. 🐝 |
|
Thanks for checking this against the real _x.ai/mcp/servers_updated payload, @maikunari. Glad the array-form env: [{name, value}] path matches what you saw. Appreciate the review. |
MCP server environment values are agent configuration, so redact them regardless of their variable names while retaining heuristic redaction for generic JSON. Signed-off-by: Jatinder Mahajan <jatinder.mahajan@certifyos.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks @maikunari. Updated in ad50de0. mcpServers[].env values are now always redacted for both object maps and {name, value} arrays, including names like DATABASE_URL. Elsewhere we still only redact secret-shaped keys. Added a test for the blanket MCP env case, and confirmed generic env values outside that path are unchanged. Agreed on desktop-side logging. That managed-agent path sits outside buzz-acp, so I will leave it as a follow-up. |
ad50de0 to
c2e0f1e
Compare
|
Independent review (Bartok9) — 2026-07-30 VerdictSolid defensive fix for #2819. Prefer landing this over a parallel stack. What I checked
Non-blockers
Recommend merge. Thanks @jatinder14 — this is the right layer for the defensive half of #2819. |
|
Thanks @Bartok9 for the thorough independent review. Glad the wire/observer boundary and the blanket mcpServers env redaction look right. I'll rebase onto latest main for hygiene. Agreed that sharing a helper with desktop's split_config_key can be a follow-up if those paths start to drift. |
Summary
*_API_KEY,*_TOKEN,*_SECRET, camelCaseapiKey, ACP{name,value}env pairs, …) beforeacp::wiredebug logs and observeracp_read/acp_writeemit.Fixes #2819
Test plan
cargo test -p buzz-acp --lib redact::RUST_LOG=acp::wire=debug, trigger an agent notification containing MCP env and confirm keys land as[REDACTED]in logs/Raw Event rail