← Back to Pull requests

ci: sync the Antigravity reviewer with the hardened template #338

Open
unknown opened this pull request with 472 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 22, 2026 19:16 UTC
Author

Re-syncs the vendored Antigravity PR reviewer with the hardened antigravity-pr-review template (1451f73).

Why

The reviewer runs agy with --dangerously-skip-permissions on an untrusted diff. The old copy ran it from the checkout, so a prompt injection could plant .git/hooks or .git/config that a later token-bearing git call would execute. It also passed agy every job environment variable except GH_TOKEN and GITHUB_TOKEN.

Changes

  • agy runs in a bubblewrap jail. It gets an empty private HOME (no MCP servers, skills, hooks or other repositories), read-only /usr and /etc, and a D-Bus proxy that exposes only its own keyring item. Verified: in the jail agy cannot read ~/.config/gh or any repository, has no MCP tools, and the gh token's keyring item and the bulk GetSecrets call are AccessDenied.

  • Output scan: agy's output is scanned for credential shapes before posting (fail closed).

  • agy runs from a private sandbox under $RUNNER_TEMP with an allowlisted environment, and post-agy git ignores hooks. Verified live on doublegate/Orbic-Rayhunter#1: /proc showed the sandbox as cwd and the only --add-dir, and planted ACTIONS_RUNTIME_TOKEN and DATABASE_URL canaries were absent from agy's environment.

  • The base print timeout is now 10m, backported from repos that pinned 10-15m. The workflow skips with a warning, instead of failing, when the default branch has no reviewer.

  • Every other template fix since this copy was taken.
  • Checks run

  • bash scripts/agy-review-selftest.sh: all checks passed

  • actionlint on the workflow

  • Scripts are byte-identical to the template
  • Note: this PR's own review runs the scripts already on the default branch; the new copy takes effect after merge.

    🤖 Generated with Claude Code

    <!-- CURSOR_SUMMARY -->
    ---

    [!NOTE]

    Medium Risk

    Changes how agy is executed and what it can access on the maintainer’s self-hosted host; misconfiguration (missing bwrap/D-Bus) fails closed, but timing and isolation behavior affect all PR reviews until merged on the default branch.

    > Overview

    Re-syncs the vendored Antigravity PR reviewer with the hardened upstream template, centered on isolating untrusted agy runs on a self-hosted runner.

    > Security: agy now runs under bubblewrap by default (empty private HOME, read-only system paths, D-Bus proxy limited to its own keyring item), from a temp sandbox outside the checkout with only that dir in --add-dir, on an env -i allowlist (no GITHUB_TOKEN, Actions tokens, or workflow secrets). Output is scanned for credential-shaped text before posting; post-agy git calls disable hooks. Large diffs no longer touch the working tree (no .agy-review-work/ / .gitignore requirement).

    > Reliability & UX: Default print timeout 5m → 10m; workflow AGY_LOCK_WAIT 1860s and job timeout 80m so queued cross-repo reviews don’t fail the lock; workflow warns and skips if agy-review.sh isn’t on the default branch. Archive comments keep a cumulative “earlier rounds dropped” count; empty archive blocks omit a blank <details>.

    > Robustness: Broader numeric env normalization, script(1) capture stripping (including localized records), iconv exit-status handling for UTF-8 scrub, earlier EXIT trap / full mktemp cleanup, and a much larger selftest (jail shape, env allowlist, credential scan, lock budget).

    > <sup>Reviewed by Cursor Bugbot for commit 49a0ef0f9b64f8c832694273b88346049e57edfb. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

    <!-- /CURSOR_SUMMARY -->

    Diff: 472 lines (+354 / -118) across 5 files Reviewer: cursor[bot] Review duration: 24m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.46) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 472 lines diff across 5 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.368
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #338"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.7% (MEDIUM) · Higher = larger blast radius
    45.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.4% · Safe to merge
    24.4%