Repository navigation
Description
Summary
Antigravity CLI 1.0.0 has no equivalent to Gemini CLI's --approval-mode plan for
non-interactive (-p / --print) runs. In -p mode, agy auto-approves all tool
calls — including write_file — which makes it unsafe for scripted automation that
processes untrusted input (e.g. agent-wrappers that pipe a plan/document through
Gemini and expect text-only critique back).
Filing as a separate request from #40 (interactive /plan slash command + quota
switcher) and #36 (--sandbox + --dangerously-skip-permissions bypass bug),
because the affected surface — the -p flag for scripts/CI — is different.
Use case
Many CI / automation / agent-wrapper workflows look like this:
<some-cli> -p '<adversarial-review-prompt>' < untrusted_plan.md
Today on Gemini CLI we run:
gemini -m gemini-3.1-pro-preview --approval-mode plan -o text -p '<prompt>'
--approval-mode plan was the safety floor: even if the input contained prompt
injection telling the model to write or delete files, the CLI refused write/exec
tool calls at the permission layer. Read tools stayed available so the model
could still verify the input against the actual codebase. We can't migrate this
flow to agy because that flag is gone and no equivalent exists.
Reproduction (~5 min)
Compare what happens when each CLI is told to write a file:
PROMPT='Use your file-writing tool to create /tmp/probe.txt with contents WROTE. After attempting, state whether the system blocked it.'
# Old gemini CLI:
gemini -m gemini-3.1-pro-preview --approval-mode plan -o text -p "$PROMPT"
# → Tool call DENIED at CLI layer:
# "Access denied: plan path must be within designated plans directory"
# → File is NOT created.
# New agy, default mode:
agy -p "$PROMPT" --print-timeout 90s
# → Write succeeds. Model says verbatim:
# "system did not block the tool call, and I did not refuse"
# → File IS created.
# New agy with --sandbox:
agy -p "$PROMPT" --sandbox --print-timeout 90s
# → Write ALSO succeeds. --sandbox only restricts terminal/shell tools,
# not write_file.
# → File IS created.What we'd like
A flag with the same semantics as Gemini CLI's --approval-mode plan:
- In
-p(non-interactive) mode, all side-effecting tool calls
(write_file,edit_file, shell exec, network writes) are denied
at the CLI permission layer — not just discouraged via the prompt. - Read tools (
read_file,grep, etc.) stay available so the model
can still verify the user's input against actual repo state. - Could be exposed as
--approval-mode plan(preserves the old name
for migration simplicity), or--read-only, or--no-write.
Why existing flags don't cover it
| Flag | Why it doesn't work |
|---|---|
--sandbox |
Only restricts terminal/shell. write_file still executes (confirmed above; see also #36). |
--dangerously-skip-permissions |
Opposite direction — auto-approves everything. |
Default -p (no flag) |
Empirically auto-approves everything too, since there is no user to prompt. |
| Prompt-level "you are a reviewer, do not edit" | Defeated by prompt injection in the untrusted input the wrapper is meant to review. |
Related issues
- Port Core Feature Command Modes from Gemini CLI (/yolo, /plan, /rewind, /compact) & Separate Quotas #40 — interactive slash-command modes (
/plan,/yolo,/rewind). Related but interactive, not the-pflag. - Agent can bypass sandbox when combining
--sandboxwith--dangerously-skip-permissions#36 — bypass when combining--sandboxwith--dangerously-skip-permissions. Adjacent bug confirming--sandboxis not a security boundary. - Feature request: Add a
--modelcommand line parameter #35 —--modelflag request (separate gap also affecting scripted/non-interactive use).
Environment
agy --version→ 1.0.0- OS: macOS arm64
- Migration context: Gemini CLI sunset June 18, 2026 (per Transitioning Gemini CLI to Antigravity CLI). The absence of this flag currently blocks migrating wrapper scripts/agents that need a non-interactive read-only guarantee.
Thanks for the v1 release — looking forward to a fix here so we can complete migration before sunset.
Activity
zwalden commentedon May 29, 2026
It's also missing the -m flag designation for model specification, which is a glaring oversight.. Can y'all give some insight here? Are there environmentals we can set in the interim or ?
HakAl commentedon May 30, 2026
+1
For non-interactive permission control. One extension: alongside pure read-only/plan-mode, an allowlist mode would cover bounded-worker use cases — deny-by-default but permit a named set of tools (specific MCP tools + scoped file writes), the analog of Claude Code's --permission-mode dontAsk + permissions.allow. Our workers need to call a few specific tools and write within their sandbox, so read-only is too strict but --dangerously-skip-permissions is far too loose. A declarative allowlist is the missing middle.
tiagodocouto commentedon Jun 15, 2026
no feedbacks on this?
this is a real security concern that has to be mitigated somehow
fmv1992 commentedon Jun 19, 2026
This bug is so amateur...
--printbypasses all the hooks and restrictions.... "That's AGI coming right at you" C level speech.</rant>.Isolate unsandboxable providers from the repo cwd in `scry plan` (#21)
feat(runs): add ephemeral_review lifecycle so agy can review via a di…