Skip to content

Feature request: read-only / plan-mode equivalent for non-interactive -p runs #45

Open

Description

@vladislawfox

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

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

  1. zwalden commented on May 29, 2026

    @zwalden

    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 ?

  2. HakAl commented on May 30, 2026

    @HakAl

    +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.

  3. tiagodocouto commented on Jun 15, 2026

    @tiagodocouto

    no feedbacks on this?
    this is a real security concern that has to be mitigated somehow

  4. fmv1992 commented on Jun 19, 2026

    @fmv1992

    This bug is so amateur... --print bypasses all the hooks and restrictions.... "That's AGI coming right at you" C level speech.
    </rant>.

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

Metadata

Metadata

Labels

comp:agent capabilitiesBackground Tasks & Subagents, Permissions, Sandboxfeature requestRequesting for new featuressubtype:macOSmacOS specific issues (e.g., /var symlink handling)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions