buzz-acp: redact MCP env secrets from wire logs and observer feed - #3417
Open
Maxwellimus wants to merge 1 commit into
Open
buzz-acp: redact MCP env secrets from wire logs and observer feed#3417Maxwellimus wants to merge 1 commit into
Maxwellimus wants to merge 1 commit into
Conversation
The ACP harness injects the agent's Nostr secret key as BUZZ_PRIVATE_KEY (an MCP-server env var in the session/new config). That wire message, and any message echoing it back, was serialized verbatim into the acp::wire debug log and the in-process observer feed, exposing the key in cleartext in both sinks. Mask MCP-server env values in the logged/observed copies only; the message delivered to the agent over stdin is unchanged (the agent needs the real key to authenticate). redact_wire masks env[].value recursively, covering the outbound config and any inbound echo, and borrows when there is no env to mask. Parse-error events publish only the failed line's length, since an unparseable line can't be structurally redacted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Max Lampert <maxwell@squareup.com>
Maxwellimus
force-pushed
the
maxwell/acp-redact-wire-secrets
branch
from
July 28, 2026 22:37
6a3b607 to
1aa9540
Compare
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The ACP harness injects the agent's Nostr secret key as
BUZZ_PRIVATE_KEY— an MCP-serverenvvar in thesession/newconfig. That wire message (and any message echoing it back) was serialized verbatim into theacp::wiredebug log and published to the in-process observer feed, so the secret appeared in cleartext in both sinks.This masks MCP-server
envvalues in the logged/observed copies only. The message delivered to the agent over stdin is unchanged — the agent needs the real key to authenticate.Scope
The observer feed is owner-scoped and the
acp::wiredebug log is off by default, so this is secret-hygiene / defense-in-depth rather than a broadly reachable leak. Secrets still shouldn't land in logs or an observability stream, and an agent echoing its config back would surface the key wherever those sinks are read.Change
redact_wirereturns a copy with everyenv[].valuemasked (<redacted>), recursively — covering both the outboundparams.mcpServersand any inbound echo. Names and all other fields are preserved. Borrows (no clone) when there's no env to mask.session/prompt,session/new, notifications, andsession/steer; and inbound reads in both read loops.write_ndjsonstill delivers the unredacted message to the agent.Tests
session/newpath with a fake agent that echoes the request back. Asserts the agent receives the real key, the secret appears in no observer event, and both the outbound write and the inbound echo are masked.redact_wiremasks values while preserving shape (built from the realMcpServer/EnvVarstructs so a serde rename can't silently disable it) and is a no-op for messages without MCP servers.just cigreen.🤖 Generated with Claude Code