Skip to content

feat: add autonomous approval mode for Antigravity #159

Description

@eXPerience83

Summary

Add a first-class Antigravity approval mode that matches the existing Remote Dev Codex UX: a managed autonomous|guarded launch policy, defaulting to autonomous, while preserving the hardened outer-container and project/Git boundaries.

The implementation must remain launch-scoped where the upstream CLI permits it. Remote Dev must not weaken Docker/TrueNAS isolation, enable the unusable nested Antigravity sandbox, or take ownership of unrelated vendor settings.

Dependency status

Implementation gates are satisfied:

Security boundary

Autonomous approval changes only Antigravity's in-agent confirmation behavior inside resources already exposed to its role container.

Keep unchanged:

Approval prompts are not an isolation boundary. The supported security boundary remains the hardened outer role container plus the completed project/Git boundary.

Nested sandbox baseline

Controlled TrueNAS validation already established that the Antigravity terminal sandbox is not usable under the supported hardened profile without weakening the outer container. #215 records that evidence.

Therefore #159 must not:

  • add --sandbox automatically;
  • enable or persist enableTerminalSandbox;
  • depend on toolPermission=proceed-in-sandbox;
  • persist sandbox-bypass authorization;
  • add privileged, SYS_ADMIN, unconfined profiles, host namespaces or similar relaxations.

2026-09-10 live Antigravity 1.1.28 validation

All approval-mode research below was performed on the real hardened TrueNAS Antigravity role using Antigravity CLI 1.1.28, without changing the container image/hardening.

Baseline guarded behavior

A normal managed launch prompted even for harmless shell work such as pwd.

toolPermission=always-proceed

With only toolPermission=always-proceed, Bash/Create/Read/Edit operations completed without prompts.

Adding --mode=accept-edits did not provide additional approval autonomy; it only changed the vendor execution-mode indicator. Therefore #159 does not need to manage agentMode or force --mode=accept-edits.

Artifact review

With toolPermission=always-proceed and the default artifact policy, a plan artifact still paused for review.

Adding artifactReviewPolicy=always-proceed removed that pause.

--dangerously-skip-permissions

The documented launch-scoped flag --dangerously-skip-permissions was then tested directly:

  • harmless Bash/Git/Create/Read/Edit completed without prompts;
  • a --mode=plan workflow created its plan/artifacts and continued through implementation without a review stop;
  • the flag did not enable the vendor sandbox;
  • the flag did not persist toolPermission, artifactReviewPolicy or agentMode;
  • a user-configured fine-grained permissions.deny rule still blocked the denied command;
  • explicit persistent toolPermission=request-review + artifactReviewPolicy=asks-for-review still became autonomous for that launch when the flag was present;
  • a later launch without the flag immediately returned to guarded prompting.

Start / Continue / return to guarded

Using a disposable project and sibling canary:

  1. Start with --dangerously-skip-permissions completed shell/file/Git work without prompts.
  2. --continue with the same flag resumed the same conversation and continued without prompts.
  3. A later launch without the flag prompted again for pwd.
  4. No approval state remained persisted.
  5. The sibling canary remained unchanged.

This establishes the reviewed Antigravity 1.1.28 mapping for Remote Dev.

Chosen launch-policy architecture

Use the same Remote Dev abstraction as Codex while keeping provider-specific mechanics separate:

REMOTE_DEV_ANTIGRAVITY_APPROVAL_MODE=autonomous|guarded

Default: autonomous, matching the current Codex wrapper.

Autonomous

Remote Dev owns and injects exactly the reviewed vendor approval bypass:

--dangerously-skip-permissions

Do not also force --mode=accept-edits, --mode=plan, --sandbox, toolPermission, artifactReviewPolicy or agentMode.

Guarded

Do not inject the bypass. Use normal vendor review semantics.

Remote Dev must not silently rewrite the user's full vendor settings merely to enforce guarded mode.

If persistent vendor approval configuration makes guarded semantics impossible to guarantee, the launch must fail closed with a clear diagnostic instead of pretending to be guarded.

Provider-policy diagnostics and repair

Add a bounded, offline Antigravity policy inspection/repair path.

Diagnostics

Doctor/status may inspect only the minimum non-secret approval keys needed to determine whether guarded mode is compatible. It must not print OAuth/session data, arbitrary settings, project contents or permission-rule contents.

Expected health outcomes include:

Antigravity guarded compatibility: OK

or a clear conflict such as a persistent toolPermission=always-proceed / incompatible artifact-review policy.

Normal menu/status must remain lightweight and must not execute the vendor CLI, contact the network, or replace #153 full integrity verification.

Explicit repair

Provide an explicit repair action/command for known guarded conflicts.

Repair must:

  • never run automatically during launch or Doctor;
  • operate only on the canonical Antigravity-private settings.json;
  • reject symlinks, non-regular files, malformed JSON and unsafe ownership/type states;
  • remove/reset only the reviewed top-level approval keys that conflict with guarded behavior;
  • preserve unrelated and unknown vendor settings in meaning;
  • preserve fine-grained permissions.allow/ask/deny untouched;
  • use an atomic same-directory write with restrictive permissions;
  • never print secrets or duplicate the whole settings file into a broad backup;
  • fail closed on unknown approval semantics rather than guessing.

This is aligned with the common Remote Dev principle for current/future agents: launch policy is managed by Remote Dev; persistent provider configuration remains provider/user-owned unless an explicit bounded repair is requested.

Codex does not require the same repair mechanism because its current wrapper already applies an authoritative launch-scoped approval/trust policy and rejects conflicting policy arguments/config overrides. Future agent integrations such as Claude Code should follow the same abstraction, not mechanically copy one provider's config format.

Wrapper ownership and UX

run-antigravity should mirror the current Codex policy resolver where the provider contract permits:

  • accepted modes: autonomous|guarded;
  • default: autonomous;
  • deployment env: REMOTE_DEV_ANTIGRAVITY_APPROVAL_MODE;
  • optional per-launch --approval-mode autonomous|guarded;
  • --print-policy for local/offline effective-policy reporting;
  • wrapper owns/rejects direct user attempts to pass --dangerously-skip-permissions and any reviewed argument that would contradict the managed approval mode;
  • Start and Continue use the same resolver;
  • one-launch menu override is consumed once and then resets to the configured deployment mode.

The Antigravity menu slot currently marked Launch/approval options [not available] should become the reviewed approval-mode UI analogous to Codex.

Guarded compatibility contract

Guarded compatibility should be evaluated only from the minimum reviewed persistent approval keys.

Safe/default guarded states include absent vendor defaults and the documented request/review values.

Known autonomous or otherwise incompatible values must block a managed guarded launch until the user either changes the vendor configuration or invokes the explicit repair tool.

Fine-grained user permission rules remain user-owned. Explicit deny continues to be honored in autonomous mode based on the validated 1.1.28 behavior.

Malformed/unknown approval semantics relevant to the guarded guarantee must fail closed.

Tests

Add deterministic synthetic coverage for at least:

  • accepted/rejected approval-mode values;
  • default autonomous;
  • deployment env and per-launch override precedence;
  • --print-policy remains offline/lightweight;
  • autonomous argv contains exactly the managed --dangerously-skip-permissions approval bypass;
  • guarded argv does not contain it;
  • direct user bypass/policy overrides are rejected;
  • Start and Continue share the same resolver;
  • one-launch menu override is consumed once;
  • guarded compatibility detection for absent/default/request-review settings;
  • guarded conflict detection for known incompatible values;
  • malformed/symlink/non-regular settings fail closed where required;
  • explicit repair changes only reviewed conflicting top-level approval keys;
  • unrelated/unknown settings and fine-grained permission rules are preserved;
  • no automatic settings mutation during launch/status/Doctor;
  • no --mode=accept-edits or --sandbox is injected;
  • perf: benchmark and split Antigravity launch integrity verification #153 status/verify behavior remains unchanged;
  • P0 data loss: enforce project-collection Git boundary for Codex and Antigravity #213 project/Git boundary remains unchanged;
  • Compose hardening/mount topology remains unchanged;
  • no network/update merely to resolve/display approval mode.

Use synthetic credentials/state only; CI must not require a Google account.

TrueNAS acceptance

After CI/review, validate one exact candidate/image on TrueNAS:

  1. verify exact source/image/runtime identity;
  2. confirm security: harden outer containers and add cross-service isolation canaries #42 hardening and P0 data loss: enforce project-collection Git boundary for Codex and Antigravity #213 boundary remain effective;
  3. confirm configured/default autonomous mode is reported correctly;
  4. Start Antigravity in a disposable project and confirm harmless shell/file/test/Git work runs without prompts;
  5. Continue latest conversation and confirm the same effective autonomous mode;
  6. use a one-launch guarded override and confirm prompts return;
  7. introduce a synthetic known persistent guarded conflict, confirm diagnostics detect it and managed guarded launch fails closed;
  8. invoke explicit repair, confirm only reviewed approval keys are repaired and unrelated settings remain unchanged;
  9. confirm autonomous still respects an explicit fine-grained deny rule;
  10. confirm no sandbox/bypass persistence or outer-container weakening;
  11. confirm real launch still performs mandatory perf: benchmark and split Antigravity launch integrity verification #153 verification while ordinary menu/status remains lightweight;
  12. confirm sibling canaries remain untouched.

Out of scope

Relationships

Current implementation direction

Proceed with the launch-scoped 1.1.28 mapping proven above:

autonomous -> managed --dangerously-skip-permissions
guarded    -> normal vendor review semantics, with fail-closed compatibility check

Add offline diagnostics plus explicit bounded repair for persistent guarded conflicts. Do not persist Remote Dev-owned approval defaults into the vendor settings file.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions