fix(providers): strip ambient GitHub credentials from lane child envs#1088
Merged
Merged
Conversation
… — agent PRs can't ride the operator's identity A GLM lane run created a PR authored by the operator's personal account by inheriting ambient gh auth. Provider work lands via harvest + the inbox gate (#966), never the lane's own pushes/PRs: the child env now drops GH_TOKEN/GITHUB_TOKEN and points GH_CONFIG_DIR at an empty per-run dir so keychain-backed gh auth can't ride along either. git credential helpers / ssh keys are sandbox-P2 scope. Live-verified: env -u GH_TOKEN -u GITHUB_TOKEN GH_CONFIG_DIR=<empty> gh auth status → 'not logged into any GitHub hosts'. Fixes #1084 Co-Authored-By: Claude <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
What
Fixes #1084 — provider lane children inherited the operator's gh auth; a GLM run created PR #1082 authored by the personal account.
How
providerCredentialGuard(spread into the provider child env) dropsGH_TOKEN/GITHUB_TOKENand pointsGH_CONFIG_DIRat an empty per-run temp dir, so neither env tokens nor keychain/config-backedghauth reach the lane. Provider work lands via harvest + the inbox gate (#966) — lanes have no business pushing or PR-ing as anyone. git's own credential helpers/ssh keys are sandbox-P2 scope (noted in code).Verified
Unit test on the guard shape + live check:
env -u GH_TOKEN -u GITHUB_TOKEN GH_CONFIG_DIR=<empty> gh auth status→ 'You are not logged into any GitHub hosts'. Typecheck + build green.🤖 Generated with Claude Code