ci: gate auto-approve behind SHADOW_AUTO_APPROVE (off by default)#285
Merged
Conversation
sudsali
force-pushed
the
ci/gate-auto-approve
branch
from
July 21, 2026 15:44
12456ff to
c5b0fc5
Compare
Auto-approval now runs only where a maintainer has explicitly set the repo/org variable SHADOW_AUTO_APPROVE=true. Default is off, so the bot is comment-only unless deliberately enabled. Rationale: a bot APPROVE review can satisfy branch protection's required approving review. Making auto-approval opt-in keeps a human approval on the critical path by default, addressing the AppSec review finding that the bot could otherwise rubber-stamp a PR whose findings were suppressed via prompt injection. The event guard (pull_request / pull_request_target) is unchanged.
sudsali
force-pushed
the
ci/gate-auto-approve
branch
from
July 21, 2026 15:46
c5b0fc5 to
9193e5a
Compare
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
Gates the auto-approve workflow behind a new repo/org variable SHADOW_AUTO_APPROVE, defaulting to off. Auto-approval now runs only where a maintainer has explicitly set SHADOW_AUTO_APPROVE=true.
Why
An AppSec review of the Shadow bot flagged that the bot's APPROVE review can satisfy branch protection's required approving review (all repos require 1, bot not excluded). That means a PR whose findings were suppressed — e.g. via prompt injection in the diff — could be auto-approved and satisfy the human-review gate.
Making auto-approval opt-in (off by default) keeps a human approval on the critical path unless a maintainer deliberately enables it. The bot is comment-only in the default configuration.
Change
One line: the
approvejobif:now additionally requiresvars.SHADOW_AUTO_APPROVE == 'true'. The existing event guard (pull_request / pull_request_target) is preserved. No engine change.Note
Touches
.github/, so per the auto-approve Condition-0 guard this PR itself requires human approval + merge.