buzz-acp base_prompt promises auth env vars the agent's own terminal may not have
Describe the bug
crates/buzz-acp/src/base_prompt.md:5 (verified on main @ ac4fa13) tells every agent:
The
buzzCLI is your primary interface. Auth env vars:BUZZ_RELAY_URL,BUZZ_PRIVATE_KEY,BUZZ_AUTH_TAG.
This is true of the MCP server that buzz-acp spawns (build_mcp_servers injects them into the MCP config), but not necessarily of the agent runtime's own built-in terminal tool. Runtimes that scrub credentials from tool subprocesses leave those variables unset — so the agent follows its instructions, runs buzz in its own terminal, and fails with an auth error it can't diagnose.
Steps to reproduce (Hermes runtime)
- Run
buzz-acp --agent-command hermes-acpagainst hermes-agent 0.19.1. - Mention the agent and ask it to run any
buzzcommand. - The agent uses its built-in terminal tool and gets:
{"error":"auth_error","message":"auth error: BUZZ_PRIVATE_KEY is required (use --private-key or set env var)","retryable":false}
Hermes strips BUZZ_* from tool subprocesses and refuses to re-grant them via terminal.env_passthrough (citing GHSA-rhgp-j443-p4rf), so the obvious operator workaround is closed too. The path that actually works is the buzz-dev-mcp shell tool, which does receive the injected env — but nothing in the prompt says so.
Expected behavior
The base prompt tells the agent which tool actually carries Buzz credentials, or states the conditional plainly.
Actual behavior
The agent tries its built-in terminal first, fails on auth, and (in our deployment) reported it could not reach Buzz at all. This cost several deploy cycles to diagnose from the outside, because the agent's self-report was "Buzz is down."
Suggested wording
The
buzzCLI is your primary interface. It is pre-authenticated inside the Buzz MCP shell tool; your runtime's own terminal may not carryBUZZ_PRIVATE_KEY. Ifbuzzreturnsauth_error, re-run the command through the Buzz MCP shell tool rather than exporting credentials yourself.
Adding --mcp-command <path-to-buzz-dev-mcp> to the harness quickstart would also make the working configuration discoverable.
Version and platform
- Buzz version: buzz-acp from
ghcr.io/block/buzz:main@sha256:13ddb4c12f4c0b8147cece717a57013a45fdb1610bd072d7e383ac79a070ddd9; prompt text re-verified onmain@ac4fa13(2026-08-01) - OS: Ubuntu 24.04, systemd unit,
NoNewPrivileges=yes; harness: buzz-acp + hermes-acp (hermes-agent 0.19.1) + buzz-dev-mcp
Logs / additional context
Related issues (searched open and closed — no duplicate found):
- #3768 is adjacent but different: there the managed session is missing the vars entirely; here the vars exist where the harness injected them, and the prompt misdirects the agent to a tool that doesn't have them.
- #2883 (keep
BUZZ_PRIVATE_KEYout of agent-controlled processes) is the security-hardening direction — worth noting that if that lands, this line in the base prompt becomes wrong everywhere, not just under credential-scrubbing runtimes. The prompt fix is compatible with both worlds: point agents at the sanctioned authenticated tool instead of promising raw env vars.
Shipped: https://github.com/block/buzz/pull/4282
One-line fix to base_prompt.md — now names the Buzz MCP shell tool as the auth carrier (instead of only listing env vars), and tells the agent to re-run through the MCP shell tool on auth_error instead of trying to export credentials itself.
Wording is a direct adaptation of your suggested copy with light tightening. Verified by inspecting build_mcp_servers that the env vars do land inside the MCP server config — so the only broken path is the runtime's own built-in terminal.
Validation: cargo check · clippy · all 661 buzz-acp tests passing.
Field report: Ironman nest (Claude Code ACP) — 2026-08-03
Same class of bug as this issue, different runtime.
What we saw
Managed Claude Code agents (via Desktop → claude-agent-acp) had BUZZ_PRIVATE_KEY / BUZZ_RELAY_URL / BUZZ_AUTH_TAG on the ACP process (verified with ps eww on live PIDs), but Bash tool shells often did not. Agents running buzz … got:
auth error: BUZZ_PRIVATE_KEY is required
Goose (goose acp) on the same machine does inherit process env into the developer shell tool, so Goose bees were fine. Claude bees were not. So this is runtime tool-shell inheritance, not “Desktop forgot to inject.”
Desktop injection path (still correct):
desktop/src-tauri/src/managed_agents/runtime.rs— sets the three vars on the ACP childdesktop/src-tauri/src/managed_agents/env_vars.rs— keys are reserved (personaenv_varscannot override)
Secondary footgun
BUZZ_AUTH_TAG is JSON. Agents that scrape process env and re-export with unquoted $var get:
BUZZ_AUTH_TAG is malformed: invalid JSON
Any recovery path must shlex.quote / equivalent.
Nest stopgap (local only — not a platform fix)
On the operator machine we added:
~/.buzz/bin/ensure-buzz-cli-auth— prefer existing env; last-resort ancestor scrape; quoted export- Wired into Claude’s existing
BASH_ENV(agent-safety/bin/bash-env.sh) - Guide + buzz-cli skill note
Verified by a second agent (Claude runtime) under env -i + source helper → AUTH_TAG valid JSON → buzz channels list works.
How this relates to existing work
- #4224 / PR #4282 (prompt: “use Buzz MCP shell on auth_error”) reduces misdiagnosis. Good. It does not make the built-in terminal work.
- #2883 (keep
BUZZ_PRIVATE_KEYout of agent-controlled processes) is the security direction. If that lands, promising raw env in any shell is wrong forever — typed publish tools win. - #3768 is different (vars missing on the managed session entirely).
What we still need from platform
Pick one durable path and document it as the only supported one:
- Preferred long-term (aligns with #2883): typed MCP tools for send/reply/etc., no key in any model-visible shell; base prompt never tells agents to rely on
BUZZ_*in terminals. - Interim for runtimes that keep shell+CLI: guarantee tool shells inherit the reserved harness env or ship a first-class authenticated shell tool and make the prompt/runtime default to it (not “try built-in terminal first”).
Acceptance check we’d love: managed-agent smoke test — fresh tool/Bash call runs buzz channels list (or equivalent typed tool) successfully without the agent scraping ps or writing secrets to disk.
Happy to retest from Ironman Claude + Goose after a change lands.