feat(delegate): parallel non-blocking security-scanner reviewer - #46
Open
selta-goodparty wants to merge 2 commits into
Open
feat(delegate): parallel non-blocking security-scanner reviewer#46selta-goodparty wants to merge 2 commits into
selta-goodparty wants to merge 2 commits into
Conversation
A second, independent reviewer that runs in parallel with pr-reviewer on PR open (and on a 'delegate security review' comment), does an adversarial diff-scoped security review, and posts a non-blocking comment-only review under its own 'security-review' status context. It never approves/requests-changes and its status is always success, so it cannot gate merge — pr-reviewer's approval governs mergeability. Design: a separate dispatch() per PR = its own Fargate task (parallelism), and its own GitHub App identity (distinct login) so pr-reviewer's login-scoped review/thread reconciliation never sees it — pr-reviewer is byte-for-byte unchanged. Analysis ported from the /security-scan skill (source→sink taint + adversarial disprove-it verifier) with first-class LLM/prompt-injection and IaC lenses, MITRE ATT&CK mapping, and multi-step chain analysis. Medium+ inline with suggestion fixes, Low/info collapsed. Inert until provisioned: dispatch is gated on the SECURITY_APP_PRIVATE_KEY secret, so this is safe to merge before the Delegate Security App exists. Net-new: agents/security-scanner.ts + an index import + a SECURITY_REVIEW_REPOS set/dispatch branch in lambdas/github.ts + setupSecurityGitHubAuth + a worker token swap. README documents enablement.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit cc93dcc. Configure here.
- Security pass now dispatches on PR open independently of REVIEW_REPOS (shouldDispatchSecurity gates on SECURITY_REVIEW_REPOS alone), so a security-only repo gets the auto pass — matching the documented onboarding. - Re-trigger (delegate security review) path: agent step 1 now resolves HEAD_SHA via gh api when <headSha> is absent, so re-review statuses target the real SHA instead of empty. - Dispatch gate now requires all three security config values (key + app id + installation id) so a partial provision stays fully inert instead of dispatching tasks the worker aborts.
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
Adds
security-scanner— a second, independent Delegate reviewer that runs in parallel withpr-reviewerand never touches it. On a PRopened/ready_for_review(and on adelegate security reviewcomment) it does an adversarial, diff-scoped security review and posts a non-blocking, comment-only review under its ownsecurity-reviewstatus context.pr-revieweris byte-for-byte unchanged.Why it can't interfere with the main review
dispatch()per PR, parallel, no shared state.pr-reviewerreconciles only reviews/threads authored by its own bot login and dedups its status oncontext == "pr-reviewer"; a different login + thesecurity-reviewcontext means it never sees this pass.event=COMMENT(never APPROVE / REQUEST_CHANGES), and its commit status is alwayssuccess(informational, not a required check). The main bot's approval still governs mergeability, even if security suggestions are applied.The analysis
Ported from the
/security-scanskill — source→sink taint taxonomy + an adversarial disprove-it verifier — and hardened for this product:finder/verifiersubagents. Medium+ post inline withsuggestionfixes; Low/info roll into a collapsed summary.Inert until provisioned (safe to merge now)
Dispatch is gated on the
SECURITY_APP_PRIVATE_KEYsecret, so nothing fires until the dedicated Delegate Security App exists. To enable (seedelegate/README.md):SECURITY_APP_ID,SECURITY_INSTALLATION_ID,SECURITY_APP_PRIVATE_KEY.omni(already inSECURITY_REVIEW_REPOS). Onboarding another repo = install the App + add the name.Net-new surface
agents/security-scanner.ts(new) · anagents/index.tsimport · aSECURITY_REVIEW_REPOSset + dispatch branch +delegate security reviewtrigger inlambdas/github.ts·setupSecurityGitHubAuthinworker/github-auth.ts· a token swap inworker/entrypoint.ts· README docs.tsc --noEmitclean; all 31 framework/lambda tests pass.Note
Medium Risk
Touches GitHub webhook dispatch and worker token routing for a new bot identity; misconfiguration could skip scans or post under the wrong App, but
pr-revieweris unchanged and dispatch is secret-gated until provisioned.Overview
Adds
security-scanner, a second Delegate agent that runs in parallel withpr-revieweron PRopened/ready_for_reviewand ondelegate security reviewcomments. It performs a diff-scoped adversarial security review (taxonomy finders + disprove-it verifiers, CWE/MITRE mapping, LLM/IaC lenses) and posts comment-only reviews with asecurity-reviewstatus that is alwayssuccess—it does not approve, request changes, or gate merge.GitHub webhook (
delegate/lambdas/github.ts):SECURITY_REVIEW_REPOS(seeded withomni), paralleldispatchSecurityScanafter normal PR review dispatch, and a separate re-review path gated onSECURITY_APP_PRIVATE_KEYso the feature stays inert until provisioned.Worker identity (
github-auth.ts,entrypoint.ts): a third GitHub App mintsSECURITY_GITHUB_TOKEN;security-scannerjobs exit if that token is missing so reviews never post under the delegate/reviewer identity (avoiding cross-reconciliation withpr-reviewer).Docs:
delegate/README.mddocuments onboarding the Delegate Security App and repo allowlisting.Reviewed by Cursor Bugbot for commit cc93dcc. Configure here.