Skip to content

security(agents): harden Antigravity hook policy boundary - #1807

Merged
groupthinking merged 3 commits into
mainfrom
copilot/make-antigravity-hooks-tamper-resistant
Sep 12, 2026
Merged

security(agents): harden Antigravity hook policy boundary#1807
groupthinking merged 3 commits into
mainfrom
copilot/make-antigravity-hooks-tamper-resistant

Conversation

Copilot AI commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Canonical issue

Handled by canonical issue automation.

Outcome

Antigravity executions can now attest that hook policy lives outside the agent-writable sandbox boundary. Receipts capture the mounted policy identity and the result of a controlled tamper attempt without treating hook timeout/error as a denial.

Scope

  • Included:
    • Read-only hook policy source: add AntigravityHookPolicy so managed runs can mount hook config from a dedicated remote source instead of writable sandbox state
    • Live-use gate: require a configured read-only hook policy source before any live Antigravity execution is allowed
    • Receipt evidence: record hook source identity, mounted path, policy result, tamper-probe target/result/reason, and fail-open behavior in receipt.policy
    • Tamper probe wiring: inject a controlled hook/config modification probe into the managed task input so conformance runs can record denial behavior
    • Regression coverage: add focused tests for source mounting, live gate enforcement, denial receipts, and timeout-as-allow semantics
  • Explicitly excluded:
    • Provider calls, environment creation, mount changes, billing actions, deployment, or production mutations
    • Changes to Agent Factory’s existing MCP allowlist / approval model beyond preserving it as the primary control

Risk

  • Risk level: medium
  • Failure mode:
    • Live managed runs stay blocked if hook policy is not configured
    • Receipts may report hook policy as unverified when providers omit policy telemetry
  • Rollback:
    • Revert /home/runner/work/EventRelay/EventRelay/src/youtube_extension/services/agents/antigravity_backend.py
    • Revert /home/runner/work/EventRelay/EventRelay/tests/unit/test_antigravity_backend.py

Verification

List exact automated and manual checks, tied to the current head SHA.

  • Head SHA: 59edb02
  • Automated:
    • python3 -m pytest --no-cov tests/unit/test_antigravity_backend.py -q
    • python3 -m ruff check src/youtube_extension/services/agents/antigravity_backend.py tests/unit/test_antigravity_backend.py
    • runtime-tools-secret_scanning on changed files
  • Manual:
    • Built a sample Antigravity payload and verified it mounts hook policy via environment.sources and targets /workspace/hook-policy/.agents/hooks.json
AntigravityBackendConfig(
    allow_live_execution=True,
    acknowledge_fail_open_hooks=True,
    hook_policy=AntigravityHookPolicy(
        source_type="repository",
        source="https://github.com/groupthinking/antigravity-hook-policy",
        target="/workspace/hook-policy",
        identity="git:demo-sha",
    ),
)
  • Focused tests
  • Required CI
  • Review threads resolved

Production evidence

Not applicable. This change only hardens configuration and receipt semantics for future managed runs; no live provider call or production mutation was performed.

Agent handoff

  • One canonical issue is linked
  • No competing PR implements the same issue
  • Acceptance criteria are satisfied
  • Required checks pass on the current head
  • Human decision is requested only for product, security, irreversible infrastructure, or production approval

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
v0-uvai Ready Ready Preview, v0 Sep 12, 2026 9:32am UTC

Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot AI changed the title [WIP] Make Antigravity hooks tamper-resistant security(agents): harden Antigravity hook policy boundary Sep 8, 2026
Copilot AI requested a review from groupthinking September 8, 2026 23:35

Copy link
Copy Markdown
Owner

Security acceptance review — 2026-09-09 — TEST / live blocked

Reviewed implementation at 59edb024f6d386753db28c61be5cbc00601773a6 against #1659. The fixture is useful, but “acceptance criteria satisfied” is not yet supported by enforcement evidence.

Observed code gaps:

  • to_environment_source serializes type/source/target, while the receipt asserts read_only_source_mount without verifying mount enforcement or immutable source identity.
  • config_relative_path and probe prefix validation accept .. traversal; normalize paths and prove containment before building hook/probe locations.
  • A model/provider-shaped policy_result claiming “denied” becomes counts_as_denial without independently authenticated enforcement evidence.
  • Presence of a hook_policy object opens this new live prerequisite; object presence alone does not prove read-only policy discovery or tamper resistance.

Google hook documentation, updated September 4 and retrieved September 9, distinguishes configuration discovery from enforcement; errors/timeouts allow execution and hooks do not cover custom functions/MCP. These restrictions remain independent of the fixture passing.

Required next tests: reject escaping paths; prove provider-recognized config location and immutable source revision; mark mount/probe outcomes UNVERIFIED unless backed by trusted enforcement evidence; fail live validation when that evidence is missing. Retain external MCP/network policy enforcement. Do not infer that this comment verifies a specific provider mount API.

State: high-priority security review remains open; no live test approved or run. Existing-head CI is action_required, not passed. Estimated next repair/review: 0.5–1 engineering day.

@groupthinking
groupthinking marked this pull request as ready for review September 12, 2026 09:31
@groupthinking
groupthinking merged commit 97f6a64 into main Sep 12, 2026
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9261a6ad-fafb-46e9-8ad1-290659233366

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@groupthinking
groupthinking deleted the copilot/make-antigravity-hooks-tamper-resistant branch September 12, 2026 09:31
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 57ba635.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Validation

⚠️ PR title should follow conventional commits format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security(agents): make Antigravity hooks tamper-resistant

2 participants