Skip to content

fix(acp): forward ATLASSIAN_SA_TOKEN into buzz-dev-mcp env - #7445

Open
aptera-motors-it wants to merge 1 commit into
block:mainfrom
aptera-motors-it:fix/it-139-forward-atlassian-sa-token
Open

fix(acp): forward ATLASSIAN_SA_TOKEN into buzz-dev-mcp env#7445
aptera-motors-it wants to merge 1 commit into
block:mainfrom
aptera-motors-it:fix/it-139-forward-atlassian-sa-token

Conversation

@aptera-motors-it

Copy link
Copy Markdown

Problem

Managed agents get ATLASSIAN_SA_TOKEN in the Desktop definition. Desktop writes descriptor.env into the buzz-acp child, but build_mcp_servers only forwarded BUZZ_RELAY_URL, BUZZ_PRIVATE_KEY, optional BUZZ_AUTH_TAG, and BUZZ_ACP_DISPLAY_NAME. buzz-agent then env_clear()s and restores spec.env, so buzz-dev-mcp shell tools never see the token. A Desktop restart cannot fix this hop.

Diagnosed on IT-139 comment 59775. Closest open PR: #4798 (general BUZZ_ACP_FORWARD_ENV forwarding). That PR still refuses API tokens by design, so it would not close this gap. This change is the narrow BUZZ_AUTH_TAG-shaped allowlist hop, not a parent-env copy.

Fix

If ATLASSIAN_SA_TOKEN is present and nonempty in the buzz-acp process, add it to the trusted MCP server EnvVar list. Unset/empty omits the key. Unlisted parent secrets are not forwarded.

Tests

Four build_mcp_servers cases bind the production function: set, unset, empty, and an unlisted parent secret that must not leak. Tests restore the previous process value so a real token in the runner is not dropped.

cargo test -p buzz-acp at 1f0da474 (parent ee883d73): 909 lib + 9 pool_lifecycle_state passed. Two clap default tests fail in this managed-agent process unless BUZZ_ACP_LAZY_POOL and BUZZ_ACP_IDLE_POOL_SLEEP are unset; those vars are Desktop launch policy, not this diff. Re-ran the package with those two unset.

No deployment or live harness change in this PR. Independent review requested before rebuild/restart.

Desktop injects the managed-agent token into buzz-acp via descriptor.env,
but build_mcp_servers only forwarded BUZZ_RELAY_URL, BUZZ_PRIVATE_KEY,
BUZZ_AUTH_TAG, and BUZZ_ACP_DISPLAY_NAME. buzz-agent then env_clear()s and
restores spec.env, so shell tools never saw ATLASSIAN_SA_TOKEN.

Forward the token the same way as BUZZ_AUTH_TAG: present-and-nonempty only.
Do not copy the parent environment.

IT-139

Signed-off-by: Aptera Motors IT <80414522+aptera-motors-it@users.noreply.github.com>
@aptera-motors-it
aptera-motors-it requested a review from a team as a code owner September 7, 2026 06:36
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 3c7f288c60d67df78577b237e27c3dfc8831aaa1...1f0da4745d2138fa7d2788fa6d9ddaff3b21e1a8.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 1f0da4745d2138fa7d2788fa6d9ddaff3b21e1a8 to authorize a new review.
Any previous review applies only to its recorded range.

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.

1 participant