Skip to content

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

Merged
doublegate merged 14 commits into
mainfrom
ci/agy-reviewer-sync
Nov 23, 2026
Merged

doublegate merged 14 commits into
mainfrom
ci/agy-reviewer-sync

Conversation

@doublegate

@doublegate doublegate commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

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 ci: run only the jobs a change needs, and cache aggressively 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


Note

High Risk
The diff rewires how untrusted PR content reaches a privileged self-hosted runner (jail, egress proxy, env allowlist, and secret redaction); any mistake could break reviews or weaken isolation.

Overview
Replaces the vendored Antigravity PR reviewer with the hardened antigravity-pr-review template so agy is no longer run against the checkout with a broad environment.

agy execution now defaults to a bubblewrap jail (AGY_ISOLATION=bwrap): empty private HOME, read-only system dirs, D-Bus limited to agy's keyring item via xdg-dbus-proxy, and optional filtered egress (CONNECT proxy with TLS termination, exact host allowlist, path rules, private denied-host log). Large diffs live in a $RUNNER_TEMP sandbox only (--add-dir never points at the repo); agy gets an env -i allowlist instead of stripping two token names. Credential-shaped output is redacted (or posting fails); job stderr tails can be withheld when they match.

Workflow/docs: job timeout 80m, AGY_LOCK_WAIT 1860, base print timeout 10m; new step warns and skips when scripts/agy-review.sh is missing on the default branch. AGY-REVIEWER.md documents the jail, egress, and sandbox model (no more requiring /.agy-review-work/ in .gitignore).

Reviewer UX: archive dropped-round counts are cumulative across edits; empty archive <details> is not emitted. agy-review-selftest.sh grows large coverage for jail shape, egress proxy behavior, redaction, cleanup/mktemp ordering, script(1) framing strip, and lock-vs-timeout budgets. Minor Cargo.lock URL crate bumps.

Reviewed by Cursor Bugbot for commit 5eb2dce. Bugbot is set up for automated code reviews on this repo. Configure here.

Re-sync scripts/agy-review.sh, _agy_print.sh, _agy_comment_body.sh and
agy-review-selftest.sh byte for byte from the antigravity-pr-review
template at 1451f73, refresh .github/AGY-REVIEWER.md where present,
and rebuild the workflow from the template.

Security (template d77b07c .. 1451f73):
- agy runs in a bubblewrap jail (AGY_ISOLATION=bwrap, default): an
  empty private HOME (no MCP servers, skills, hooks, dotfiles or other
  repositories), read-only /usr and /etc, only the review sandbox
  writable, and a D-Bus that is an xdg-dbus-proxy allowing only agy's
  own Secret Service item. agy's own --sandbox was verified NOT to
  confine reads, and agy otherwise loads the host's MCP servers
  (REA, Blender) where a prompt-injected diff could drive them.
- agy's output is scanned for credential shapes before posting; on a
  match nothing is posted (fail closed). Patterns are anchored so
  ordinary identifiers never match.
- agy now runs from a private mktemp sandbox under RUNNER_TEMP, never
  from the checkout; the large-diff handoff file lives there and only
  the sandbox is passed to --add-dir. agy runs with
  --dangerously-skip-permissions on an untrusted diff, so a prompt
  injection could previously write .git/hooks or .git/config that a
  later token-bearing git call would execute.
- agy gets an allowlisted environment (env -i plus the session
  variables its keyring-held Google login needs). No job token
  (GH_TOKEN, ACTIONS_RUNTIME_TOKEN, OIDC) or workflow env value reaches
  it, whatever its name.
- Post-agy git calls ignore hooks and fsmonitor.
- The workflow skips with a visible warning instead of failing red when
  the default branch has no reviewer.
- AGY_ENV_PASSTHROUGH accepts only valid identifiers and never
  glob-expands; the sandbox path is canonical; an inline dry run no
  longer leaks it (template 2262811, from the reviews of the first
  re-sync PRs).

Also carried: the base print timeout is 10m (was 5m; backported from
three repositories that pinned 10-15m after timeouts), the cumulative
dropped-round count and en-US spelling (template c9ded19, f492f3e), and
every template fix since this copy was taken.

The first-install bootstrap steps are omitted (the reviewer is already
on the default branch; they trip CodeQL actions/untrusted-checkout),
unless this repository vendors the workflow byte for byte.

Verification: scripts/agy-review-selftest.sh "all checks passed"
(including the new sandbox, allowlist and hook checks and the
workflow timeout/lock budget); actionlint clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@doublegate

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T20:49:13.138221Z aae5617 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49a0ef0f9b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/agy-review.sh Resolved

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread scripts/agy-review.sh Resolved
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Antigravity review (Gemini via Ultra)

Syncs the Antigravity PR reviewer workflow, scripts, self-tests, and documentation with the hardened template (adding a bubblewrap + xdg-dbus-proxy jail, a TLS-intercepting HTTP/1.1 egress proxy, allowlisted environment isolation, and credential redaction), alongside two unrelated Cargo.lock updates.

Blocking issues

None found.

Suggestions

  • Cargo.lock:506-527 and fuzz/Cargo.lock:934-955: This PR includes lockfile bumps for form_urlencoded (1.2.2 -> 1.2.3) and url (2.5.8 -> 2.5.9) that are unrelated to syncing the Antigravity CI reviewer template. Per the project convention of one logical change per commit/PR, revert these lockfile changes here and land dependency updates separately.
  • scripts/agy-review.sh:1415-1476 (credential_kind_present, credential_kinds_present, agy_redact_credentials): Unlike agy_record_denied (line 1376), the grep -qE, sed -E, and awk calls in the credential scanner and redactor run under the ambient locale rather than LC_ALL=C. Because every credential regex is strictly ASCII ([A-Za-z0-9_-], [0-9A-Z], [A-Z ]*) and these functions scan raw stderr ($LOG) and un-truncated captures ($out_file) that have not passed through agy_scrub_utf8, a single invalid UTF-8 byte on the same line (or locale-dependent [A-Z] range collation) can cause GNU sed/awk/grep to miss a match or abort. Run those pipelines under LC_ALL=C.
  • scripts/agy-review.sh:2508-2517: --bind "$agy_jail_home" "$HOME" is mounted before --ro-bind "$(readlink -f "$AGY_BIN")" "$AGY_BIN", --ro-bind "$here/_agy_print.sh" "$here/_agy_print.sh", and --bind "$agy_sandbox" "$agy_sandbox". When the self-hosted runner is installed under $HOME/actions-runner/... (as documented in .github/AGY-REVIEWER.md:103-110), $here and $agy_sandbox ($RUNNER_TEMP) reside under $HOME, so bwrap creates the host directory skeleton (~/actions-runner/<runner>/_work/<repo>/<repo>/scripts/...) inside $agy_jail_home, leaking the host path layout into the jail's $HOME. Mounting _agy_print.sh, $prompt_file, and $agy_sandbox at fixed paths under /run (or /tmp) inside the jail keeps $HOME genuinely empty.
  • scripts/agy-review.sh:2413-2417: gdbus call ... SearchItems ... 2>/dev/null discards stderr, so a broken DBUS_SESSION_BUS_ADDRESS or unresponsive Secret Service daemon logs the same "no keyring item matches AGY_KEYRING_ATTRS ... is agy logged in on this host?" message as an absent keyring entry. Capturing and logging gdbus stderr on failure (as agy_has_write_access does for gh api) would make session-bus failures diagnosable.

Nitpicks

  • scripts/agy-review.sh:2286-2300 (egress.py): parts[1] is decoded as latin-1 and filtered with c.isprintable(), which admits non-ASCII Latin-1 code points (0xA0..0xFF) that are then written as multi-byte UTF-8 to deniedf before cut -c1-253 in agy_record_denied. Using c.isascii() and c.isprintable() keeps denied host:port log records strictly ASCII.
  • scripts/agy-review.sh:2514: --ro-bind "$prompt_file" "$prompt_file" is mounted unconditionally even when unbuffer is used (line 2544), where "$(cat "$prompt_file")" is expanded on the host and the jailed process never reads $prompt_file.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

Earlier review rounds (newest first)
Round reviewed at 2026-11-23 03:51 UTC

Antigravity review (Gemini via Ultra)

Syncs the Antigravity PR reviewer workflow, scripts, self-tests, and documentation with the hardened template (adding bubblewrap filesystem/D-Bus isolation, a TLS-intercepting HTTP/1.1 egress proxy, credential redaction, and cumulative dropped-round tracking) while also updating Cargo.lock and fuzz/Cargo.lock.

Blocking issues

None found.

Suggestions

  • Cargo.lock (lines 1469-1474, 4990-4995) and fuzz/Cargo.lock (lines 941-946, 3166-3171): These form_urlencoded (1.2.2 -> 1.2.3) and url (2.5.8 -> 2.5.9) lockfile bumps are unrelated to the CI reviewer sync and violate the single-logical-change convention; split them into a separate chore(deps) commit/PR or revert them here.
  • scripts/agy-review.sh (lines 1345, 1364-1379): In the embedded egress proxy, clean_head rejects all bytes < 0x20, which includes horizontal tab (0x09). That rejects RFC 9110 §5.5 optional whitespace (HTAB) in header values and makes the \t stripping in rebuild_request (line[0] in " \t", value.strip(" \t"), t.strip(" \t")) unreachable. Either allow 0x09 in clean_head or remove the dead \t handling in rebuild_request.
  • scripts/agy-review.sh (lines 276-281, 1695-1701): bwrap only mounts /usr, /etc, and /bin//sbin//lib*, plus a single-file --ro-bind "$(readlink -f "$AGY_BIN")" "$AGY_BIN". If AGY_BIN resolves to a wrapper script or multi-file installation under $HOME/.local (the fallback at line 276) or /opt, sibling libraries/assets in its installation directory will be missing inside the jail.
  • scripts/agy-review.sh (line 1685): The in-jail socat readiness loop waits the full 100 iterations (10 seconds) even if socat exits immediately on startup; capture socat's PID and check kill -0 on each iteration as done for xdg-dbus-proxy (line 1618) and egress.py (line 1675).

Nitpicks

  • scripts/agy-review.sh (lines 1456-1461): asyncio.start_unix_server creates sock_path under the current process umask before os.chmod(sock_path, 0o600) runs; setting os.umask(0o177) before start_unix_server avoids even a transient wider mode if sock_path is ever placed outside a 0700 parent directory.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

Round reviewed at 2026-11-23 02:50 UTC

Antigravity review (Gemini via Ultra)

This PR syncs the Antigravity PR reviewer workflow, scripts, selftest, and documentation with the hardened template (adding bubblewrap filesystem/D-Bus isolation, an HTTPS MITM egress-filtering proxy, credential redaction, an isolated working directory outside the checkout, and cumulative dropped-round tracking), along with minor dependency bumps in Cargo.lock and fuzz/Cargo.lock.

Blocking issues

  • Archived review rounds bypass the final $body_file credential scan/redaction guard (scripts/agy-review.sh lines 1944–1954 vs. lines 2013–2047 in the post-diff file): The "last-resort" credential check on $body_file explicitly states that it exists to scan and redact the assembled comment body—including archived rounds from earlier templates—before any edit-in-place or new-comment post path. However, it runs right after writing the new round's header/body to $body_file, roughly 65 lines before prior_body_file is parsed and archived_file is appended via } >> "$body_file" (line 2047) and PATCHed to GitHub. As a result, archived rounds are never scanned or redacted. Move the $body_file credential check below the archive-assembly block (immediately before the final oauth_url_present "$body_file" guard at line 2051), and replace the static grep -c selftest check in scripts/agy-review-selftest.sh (line 1157) with a behavioral test that puts a sample token in prior_body_file.

Suggestions

  • Multiple path rules for the same host silently overwrite one another (scripts/agy-review.sh lines 2037–2041 and 2164–2167 in the post-diff file): In agy_egress_proxy_src, path_rules[rule_host] = rule_path stores a single path string per host. If AGY_EGRESS_PATH_RULES lists two allowed paths for the same host, only the last one takes effect and the earlier one is denied with 403. Store a set of allowed paths per host (path_rules.setdefault(rule_host, set()).add(rule_path) and check target not in path_rules[host]), or reject duplicate hosts when validating AGY_EGRESS_PATH_RULES at lines 1656–1663.
  • Bind mounts recreate the host checkout path hierarchy inside the jailed $HOME (scripts/agy-review.sh lines 1030, 1638, and 1712–1718 in the post-diff file): On a runner installed under ~/actions-runner/... (as documented in .github/AGY-REVIEWER.md lines 103–110), both $here and $RUNNER_TEMP reside under $HOME. Running --tmpfs /home --bind "$agy_jail_home" "$HOME" followed by --ro-bind "$here/_agy_print.sh" "$here/_agy_print.sh" and --bind "$agy_sandbox" "$agy_sandbox" causes bwrap to create the host checkout directory skeleton and mount $agy_sandbox inside $agy_jail_home (the jailed $HOME). Mounting the sandbox and helper at fixed paths outside /home inside the jail (or creating agy_sandbox and agy_jail_home under /tmp rather than $RUNNER_TEMP when $RUNNER_TEMP is under $HOME) keeps the jailed $HOME empty.
  • Unrelated Cargo.lock changes bundled into a CI PR (Cargo.lock lines 508–511, 520–523 in diff; fuzz/Cargo.lock lines 536–539, 548–551 in diff): The form_urlencoded (1.2.2 → 1.2.3) and url (2.5.8 → 2.5.9) lockfile updates are unrelated to the Antigravity reviewer sync and should be split into their own chore(deps) commit/PR per the one-logical-change-per-commit convention.

Nitpicks

  • scripts/agy-review.sh (line 1597 in post-diff file): here="$(cd "$(dirname "$0")" && pwd)" uses logical pwd without -P, even though the comment immediately above it states it exists to canonicalize a symlinked checkout path and agy_sandbox / agy_jail_home (lines 1036, 1640) use pwd -P.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

Round reviewed at 2026-11-23 01:10 UTC

Antigravity review (Gemini via Ultra)

This PR synchronizes the Antigravity PR reviewer workflow, scripts, and self-test suite with the hardened template, adding bubblewrap filesystem/D-Bus isolation, a local TLS-terminating HTTP/1.1 egress proxy, an allowlisted execution environment, and credential-pattern redaction.

Blocking issues

None found.

Suggestions

  • scripts/agy-review.sh (lines 197-203): In agy_redact_credentials, the awk state machine for private-key-block runs inblk { if ($0 ~ e) inblk = 0; next }. If a multi-line private key's -----END ... PRIVATE KEY----- line also contains a subsequent -----BEGIN ... PRIVATE KEY----- on the same line, next skips the $0 ~ b check after clearing inblk. That swallows the second key's BEGIN marker, prints the second key's body lines in plaintext, and causes the post-redaction credential_kind_present check (which only looks for BEGIN) to pass. Strip through e on the closing line (sub("^.*" e, "")) and fall through to the $0 ~ b check instead of unconditionally calling next.
  • scripts/agy-review.sh (line 170): The openai-key pattern (sk-(proj-)?[A-Za-z0-9]{32,} with trailing boundary ([^A-Za-z0-9_-]|$)) will not match real OpenAI project or service-account keys (sk-proj-..., sk-svcacct-...) whenever their body contains - or _ separators: the core stops at -/_ and the trailing boundary explicitly rejects -/_. Include _- in the core (or match sk-(proj-|svcacct-)[A-Za-z0-9_-]{32,}) and add a fixture containing _ and - to scripts/agy-review-selftest.sh.
  • scripts/agy-review.sh (lines 177-180, 1714-1722, 1889-1891): redacted_kinds is appended inside the retry loop before svc_err is handled and is never reset between attempts. If attempt 1 fails with a backend error that happens to contain a token-shaped string (such as the selftest's grow.txt fixture) and attempt 2 succeeds cleanly, the posted review still carries the redaction warning note from attempt 1. In addition, credential_kind_present returns on the first matching pattern in agy_credential_patterns, so redacted_kinds only ever names the first matched kind rather than all kinds redacted in that capture.
  • scripts/agy-review.sh (lines 1005, 1581, 1656-1660): On the documented self-hosted runner layout (~/actions-runner/<name>), RUNNER_TEMP lives under $HOME (~/actions-runner/<name>/_work/_temp), as does $(dirname "$0")/_agy_print.sh. Because bwrap mounts --bind "$agy_jail_home" "$HOME" first and then bind-mounts $AGY_BIN, _agy_print.sh, and $agy_sandbox at their host paths, bwrap creates the host checkout's directory skeleton (~/actions-runner/<name>/_work/<repo>/<repo>/scripts/_agy_print.sh) and $agy_sandbox inside $HOME in the jail (and on the host inside $agy_jail_home). Creating agy_jail_home and agy_sandbox under /tmp (or mounting _agy_print.sh, prompt_file, and agy_sandbox at fixed in-jail paths outside /home, such as /run/agy-...) keeps $HOME genuinely empty inside the jail.
  • scripts/agy-review.sh (lines 154-166, 1477): egress.py decodes the denied CONNECT target with latin-1 and writes parts[1][:300] raw to AGY_EGRESS_DENIED_FILE. Because parts[1] is only whitespace-split, it can carry raw C0/C1 control bytes or terminal escape sequences (\x1b...) into ~/.gemini/antigravity-cli/agy-egress-denied.log that execute when the operator inspects the log in a terminal. Scrub non-printable bytes before logging, and mkdir -p -- "$(dirname -- "$dst")" in agy_record_denied so a custom AGY_EGRESS_DENIED_LOG in a not-yet-created directory does not fail.
  • scripts/agy-review-selftest.sh (lines 298, 629-647): The offline TLS proxy test creates sockd outside $TMPD (${XDG_RUNTIME_DIR:-/tmp}/agyst.XXXXXX) and spawns px_pid in the background, but the EXIT trap on line 298 only removes $TMPD. If any check between lines 642 and 721 aborts early or receives a signal, px_pid and sockd are leaked.

Nitpicks

  • Cargo.lock (lines 1471, 4992) & fuzz/Cargo.lock (lines 943, 3168): Unrelated form_urlencoded (1.2.2 -> 1.2.3) and url (2.5.8 -> 2.5.9) lockfile bumps are bundled into this ci: PR; split them into a separate chore(deps): commit or drop them to keep one logical change per commit.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

Round reviewed at 2026-11-23 00:37 UTC

Antigravity review (Gemini via Ultra)

Syncs the Antigravity PR reviewer workflow, documentation, and scripts with the hardened template, isolating agy in a bubblewrap + D-Bus-filtered jail with a TLS-terminating HTTP/1.1 egress proxy, environment allowlisting, and credential redaction.

Blocking issues

None found.

Suggestions

  • scripts/agy-review.sh (lines 1731-1739): redacted_kinds leaks across retry attempts and only records the first matched kind per attempt.

    1. redacted_kinds is never cleared at the top of the for (( attempt=1; attempt<=AGY_RETRIES; attempt++ )) loop (around line 1693). If attempt 1 redacts a string and is then discarded due to a timeout or backend error, a clean attempt 2 still posts the redaction disclaimer from attempt 1 (or duplicates the label if attempt 2 also redacts). Reset redacted_kinds="" at the start of each attempt alongside : > "$out_file".
    2. credential_kind_present (lines 203-210) returns after the first pattern that matches (return 0), so if an output contains multiple distinct credential shapes, only the first table entry is named in redacted_kinds and the comment footnote (line 1892).
  • scripts/agy-review.sh (lines 1380-1398): rebuild_request strips Content-Length: 0, which can trigger HTTP 411 Length Required upstream.
    When a request carries Content-Length: 0, length = int(lengths[0]) is 0, kind is set to "none" (kind = "length" if length else "none"), and framing omits Content-Length while the original header was already stripped via HOP_BY_HOP. Google Front End (*.googleapis.com) rejects bodyless POST/PUT requests without Content-Length: 0 (or Transfer-Encoding: chunked) with 411. Preserve kind = "length" whenever lengths is present (and check length != 0 or kind == "chunked" in the path_rules guard, since copy_exact(cr, uw, 0) is already a no-op).

  • scripts/agy-review.sh (lines 1468-1478): sanitize denied CONNECT targets before writing to AGY_EGRESS_DENIED_LOG.
    In handle(), parts[1] is decoded with latin-1 before clean_head() runs and written directly to deniedf (deniedf.write(parts[1][:300] + "\n")). A prompt-injected CONNECT target containing C0/C1 control bytes or ANSI escape sequences (\x1b[...]) will be persisted into ~/.gemini/antigravity-cli/agy-egress-denied.log and rendered if the operator inspects the log in a terminal. Strip or escape non-printable bytes (c <= 0x20 or c >= 0x7F) before writing to deniedf.

  • scripts/agy-review-selftest.sh (lines 912-1004): register sockd and px_pid with the selftest EXIT trap.
    sockd (created under ${XDG_RUNTIME_DIR:-/tmp}) and the background px_pid process live outside $TMPD. If any check or command between lines 912 and 1004 aborts early or receives a signal, the selftest's trap 'rm -rf "$TMPD"' EXIT leaves the background Python proxy running and sockd on disk.

Nitpicks

  • Cargo.lock (lines 1469-1475, 4990-4996) and fuzz/Cargo.lock (lines 941-947, 3166-3172): Unrelated lockfile bumps (form_urlencoded 1.2.2 -> 1.2.3, url 2.5.8 -> 2.5.9) are bundled into a CI reviewer sync PR; split them out to keep one logical change per commit.
  • scripts/agy-review.sh (lines 1647, 1662): xdg-dbus-proxy and the Python egress proxy (2>>"$LOG") are launched before : > "$LOG" truncates the log and before flock -w "$AGY_LOCK_WAIT" 9 acquires the host lock (which can wait up to 1860s). Starting the proxies after acquiring flock (and after truncating $LOG) avoids holding idle proxy processes and open sockets across a 31-minute lock wait.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

Round reviewed at 2026-11-22 23:04 UTC

Antigravity review (Gemini via Ultra)

Hardens the self-hosted Antigravity PR reviewer by isolating agy in a bubblewrap jail with a filtered D-Bus proxy, a TLS-terminating HTTP/1.1-rebuilding egress proxy, an allowlisted environment, an out-of-checkout sandbox directory, credential redaction, and an expanded cross-repo lock timeout.

Blocking issues

None found.

Suggestions

  • Host paths under $HOME are recreated as writable directory trees inside the jail (scripts/agy-review.sh, agy_jail setup around lines 2136–2216): --tmpfs /home --bind "$agy_jail_home" "$HOME" mounts the writable $agy_jail_home at $HOME, and subsequent flags bind $AGY_BIN, $(dirname "$0")/_agy_print.sh, and $agy_sandbox at their host paths. On the documented runner layout (~/actions-runner/<name>), all of those paths live under $HOME, so bwrap populates $agy_jail_home with the host's directory hierarchy (leaking the checkout path into the jail) and leaves parent directories such as $HOME/.local/bin writable inside $HOME across retry attempts. Binding _agy_print.sh, $prompt_file, and $agy_sandbox at fixed in-jail paths outside /home (e.g., under /run or /work) and resetting $agy_jail_home on each retry attempt would keep $HOME genuinely empty and stateless across retries.
  • Single-line or inline-quoted PEM headers wipe the rest of the review (scripts/agy-review.sh, agy_redact_credentials around lines 1229–1231): sed -E "/${core}/,/-----END [A-Z ]*PRIVATE KEY-----/c\\[REDACTED: ${kind}]" uses a two-address line range, where sed only tests the end pattern starting on the line after the start pattern matches. If a review quotes -----BEGIN PRIVATE KEY----- in prose without a matching END line—or puts BEGIN and END on the same line—the range consumes every remaining line to EOF and replaces the rest of the review with [REDACTED: private-key-block]. Substituting single-line BEGIN...END matches first (e.g., via s#-----BEGIN [A-Z ]*PRIVATE KEY-----.*-----END [A-Z ]*PRIVATE KEY-----#[REDACTED: private-key-block]#g) avoids truncating the review when both markers share a line.
  • Egress logs are skipped if credential redaction aborts, and redacted_kinds leaks across retries (scripts/agy-review.sh, retry loop around lines 2225–2302): If agy_redact_credentials fails closed with exit 1 (line 2267), execution jumps to cleanup() before running agy_record_denied or printing the egress.log verdict summary—losing egress telemetry on the exact path where a prompt injection may have attempted exfiltration. In the same loop, redacted_kinds is appended to on line 2269 without being reset at the start of each attempt, so a redaction in a discarded attempt stays attached to a clean retry.
  • Background proxies start before flock, and : > "$LOG" truncates after egress.py is backgrounded (scripts/agy-review.sh, around lines 2138–2188 vs. flock): xdg-dbus-proxy and egress.py (with 2>>"$LOG") are launched before acquiring AGY_LOCK and before : > "$LOG". When a job queues behind another repo's review for up to AGY_LOCK_WAIT (1860 s), those background processes sit idle for the entire wait, and : > "$LOG" wipes any startup diagnostics written by egress.py before the truncation. Starting the jail proxies after flock and : > "$LOG" avoids both.
  • A post-request stream error logs both ALLOW and FAIL (scripts/agy-review.sh, handle() in agy_egress_proxy_src around lines 2061–2075): log("ALLOW", host) runs before await pipe(ur, cw). Because pipe() catches only (ConnectionError, OSError, asyncio.IncompleteReadError), an ssl.SSLError or TimeoutError during response streaming escapes pipe() into handle()'s except block and logs FAIL for the same connection, double-counting it in the egress summary.
  • Unrelated Rust lockfile updates (Cargo.lock, fuzz/Cargo.lock): Both lockfiles bump form_urlencoded (1.2.2 -> 1.2.3) and url (2.5.8 -> 2.5.9), which is unrelated to syncing the Antigravity CI reviewer template and should be split into a separate commit/PR if unintentional.

Nitpicks

  • scripts/agy-review.sh (agy_record_denied, line 1164): > "$dst.new" assumes $(dirname "$dst") already exists; adding mkdir -p -- "$(dirname -- "$dst")" inside the umask 077 subshell prevents a failure when AGY_EGRESS_DENIED_LOG points into a new directory.
  • scripts/agy-review.sh (_inner socat bridge, line 2197): socat ... 2>/dev/null & leaves stdin and stdout attached to the PTY slave; redirecting </dev/null >/dev/null 2>/dev/null avoids giving socat a handle to the capture PTY.
  • scripts/agy-review.sh (handle() in agy_egress_proxy_src, line 2032): host, _, port = parts[1].rpartition(":") checks host not in allow without lowercasing host (unlike rebuild_request, which lowercases the Host header), so a mixed-case CONNECT target would be denied even for an allowlisted host.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

Round reviewed at 2026-11-22 22:16 UTC

Antigravity review (Gemini via Ultra)

Syncs the Antigravity PR reviewer workflow, scripts, and self-tests with the hardened template, adding a bubblewrap + xdg-dbus-proxy jail, a TLS-intercepting egress proxy, credential redaction, an allowlisted process environment, an isolated diff sandbox outside the checkout, and a longer host-wide lock wait.

Blocking issues

None found.

Suggestions

  • Cargo.lock (lines 1471–1475, 4992–4996) and fuzz/Cargo.lock (lines 943–947, 3168–3172): Both lockfiles bump form_urlencoded (1.2.2 → 1.2.3) and url (2.5.8 → 2.5.9), which is unrelated to syncing the CI reviewer template and violates the one-logical-change-per-commit convention. Revert the lockfile changes or split them into a separate chore(deps) commit.
  • scripts/agy-review.sh (lines 1474–1601 vs. lines 1626–1647): The AGY_ISOLATION=bwrap setup block starts xdg-dbus-proxy, generates the per-run PKI certificates, and launches the background python3 egress proxy (2>>"$LOG") before : > "$LOG" (line 1609) and before acquiring flock -w "$AGY_LOCK_WAIT" 9 (line 1634). As a result, : > "$LOG" truncates any proxy startup diagnostics written to $LOG, and a job queued behind another review can hold idle xdg-dbus-proxy and python3 background processes open for up to 31 minutes (AGY_LOCK_WAIT=1860) before running. Move the daemon startup (or the entire jail setup) after the flock acquisition and after : > "$LOG".
  • scripts/agy-review.sh (lines 1662, 1699–1707): redacted_kinds is appended to inside the retry loop (redacted_kinds="${redacted_kinds:+$redacted_kinds, }${cred_kind}") without being reset at the start of each attempt alongside : > "$out_file". If attempt 1 produces a credential-shaped string together with a transient error or print timeout and attempt 2 succeeds cleanly, the posted review will carry a false redaction banner from attempt 1. In addition, credential_kind_present returns only the first matching kind from agy_credential_patterns, so if multiple distinct credential types are redacted in one capture, redacted_kinds only names the first.
  • scripts/agy-review.sh (lines 1874–1878, 1995): The last-resort credential check before posting inspects "$out_file" rather than "$body_file" (unlike oauth_url_present "$body_file" right below it and after archive assembly). Scanning "$body_file" after archive assembly as well would guarantee that no unredacted credential-shaped string from a pre-redaction archived round is re-published on PATCH.
  • scripts/agy-review.sh (lines 1195, 1220–1222): In agy_redact_credentials, sed -E "/${core}/,/-----END [A-Z ]*PRIVATE KEY-----/c\\[REDACTED: ${kind}]" uses a line-range address. If a review quotes -----BEGIN ... PRIVATE KEY----- inline (e.g., discussing a key header in a PR) without a subsequent -----END ... PRIVATE KEY----- line, sed replaces everything from that line to the end of the review.

Nitpicks

  • scripts/agy-review.sh (lines 157–170, 1413–1425): deniedf.write(parts[1][:300] + "\n") logs raw Latin-1-decoded bytes from the untrusted CONNECT target into the host-private agy-egress-denied.log without stripping control or ESC (0x1b) characters; sanitizing non-printable bytes before writing prevents terminal escape injection when inspecting that log on the runner host.
  • scripts/agy-review.sh (lines 1381–1382): Duplicate comment line # Inside the jail: bridge loopback 3128 to the proxy socket....

Automated first-pass review by agy on a self-hosted runner -- not a human review.

Round reviewed at 2026-11-22 21:46 UTC

Antigravity review (Gemini via Ultra)

This PR hardens the self-hosted Antigravity PR reviewer by running agy inside a bubblewrap sandbox with an allowlisted environment, filtered D-Bus Secret Service access, a local TLS-intercepting egress proxy, credential-leak scanning on stdout/stderr, and expanded self-tests, while also containing an unrelated Cargo.lock / fuzz/Cargo.lock bump.

Blocking issues

None found.

Suggestions

  • Cargo.lock (lines 1472, 4993) and fuzz/Cargo.lock (lines 944, 3169): This PR bumps form_urlencoded (1.2.2 -> 1.2.3) and url (2.5.8 -> 2.5.9), which is unrelated to the ci: reviewer sync and mixes two logical changes in one PR. Revert the lockfile diff here and land dependency updates separately.
  • scripts/agy-review.sh (lines 1516–1518 vs. line 1554): python3 -I "$agy_jail_rt/egress.py" ... 2>>"$LOG" & starts writing stderr to $LOG during jail setup, and then : > "$LOG" (line 1554, before flock) truncates $LOG, wiping any startup diagnostics from egress.py. Initialize : > "$LOG" before starting the proxy Processes.
  • scripts/agy-review.sh (lines 1479–1550 vs. lines 1568–1572): xdg-dbus-proxy, the 1-day ephemeral certificate generation, and egress.py all start before flock -w "$AGY_LOCK_WAIT" 9. With AGY_LOCK_WAIT=1860, a queued job spawns both daemons and holds them idle for up to 31 minutes waiting for another review to finish. Starting the jail daemons after acquiring the lock (closing fd 9>&- in those background subshells so they do not hold the lock open) avoids idle background daemons during queue waits.
  • scripts/agy-review.sh (line 1528): In the in-jail _inner wrapper (for _ in $(seq 1 100); do (exec 3<>/dev/tcp/127.0.0.1/3128) 2>/dev/null && break; sleep 0.1; done; exec "$@"), if socat fails to bind 127.0.0.1:3128, the readiness loop times out after 10 seconds and still runs exec "$@", burning all AGY_RETRIES attempts with a broken proxy instead of failing immediately with an agy-jail: diagnostic that agy_jail_failed catches. Check that port 3128 actually opened after the loop (or exit with echo "agy-jail: socat bridge did not start" >&2; exit 1).
  • scripts/agy-review.sh (lines 1256, 1502–1509): Unlike AGY_EGRESS_ALLOW (which validates every entry against ^[a-z0-9]...), AGY_EGRESS_INTERCEPT_HOST is never validated before being interpolated into OpenSSL's -subj "/CN=$AGY_EGRESS_INTERCEPT_HOST" and subjectAltName=DNS:%s. Validate AGY_EGRESS_INTERCEPT_HOST with the same hostname regex (and allow an empty value to disable interception, which egress.py line 1729 already supports, rather than forcing the default via :-).
  • scripts/agy-review.sh (lines 1478, 1538–1545): On the documented runner layout (~/actions-runner/<name>), both the checkout and $RUNNER_TEMP live under $HOME. Binding --bind "$agy_jail_home" "$HOME" first and then mounting _agy_print.sh and $agy_sandbox at their host paths causes bwrap to create the actions-runner/<name>/_work/... directory hierarchy inside the jail's $HOME. Mounting $agy_sandbox, $prompt_file, and _agy_print.sh at fixed paths under /run inside the jail would keep the jail's $HOME completely empty regardless of where the runner resides.

Nitpicks

  • scripts/agy-review.sh (line 1543 vs. line 1553): "$(cd "$(dirname "$0")" && pwd)/_agy_print.sh" is computed twice on line 1543 right before here="$(cd "$(dirname "$0")" && pwd)" is defined on line 1553; compute here once beforehand and reuse "$here/_agy_print.sh".
  • scripts/agy-review-selftest.sh (lines 907–1018): $sockd (created under ${XDG_RUNTIME_DIR:-/tmp}, outside $TMPD) and the background $px_pid / $ip_pid processes are not registered in the selftest's EXIT trap, so an early abort or signal mid-test leaves them behind.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

Round reviewed at 2026-11-22 21:02 UTC

Antigravity review (Gemini via Ultra)

This PR syncs the Antigravity PR reviewer workflow, scripts, and self-test suite with the hardened template (adding a bubblewrap filesystem/network jail, a D-Bus Secret Service filter, a local TLS-intercepting egress proxy, an allowlisted process environment, and credential-shape output scanning), and includes an unrelated Cargo.lock bump of url and form_urlencoded.

Blocking issues

None found.

Suggestions

  • scripts/agy-review.sh:1815 — Fail closed inside the jail if the socat loopback proxy bridge does not come up.
    The in-jail wrapper loops 100 times probing /dev/tcp/127.0.0.1/3128 and then unconditionally runs exec "$@" even if the loop exhausted all 100 iterations without connecting. If socat fails to bind 127.0.0.1:3128, agy still launches against a dead proxy port and burns the full retry budget instead of emitting an agy-jail: diagnostic that agy_jail_failed (scripts/agy-review.sh:916) can catch immediately.

  • scripts/agy-review.sh:1879-1890, scripts/agy-review.sh:1903-1914 — Egress summary and denied-host logging are skipped on early exit 1 from the capture loop.
    When credential_kind_present or agy_jail_failed triggers inside the retry loop, the script exits before recording egress-denied.txt via agy_record_denied or printing the egress verdict counts from egress.log. Moving the egress log harvesting into cleanup() (before removing $agy_jail_rt) would preserve forensic evidence on the exact runs most likely to involve prompt-injection exfiltration attempts.

  • scripts/agy-review.sh:1828-1833 — Binding host paths under $HOME into the jail leaks the host runner directory hierarchy into the private $HOME.
    On self-hosted runners where the checkout and $RUNNER_TEMP live under $HOME (e.g., ~/actions-runner/.../_work/...), --bind "$agy_jail_home" "$HOME" is followed by --ro-bind .../_agy_print.sh, --ro-bind "$prompt_file" "$prompt_file", and --bind "$agy_sandbox" "$agy_sandbox" at their literal host paths. bwrap creates those parent directories inside $agy_jail_home, exposing the host username and runner workspace layout inside the jailed $HOME. Binding the sandbox, prompt file, and helper script at fixed paths under /run or /tmp inside the jail avoids recreating host $HOME subpaths.

  • Cargo.lock:1469-1476, Cargo.lock:4990-4997 — Unrelated dependency bump bundled into a CI template sync.
    form_urlencoded (1.2.2 -> 1.2.3) and url (2.5.8 -> 2.5.9) are updated in Cargo.lock without any Cargo.toml change or relationship to the reviewer scripts. Per the project convention of one logical change per commit/PR, split or drop the accidental lockfile drift unless it is an intentional advisory bump.

Nitpicks

  • scripts/agy-review.sh:900-912 (agy_record_denied): Piping the { ...; } block directly into tail -n 500 > "$dst.tmp" && mv -f "$dst.tmp" "$dst" avoids the intermediate $dst.new file (which is currently left behind if the second tail or mv fails).
  • scripts/agy-review.sh:1701-1704 (intercept): When upstream asyncio.open_connection fails in handle() (line 1605), the proxy replies with HTTP/1.1 502 Bad Gateway, whereas intercept() closes the TLS stream abruptly without an HTTP status response.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

Round reviewed at 2026-11-22 19:34 UTC

Antigravity review (Gemini via Ultra)

This PR syncs the Antigravity PR reviewer workflow, scripts, selftests, and documentation with the hardened template (adding bubblewrap + xdg-dbus-proxy isolation, an allowlisted environment, an isolated working sandbox outside the checkout, output credential scanning, cumulative dropped-round tracking, and raised lock-wait/timeout budgets).

Blocking issues

None found.

Suggestions

  • scripts/agy-review.sh:454: [ -n "${agy_proxy_pid:-}" ] && kill "$agy_proxy_pid" 2>/dev/null has no || true. Because set -e remains active inside EXIT trap handlers, if xdg-dbus-proxy has already exited before cleanup() runs (for example, when startup fails and hits exit 1 at line 1174, or when job cancellation sends SIGTERM to the process group), kill returns non-zero (ESRCH) and aborts cleanup() before $agy_jail_home, $agy_jail_rt, and refs/agy/* are removed. Append || true (and wait "$agy_proxy_pid" 2>/dev/null || true before removing $agy_jail_rt).
  • scripts/agy-review.sh:1154-1163: If AGY_KEYRING_ATTRS is set to whitespace (so ${AGY_KEYRING_ATTRS:-...} does not apply the default), for _kv in $AGY_KEYRING_ATTRS runs zero iterations and leaves _dict empty; Collection.SearchItems "{}" then matches every item in the default collection and grants Item.GetSecret on all of them. Assert [ -n "$_dict" ] before calling gdbus, and split AGY_KEYRING_ATTRS with read -r -a (as done in agy_allowlisted_env_args at line 1121) rather than unquoted word-splitting.
  • scripts/agy-review.sh:1146-1190: gdbus keyring resolution and xdg-dbus-proxy startup run before acquiring the host-wide flock on AGY_LOCK, which can now wait up to AGY_LOCK_WAIT=1860 seconds. Moving the jail/proxy setup after the lock acquisition avoids keeping a background proxy and $XDG_RUNTIME_DIR/agy-jail.* directory open during a 30-minute queue wait and prevents _items from going stale if another review updates the keyring item while holding the lock.
  • scripts/agy-review.sh:1180-1185: On a self-hosted runner installed under the user's home directory (e.g. ~/actions-runner/_work/...), RUNNER_TEMP and the repository checkout are subdirectories of $HOME. Because --bind "$agy_jail_home" "$HOME" is mounted before --ro-bind .../_agy_print.sh and --bind "$agy_sandbox" "$agy_sandbox", bwrap creates those host directory trees inside $agy_jail_home, leaving the jailed $HOME non-empty and exposing the host path hierarchy. Also, _agy_print.sh and $prompt_file are mounted into the jail unconditionally even when taking the unbuffer path that never reads them inside the jail.

Nitpicks

  • .github/AGY-REVIEWER.md:285-286: The doc says `unbuffer` keeps its own environment and runs `env -i ... agy`, so only agy is reduced, which contradicts scripts/agy-review.sh:1235-1238 and scripts/agy-review-selftest.sh:765-766 (env -i now wraps unbuffer directly so NAME=VALUE pairs do not appear in unbuffer's /proc/<pid>/cmdline).
  • scripts/agy-review.sh:1173: The 10-second socket wait loop (for _ in $(seq 1 100); do [ -S "$agy_jail_rt/bus" ] && break; sleep 0.1; done) could also break early if ! kill -0 "$agy_proxy_pid" 2>/dev/null, avoiding a full 10-second sleep when xdg-dbus-proxy exits immediately with an error.

Automated first-pass review by agy on a self-hosted runner -- not a human review.

doublegate and others added 2 commits November 22, 2026 15:44
Re-syncs the vendored Antigravity reviewer scripts and
.github/AGY-REVIEWER.md byte for byte from the antigravity-pr-review
template at fd64ab3. Local workflow overrides are unchanged.

New: the jail has no network of its own (AGY_EGRESS=filtered)
- agy must be able to read its own Google login token, so the network
  was the remaining way to leak it. The jail now has only its own
  loopback. Its single route out is an allowlisting HTTPS CONNECT
  proxy outside the jail, reached through a bind-mounted Unix socket.
- Exact host names only. `.googleapis.com` would include Cloud
  Storage, where anyone can own a writable bucket.
- www.googleapis.com also serves the Cloud Storage API. That host is
  TLS-intercepted with a per-run CA whose key never enters the jail,
  and only a body-less GET /oauth2/v2/userinfo is forwarded, rebuilt
  by the proxy with its own Host header. Forwarding the client's Host
  would allow fronting to any Google service.
- Verified from inside the jail. Refused: Cloud Storage upload and
  read (including path-traversal, encoded, HTTP/2, Host-fronting and
  smuggling variants), other hosts and ports, direct connections, raw
  TCP and DNS. A full review completes.
- The job log prints egress verdict counts only. Denied host names go
  to a mode-600 log on the runner host, for diagnosing an agy update
  that needs a new host.

Fixes from review round 4 on these re-sync PRs:
- A jail that fails to start is no longer accepted as review output
  (Codex).
- cleanup survives an already-exited proxy under set -e (Cursor).
- Each capture is credential-scanned before any handler logs it
  (CodeRabbit). The public stderr tail is withheld if it carries a
  credential shape (Cursor).
- An empty AGY_KEYRING_ATTRS (SearchItems {} matches every item) is
  refused (Cursor).
- TMPDIR=/tmp inside the jail (Cursor). Top-level lib/bin links
  mirror the host layout, for Debian and Ubuntu (Codex).

Verification: agy-review-selftest.sh all checks passed (now including
offline TLS tests of the egress proxy); actionlint clean; gitleaks no
leaks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RUSTSEC-2026-0592 (stack overflow in Url::origin() on nested blob:
URLs) entered the advisory database after main's last green run, so
Dependency Audit and Cargo Deny Check are red on any new push. url
reaches the tree only through webbrowser -> egui-winit in
rustysnes-frontend. A lockfile-only patch bump.

Verification: cargo audit reports no vulnerabilities; cargo deny check
advisories: ok.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@doublegate

Copy link
Copy Markdown
Owner Author

Red checks: cause and fix (aae5617)

Dependency Audit and Cargo Deny Check failed on RUSTSEC-2026-0592, a stack overflow in url's Url::origin() on nested blob: URLs. The advisory entered the database after main's last green run, so any push would have hit it. url is reached only through webbrowser and egui-winit in the frontend. The lockfile now takes the patched url 2.5.9. After the bump, cargo audit reports no vulnerabilities and cargo deny check advisories passes.

@doublegate

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aae5617b8e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/agy-review.sh Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because on-demand usage is turned off. To enable Bugbot Autofix, turn on on-demand usage and set a spend limit in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit aae5617. Configure here.

Comment thread scripts/agy-review-selftest.sh Resolved
doublegate and others added 2 commits November 22, 2026 16:04
The vendored reviewer README now passes markdownlint defaults
(0 errors, down from 77: MD013 line-length and MD060 table style).
Prose is rewrapped to 80 columns, long code lines are rewritten, table
delimiters use the compact style, and tables are fenced against MD013.
It also corrects the security-model note on unbuffer: env -i now
starts unbuffer itself.

Also re-syncs the self-test labels to en-US spelling (template
fd64ab3). Documentation and labels only; no behavior change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dependency Audit scans both lockfiles. aae5617 bumped only the
workspace Cargo.lock, so RUSTSEC-2026-0592 (url 2.5.8) still failed
from fuzz/Cargo.lock. The fuzz crate now takes 2.5.9 as well.

Verification: cargo audit --file fuzz/Cargo.lock reports no
vulnerabilities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 22, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 170d6de9-b56f-44c6-8947-df55a30d14f6)

Re-syncs the vendored reviewer scripts and .github/AGY-REVIEWER.md
byte for byte from the antigravity-pr-review template at 1d782bb.
Local workflow overrides are unchanged.

- Fronting fix (HIGH from this PR's review, reproduced live): only
  www.googleapis.com was intercepted, and Google's front end routes by
  Host on any googleapis connection, so a request to oauth2, aicode or
  daily-cloudcode-pa carrying `Host: storage.googleapis.com` reached
  Cloud Storage. Every allowed host is now TLS-intercepted. Each
  connection carries one HTTP/1.1 request, validated strictly and
  rebuilt with the proxy's own Host and a body forwarded exactly once.
  Fronting through all four hosts is verified blocked from inside the
  jail, and a full review completes.
- AGY_EGRESS_PATH_RULES (host=/exact/path, literal) replaces
  AGY_EGRESS_INTERCEPT_HOST/_PATH.
- Credential-shaped output is redacted to `[REDACTED: <kind>]` with a
  note in the comment, instead of failing the review. The scan cannot
  tell a secret from a test fixture. Anything redaction misses still
  fails closed.
- Python >= 3.11 is checked. The jail refuses to launch agy when its
  egress bridge is down. The denied-host log keeps the newest 500
  records, and streams are closed on every error path.
- Self-test: the TLS cases no longer depend on curl, and a certificate
  failure is a FAIL. There are 20 offline proxy cases and full
  redaction coverage.

Verification: agy-review-selftest.sh all checks passed; actionlint
clean; markdownlint clean on AGY-REVIEWER.md; gitleaks no leaks in
scripts/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 22, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: e8157db9-8964-44b7-ba84-8b01c40b64b0)

Two follow-ups from the automated security review of 1d782bb:
- Chunk trailers are read (bounded) and discarded; only the terminating
  CRLF goes upstream, so no header can be added after validation.
- Credential redaction runs in memory instead of through a predictable
  "$f.redact" sibling file in a possibly shared TMPDIR.

Verification: agy-review-selftest.sh all checks passed; actionlint
clean. Live: a jailed review through the proxy posted (26 rebuilt
requests), leaving nothing behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 22, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 57ea9e1b-510d-4519-b902-6fae0202d318)

Re-syncs the vendored reviewer scripts and .github/AGY-REVIEWER.md
byte for byte from the antigravity-pr-review template at accfc51.
Local workflow overrides are unchanged. From CodeRabbit's review of
CyberChef-MCP #184:

- A backend error is classified on agy's raw capture, before
  redaction. A redaction marker is longer than the key it replaces, so
  a near-limit error could outgrow the size guard and be posted.
- A private key whose BEGIN and END share one line no longer deletes
  the rest of the review.
- The egress proxy drops fields named in Connection (RFC 9110) and
  answers Expect with 417 instead of stalling.
- Self-test: the path-rule fixture contains a `.`, so literal and
  regex matching are told apart, and the denial count is exact.

Verification: agy-review-selftest.sh all checks passed (each new check
fails against f29c2ab); actionlint clean; markdownlint clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 23, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 66db7340-19d7-4fc8-b6e8-ea2ecf7032d4)

Re-syncs the vendored reviewer scripts and .github/AGY-REVIEWER.md
byte for byte from the antigravity-pr-review template at 499bb51.
Local workflow overrides are unchanged. From CodeRabbit's review of
CyberChef-MCP #184:

- A backend error is classified on agy's raw capture, before
  redaction. A redaction marker is longer than the key it replaces, so
  a near-limit error could outgrow the size guard and be posted.
- Private-key redaction uses awk: a one-line block is replaced in
  place, and a block with no END line ends in a visible marker saying
  the rest of the review was removed, instead of a silent truncation.
- The egress proxy drops fields named in Connection (RFC 9110) and
  answers Expect with 417 instead of stalling.
- Self-test: the path-rule fixture contains a `.`, so literal and
  regex matching are told apart, and the denial count is exact.

Verification: agy-review-selftest.sh all checks passed (each new check
fails against f29c2ab); actionlint clean; markdownlint clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 23, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 789938f8-b460-449f-891c-0f5bcc306d3b)

doublegate and others added 2 commits November 22, 2026 20:56
Re-syncs scripts/agy-review-selftest.sh byte for byte from the
antigravity-pr-review template at 8782d07. No other reviewer file
changed; local workflow overrides are unchanged.

- The chunked-trailer checks counted source text, so removing the
  terminating CRLF or forwarding a trailer through another write call
  left them green (CodeRabbit on CyberChef-MCP #184). They now run the
  real copy_chunked on an asyncio stream with a recording writer: a
  trailer is dropped, exactly `0\r\n\r\n` goes upstream, and the bytes
  of a following request stay unread. Both mutations turn them red.

Verification: agy-review-selftest.sh all checks passed; actionlint
clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re-syncs the vendored reviewer scripts byte for byte from the
antigravity-pr-review template at 2a366ac (round 10 of the agy and
CodeRabbit findings). Local workflow overrides are unchanged.

- A second private key opened on the first key's END line was dropped
  from redaction; each line is now scanned left to right.
- OpenAI sk-proj-/sk-svcacct- keys (base64url) are recognized.
- The redaction note names every kind and is reset per attempt; the
  last guard scans the assembled comment body.
- The egress proxy forwards Content-Length: 0 (Google answers an empty
  POST without it with 411).
- Control bytes are stripped from the denied-host log; the agy lock is
  taken before the jail starts; cleanup reaps both proxies.
- Self-test: two pipefail races (one made it flake) are removed, and
  the TLS cases are skipped by name on python < 3.11.

Verification: agy-review-selftest.sh all checks passed; actionlint
clean; a live jailed review from the same scripts completed and
cleaned up after itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 23, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 243b43c2-1e81-4a2f-8799-f5c36c0bade2)

Re-syncs the vendored reviewer scripts byte for byte from the
antigravity-pr-review template at b940416 (round 11). Local workflow
overrides are unchanged.

- The archived earlier rounds are now redacted, and the assembled
  comment body is scanned after they are appended. 2a366ac's guard ran
  before the append and so never saw the archive.
- Egress proxy: the CONNECT host is matched case-insensitively, bytes
  pipelined behind a CONNECT are refused, and a duplicate path rule for
  one host is refused.
- Both proxies stop once agy finishes; a dead proxy ends the startup
  wait at once; a missing AGY_BIN is refused before the jail is built.

Verification: agy-review-selftest.sh all checks passed; actionlint
clean; a live jailed review from the same scripts completed and
cleaned up after itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@doublegate

Copy link
Copy Markdown
Owner Author

Adjudication of the latest Antigravity rounds

No blocking issues remain. Each finding was checked against the cited code. The real ones were fixed in the antigravity-pr-review template, which this PR now carries at b940416: round 10 is 2a366ac, round 11 is b940416. Every fix has a self-test check that fails on the previous template. A live jailed review from the same scripts completed and left no runtime directories or proxies behind.

Finding Disposition
A second private key opened on the first key's END line escaped redaction Fixed (2a366ac). Each line is scanned left to right; two one-line keys on one line are also handled.
openai-key missed base64url sk-proj-/sk-svcacct- keys Fixed (2a366ac): the core allows _ and -.
redacted_kinds leaked across retries and named only the first kind Fixed (2a366ac): reset per attempt; credential_kinds_present names every kind.
Last guard scanned $out_file, not the posted body Fixed. 2a366ac scanned the body, but before the archive was appended. b940416 also redacts the archived rounds before size trimming and scans the assembled body after the append. Both are ordering checks.
Content-Length: 0 dropped (an empty POST draws 411) Fixed (2a366ac): forwarded, and sent for a body-less POST/PUT/PATCH.
Raw control bytes in agy-egress-denied.log; missing parent dir; sed metacharacters in the tag Fixed (2a366ac): stripped in the proxy and when recorded; mkdir -p; prefix added via ENVIRON, not sed or awk -v.
Jail and proxies started before the lock wait; rm -rf racing the proxies at cleanup Fixed. The lock is taken before the jail (2a366ac); both proxies are reaped at cleanup, and stopped once agy finishes, before the egress summary (b940416).
Empty AGY_EGRESS_ALLOW; AGY_ISOLATION=none silent Fixed: refused by name, and logged as a warning.
CONNECT host case-sensitive; bytes pipelined behind CONNECT Fixed (b940416): case-insensitive exact match; pipelined bytes get a 400 (DENY-PIPELINED). In the live run agy pipelined nothing.
Duplicate AGY_EGRESS_PATH_RULES host silently overwrote Fixed (b940416): refused (one exact path per host).
Startup waits ignored a dead proxy; a missing AGY_BIN failed obscurely Fixed (b940416).
_agy_print.sh resolved two different ways Fixed (2a366ac): one $here.
Self-test: TLS cases on python < 3.11; early-exit cleanup Fixed. They are skipped by name, and the EXIT trap stops the test proxy and keeps the exit status. Two `printf
Host runner path skeleton created inside the jailed $HOME Not changed. These are empty mount-point directories inside the per-run jail home, which is deleted at exit. They name only the sandbox path, which is agy's own working directory and already visible to it. No host file content is exposed.
timeout-minutes vs. the unpinned print timeout Checked, no change. Worst case is 2 × 900 s + 15 s + 1860 s lock wait = 3675 s, inside the 4800 s (80 min) job limit.

Cargo.lock / fuzz/Cargo.lock changes: these are intentional, not unrelated. aae5617 and 58ef4b9 bump url 2.5.8 -> 2.5.9 for RUSTSEC-2026-0592, which keeps the audit gate green for this PR.

Re-syncs the vendored reviewer scripts byte for byte from the
antigravity-pr-review template at a7d5273 (round 12). Local workflow
overrides are unchanged.

- AGY_KEYRING_ATTRS, AGY_EGRESS_ALLOW and AGY_EGRESS_PATH_RULES are split
  with `read -r -a` instead of an unquoted `for`, which globbed. Before,
  a wildcard such as `*.com` could expand to a file name in the
  checkout and pass the exact-host validation.
- The public stderr tail is withheld when the whole agy log, not just
  the tail, carries a credential shape.

Verification: agy-review-selftest.sh all checks passed; actionlint
clean; a live jailed review from the same scripts completed and
cleaned up after itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 23, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: f6cd6b20-20c4-44f2-a44f-1a99e031419a)

Re-syncs the vendored reviewer scripts byte for byte from the
antigravity-pr-review template at 023b552. Local workflow overrides are
unchanged.

- List settings (AGY_KEYRING_ATTRS, AGY_EGRESS_ALLOW,
  AGY_EGRESS_PATH_RULES) are read whole with `read -r -d '' -a`. A plain
  `read -a` stopped at the first newline, which could drop a later path
  rule (leaving that host unrestricted) or a keyring attribute.

Verification: agy-review-selftest.sh all checks passed; actionlint
clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 23, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 7e9506fd-a4af-4cd8-b230-241032cc7c80)

@doublegate
doublegate merged commit c58065e into main Nov 23, 2026
22 of 23 checks passed
@doublegate
doublegate deleted the ci/agy-reviewer-sync branch November 23, 2026 04:28
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