Skip to content

legal: inspect the official Antigravity CLI installer - #73

Merged
eXPerience83 merged 31 commits into
mainfrom
legal/inspect-antigravity-cli
Aug 2, 2026
Merged

legal: inspect the official Antigravity CLI installer#73
eXPerience83 merged 31 commits into
mainfrom
legal/inspect-antigravity-cli

Conversation

@eXPerience83

@eXPerience83 eXPerience83 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Closes #26 and unblocks implementation in #27.

Summary

  • add a bounded metadata-only inspection for the fixed official Antigravity installer URL
  • require the committed installer SHA-256 before executing any downloaded Bash
  • require the committed agy SHA-256 before invoking the installed executable
  • query installer help only after approval, reject any help-side effects, and use only a currently advertised safe strategy
  • install twice in an empty ephemeral home using the current --dir ~/.local/bin option
  • verify location, version/help behavior, Linux AMD64 format, dynamic libraries, profile immutability and repeated-install stability
  • record normalized hashes, booleans and safe filesystem metadata without retaining vendor stdout/stderr, installer bytes or binary bytes
  • upload the report only after a fixed metadata-only schema gate succeeds
  • serialize live installer runs and keep the normal AMD64 build limited to offline fixture regressions

Inspection result

The installer currently served at the official URL no longer accepts the --skip-aliases and --skip-path options described by older documentation. Its live help advertises only --dir and --help, so the reviewed flow uses an explicit isolated install directory.

The inspected CLI reports background self-updates during regular runs. The runtime integration in #27 must set AGY_CLI_DISABLE_AUTO_UPDATE=true and expose updates as a separate explicit action.

Security boundary

The workflow has contents: read, checkout credentials are not persisted, the inspected process receives a minimal environment with no GitHub token, and only a schema-validated metadata artifact can be uploaded. It never authenticates to Google and never uploads or redistributes the installer or installed executable.

If either the installer hash or resulting binary hash changes, the workflow fails before executing the changed component and requires a deliberate evidence review.

Validation

  • dedicated official installer/package inspection: passed
  • offline fixture regressions, including installer-hash rejection, payload-hash rejection, help-side-effect rejection and output-leak checks: passed
  • AMD64 build, runtime smoke tests, notices, SBOM, Trivy and fixable-critical gate: passed

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Summary by CodeRabbit

  • New Features

    • Added automated inspection of the optional Antigravity CLI installer and installed binary.
    • Added validation for installation behavior, filesystem changes, shell-profile safety, repeat-install stability, and bounded metadata.
    • Added a local installer fixture and regression checks for successful, idempotent inspections.
  • Documentation

    • Documented inspection results, distribution restrictions, update behavior, and future integration requirements.
    • Added committed JSON and Markdown inspection evidence.
  • Chores

    • Expanded build and validation workflows to run inspections and verify reports.

Walkthrough

This change adds an isolated Antigravity CLI inspection script, a local installer fixture, regression tests, committed inspection evidence, documentation, and CI checks for bounded reports and stable installation behavior.

Changes

Antigravity CLI inspection

Layer / File(s) Summary
Inspection foundations
scripts/inspect-antigravity-cli.py
Adds bounded filesystem, subprocess, installer, binary, legal-file, and installation-strategy inspection helpers.
Isolated inspection flow
scripts/inspect-antigravity-cli.py
Runs installation twice in an isolated home, captures metadata and stability results, validates findings, and writes JSON evidence.
Fixture and regression validation
scripts/fixtures/antigravity-install.sh, scripts/test_inspect_antigravity_cli.py
Adds a local installer fixture and tests report schema, binary behavior, filesystem boundaries, profile immutability, and repeat-install results.
Committed inspection evidence
third_party/antigravity-cli-inspection.{json,md}, third_party/README.md, third_party/optional-agents.md
Records installer, binary, update, legal, distribution, and future-integration inspection results.
CI enforcement
.github/workflows/inspect-antigravity-cli.yml, .github/workflows/build-amd64.yml, Makefile
Runs syntax checks, fixture tests, report-bound checks, and comparisons between live inspection results and committed evidence.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

  • Issue 27 — Adds inspection and fixture validation for the planned Antigravity installer integration.
  • Issue 29 — Automates checks for installation behavior, binary detection, profile immutability, persistence, and coexistence.

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant CI as Inspect Antigravity CLI workflow
  participant Inspector as inspect-antigravity-cli.py
  participant Installer as Antigravity installer
  participant Home as isolated temporary home
  participant Evidence as committed inspection JSON
  CI->>Inspector: compile and execute inspection
  Inspector->>Installer: download or load and validate installer
  Inspector->>Home: install twice and capture metadata
  Inspector-->>CI: return report and status
  CI->>Evidence: compare live metadata and stability indicators
  CI-->>CI: validate bounded report and blocking findings
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: inspecting the official Antigravity CLI installer.
Description check ✅ Passed The description explains the change, security impact, validation, implementation boundaries, and follow-up requirements, although it does not use every template heading.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch legal/inspect-antigravity-cli

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

Comment @coderabbitai help to get the list of available commands.

@eXPerience83
eXPerience83 marked this pull request as ready for review August 2, 2026 17:19

Copy link
Copy Markdown
Owner Author

@codex review

Please review the final inspection/evidence workflow, especially execution of the mutable vendor installer, metadata-only artifact guarantees, evidence freshness comparisons, and the no-redistribution boundary.

@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: cca77fdffd

ℹ️ 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 .github/workflows/inspect-antigravity-cli.yml Outdated
Comment thread scripts/inspect-antigravity-cli.py
Comment thread scripts/inspect-antigravity-cli.py Outdated
Comment thread scripts/inspect-antigravity-cli.py Outdated
Comment thread scripts/inspect-antigravity-cli.py Outdated

@coderabbitai coderabbitai 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.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/inspect-antigravity-cli.yml:
- Around line 3-13: Add a concurrency configuration alongside the workflow
triggers, using a group key derived from the workflow identity and Git ref and
enabling cancel-in-progress. Ensure newer runs for the same workflow/ref cancel
older runs to prevent overlapping live installer executions.

In `@scripts/fixtures/antigravity-install.sh`:
- Line 4: Update the argument check in the script’s help-option handling to
accept both “--help” and “-h”. Preserve the existing help output and successful
exit behavior for either option.

In `@scripts/inspect-antigravity-cli.py`:
- Around line 51-75: Update file_record() and inspect_binary() to hash files
incrementally in bounded-size chunks while accumulating size, instead of calling
read_bytes() and retaining the full binary in memory. Reuse the computed digest
between snapshot() and inspect_binary() where practical, including the
binary_after_first and binary_after_second flows, so each binary is not
repeatedly read and hashed.
- Around line 97-118: Update the subprocess.run call in run to pass
encoding="utf-8" and errors="replace" alongside text=True, ensuring captured
vendor output is decoded reliably and replacement characters are used instead of
raising UnicodeDecodeError. Preserve the existing timeout and CompletedProcess
handling.
- Around line 364-392: Update validate_report() to add a blocking finding when
report["binary_stable_across_second_install"] is false, but only when the binary
is present. Preserve the existing expected_binary_present and
binary_after_second checks, and use the report’s stability field to detect
changes between installations.
- Around line 314-321: Update the inspected_at_utc timestamp construction in the
returned inspection payload to use the broadly compatible dt.timezone.utc
constant instead of dt.UTC. Preserve the existing UTC timestamp format and
microsecond removal.
- Around line 134-151: Update download_installer to parse the host from
OFFICIAL_INSTALLER_URL and require the redirected final_url to use HTTPS and the
same expected host before reading or saving the response. Reject mismatched
hosts with a RuntimeError, preserving the existing download and size-limit
behavior for valid redirects.

In `@scripts/test_inspect_antigravity_cli.py`:
- Around line 27-40: Update the subprocess.run invocation in the fixture
inspection test to include a local timeout, and handle subprocess.TimeoutExpired
so the test raises a clear assertion failure when inspection exceeds that
deadline. Preserve the existing command arguments and output capture behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 187cf79f-494e-4662-8037-6d228f93ec64

📥 Commits

Reviewing files that changed from the base of the PR and between 951f70d and cca77fd.

📒 Files selected for processing (10)
  • .github/workflows/build-amd64.yml
  • .github/workflows/inspect-antigravity-cli.yml
  • Makefile
  • scripts/fixtures/antigravity-install.sh
  • scripts/inspect-antigravity-cli.py
  • scripts/test_inspect_antigravity_cli.py
  • third_party/README.md
  • third_party/antigravity-cli-inspection.json
  • third_party/antigravity-cli-inspection.md
  • third_party/optional-agents.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (8)
.github/workflows/**

⚙️ CodeRabbit configuration file

.github/workflows/**: Review GitHub Actions for least-privilege permissions, safe event triggers, untrusted input handling,
accidental publication, tag-channel correctness, secret exposure, reproducible builds, SBOM/provenance
generation and appropriate validation before pushing images.

Files:

  • .github/workflows/inspect-antigravity-cli.yml
  • .github/workflows/build-amd64.yml
**/*.{yml,yaml,Dockerfile,sh,bash,js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{yml,yaml,Dockerfile,sh,bash,js,ts,tsx}: Never use privileged containers, Docker or Podman sockets, SYS_ADMIN, host-root mounts, or broad persistence mounts such as /root, /home, /opt, /usr/local, or a parent data root.
Preserve mandatory ttyd authentication for agent terminals, origin checking for all web endpoints, tmux reconnect behavior, image identity checks, and existing Codex login, start, and resume behavior.

Files:

  • scripts/fixtures/antigravity-install.sh
**/*.{sh,bash,js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never use eval, sourced editable state, or user-controlled shell fragments for role, mode, installer, routing, or command dispatch.

Files:

  • scripts/fixtures/antigravity-install.sh
**/*.{sh,bash}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{sh,bash}: Use fixed, validated enums for roles and start modes; reject unknown values with a deterministic non-zero exit status and a clear message.
Build command invocations with Bash arrays, preserve arguments without re-evaluating them, preserve command exit status, and run persistent-state hardening after supported interactive sessions.

Files:

  • scripts/fixtures/antigravity-install.sh
**/*.{yml,yaml,sh,bash}

📄 CodeRabbit inference engine (AGENTS.md)

Implement issue #25 in separately reviewed slices: role-neutral commands and validation, configurable Codex approval modes, canonical image and variable naming with time-bounded aliases, shared image digest, Compose and state migration, and outer hardening with cross-service canaries.

Files:

  • scripts/fixtures/antigravity-install.sh
**/*.{sh,bash,js,ts,tsx,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Run the narrowest relevant tests during development and complete required CI before merge; preserve or extend coverage for role/start-mode validation, wrappers, launcher security, mounts, image identity, health checks, Codex flows, credential hardening, ttyd, tmux, provenance, notices, SBOM, Trivy, and the critical-vulnerability gate.

Files:

  • scripts/fixtures/antigravity-install.sh
scripts/**/*.sh

⚙️ CodeRabbit configuration file

scripts/**/*.sh: Review as production Bash. Check quoting, set -euo pipefail behavior, cleanup traps,
bounded retries and timeouts, non-interactive execution, idempotency and useful failure messages.
Flag commands that can hang, leak credentials, silently ignore failures or mutate persistent data unexpectedly.

Files:

  • scripts/fixtures/antigravity-install.sh
**/*.md

⚙️ CodeRabbit configuration file

**/*.md: Check that documentation matches the implemented behavior and clearly distinguishes experimental edge builds
from stable releases. Flag outdated versions, unsafe deployment guidance and claims not proven by CI or testing.

Files:

  • third_party/optional-agents.md
  • third_party/README.md
  • third_party/antigravity-cli-inspection.md
🪛 ast-grep (0.45.0)
scripts/test_inspect_antigravity_cli.py

[error] 26-39: Command coming from incoming request
Context: subprocess.run(
[
sys.executable,
str(SCRIPT),
"--output",
str(report_path),
"--installer-fixture",
str(FIXTURE),
],
cwd=ROOT,
text=True,
capture_output=True,
check=False,
)
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(subprocess-from-request)

scripts/inspect-antigravity-cli.py

[error] 105-113: Use of unsanitized data to create processes
Context: subprocess.run(
command,
cwd=cwd,
env=env,
text=True,
capture_output=True,
check=False,
timeout=timeout,
)
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(os-system-unsanitized-data)


[info] 418-418: use jsonify instead of json.dumps for JSON output
Context: json.dumps(report, indent=2, sort_keys=True)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[info] 419-419: use jsonify instead of json.dumps for JSON output
Context: json.dumps(report, indent=2, sort_keys=True)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[warning] 140-140: Request-controlled URL passed to urlopen; validate against an allowlist to prevent SSRF.
Context: urllib.request.urlopen(request, timeout=60)
Note: [CWE-918] Server-Side Request Forgery (SSRF).

(urlopen-unsanitized-data)


[warning] 211-211: XPath query is request-/variable-derived; use parameterized XPath to prevent injection.
Context: URL_RE.findall(installer_text)
Note: [CWE-643] Improper Neutralization of Data within XPath Expressions ('XPath Injection').

(xpath-injection-python)


[error] 105-113: Command coming from incoming request
Context: subprocess.run(
command,
cwd=cwd,
env=env,
text=True,
capture_output=True,
check=False,
timeout=timeout,
)
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(subprocess-from-request)

🪛 Ruff (0.16.0)
scripts/test_inspect_antigravity_cli.py

[warning] 17-17: Boolean-typed positional argument in function definition

(FBT001)


[error] 27-27: subprocess call: check for execution of untrusted input

(S603)

scripts/inspect-antigravity-cli.py

[error] 106-106: subprocess call: check for execution of untrusted input

(S603)


[error] 141-141: Audit URL open for permitted schemes. Allowing use of file: or custom schemes is often unexpected.

(S310)


[warning] 144-144: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 147-147: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 151-151: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 158-158: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 205-205: Use a list comprehension to create a transformed list

(PERF401)


[warning] 262-265: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 289-289: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 295-295: Avoid specifying long messages outside the exception class

(TRY003)

🪛 zizmor (1.28.0)
.github/workflows/inspect-antigravity-cli.yml

[info] 19-19: workflow or action definition without a name (anonymous-definition): this job

(anonymous-definition)


[warning] 3-13: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting

(concurrency-limits)

🔇 Additional comments (8)
scripts/inspect-antigravity-cli.py (1)

268-313: 🔒 Security & Privacy

No change needed. The workflow runs inspect-antigravity-cli.py on an isolated GitHub Actions runner with permissions: contents: read, persist-credentials: false, no repository environment/secrets exposure shown, and outputs written to the runner’s temporary directory.

third_party/antigravity-cli-inspection.md (1)

1-140: LGTM!

third_party/README.md (1)

30-31: LGTM!

third_party/optional-agents.md (1)

18-48: LGTM!

.github/workflows/inspect-antigravity-cli.yml (2)

15-16: LGTM!

Also applies to: 20-22, 37-93, 94-133, 138-158


134-137: 🗄️ Data Integrity & Integration

No change needed. The committed binary version matches the installed binary’s --version stdout shape.

Makefile (1)

17-28: LGTM!

.github/workflows/build-amd64.yml (1)

34-38: LGTM!

Also applies to: 54-54, 70-71

Comment thread .github/workflows/inspect-antigravity-cli.yml
Comment thread scripts/fixtures/antigravity-install.sh Outdated
Comment thread scripts/inspect-antigravity-cli.py Outdated
Comment thread scripts/inspect-antigravity-cli.py Outdated
Comment thread scripts/inspect-antigravity-cli.py Outdated
Comment thread scripts/inspect-antigravity-cli.py
Comment thread scripts/inspect-antigravity-cli.py Outdated
Comment thread scripts/test_inspect_antigravity_cli.py Outdated

@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: a18a21507a

ℹ️ 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/inspect-antigravity-cli.py

Copy link
Copy Markdown
Owner Author

@codex review

Please review the current head after all prior security findings were addressed. Focus on pre-execution digest verification, redirect rejection, vendor-output normalization, help-side-effect aborts, metadata upload gating, path redaction and the committed/live evidence comparison.

Copy link
Copy Markdown
Owner Author

@codex review

Final pass on current head: both the installer and downloaded agy payload are now digest-approved before execution, redirects are origin-checked before reading, subprocess decoding/timeouts are bounded, and live installer runs are serialized. Please report only still-actionable security or correctness issues.

@eXPerience83
eXPerience83 merged commit e431197 into main Aug 2, 2026
3 checks passed

@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: 8e1bd22bfd

ℹ️ 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".

for stage in ("after_first", "after_second"):
if not report["profiles"][f"unchanged_{stage}"]:
errors.append(f"shell profiles changed {stage.replace('_', ' ')}")
binary = report["binary_after_second"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate the first binary inspection

When a freshly installed agy returns a failing --version or --help result but a later invocation succeeds—for example after transient initialization—this validator examines only binary_after_second; the workflow similarly selects only that result at .github/workflows/inspect-antigravity-cli.yml:168. The fresh evidence on the current head is that binary_after_first is recorded but only its SHA-256 participates in validation, so the report can have no blocking findings despite the first executable checks failing; validate both inspection results.

Useful? React with 👍 / 👎.

text=True,
encoding="utf-8",
errors="replace",
capture_output=True,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Cap captured vendor-process output

When the installer or CLI emits output rapidly, capture_output=True accumulates all stdout and stderr in memory; the 30–300 second timeout limits elapsed time but not output size, so a vendor-process error or runaway output can exhaust the runner before a status or report is produced. Stream into size-capped buffers or terminate the process once a fixed output limit is reached.

AGENTS.md reference: AGENTS.md:L24-L24

Useful? React with 👍 / 👎.

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.

legal: complete third-party notices and optional-agent distribution policy

1 participant