GrepBoard/Manuals
605 manuals ·

Fix Gemini CLI "Untrusted Command Flags Detected" in YOLO

·Tested on Gemini CLI 0.65.0 (npm release checked only) · official repo issues and releases · 2026-10·Test scope ↓·4 steps

Gemini CLI --yolo stopping on "Untrusted Command Flags Detected" for git diff or ls is a false positive in 0.62-0.63. Upgrade to 0.65.0 or later.

output
⚠  ⚠️ CRITICAL SECURITY WARNING: Untrusted Command Flags Detected   The following flags/arguments were sourced from external untrusted input (e.g., Buganizer ticket, external document):     • .github/workflows/testhub.yml   Executing commands with flags sourced from untrusted input can execute arbitrary code on your machine.   Carefully verify these flags before approving.

It is a false positive in 0.62-0.63; upgrade to 0.65.0 or later. You run with auto-approval (--yolo) and the agent still stops at this warning (the block is the warning text from issue #29676; the middle line is the flagged argument). The official repository has a report of it firing on a read-only git diff .github/workflows/testhub.yml (#29676, 0.63.0) and another on ls -la, grep -rn, cat -n and git diff (#29579, 0.62.0). #29579 was closed by PR #29672, a fix for the false positives; #29676 was closed by its reporter, with no maintainer comment.

[1] Check your version first.

console
$ gemini --version

The reported builds are 0.62.0 and 0.63.0. Issue #29579 describes the check behind the warning (findUntrustedFlags) as running before YOLO mode is looked at, with no security.* setting or CLI flag to turn it off or tune it. That is why --yolo does not prevent the stop.

[2] Upgrade to a fixed build. From the official release list:

BuildItem
0.65.0 (Latest)"fix(core): eliminate false positives on untrusted command flags and compound loops" (#29672)
0.67.0 nightly 20261022"fix(core): scope untrusted flag checks to external output and remember approved flags" (#29833)

Issue #29579 was closed by PR #29672, and the npm latest tag was 0.65.0 when this was written (checked with npm view @google/gemini-cli version). Upgrade the way you installed it; for npm:

console
$ npm install -g @google/gemini-cli@latest$ gemini --version

If the install fails or login errors appear, see Gemini CLI install and login errors.

[3] If it still appears, read what the warning says: running a command whose flags come from untrusted input can execute arbitrary code. If the arguments were built from tool output or external file content, the risk can be real. Read the command in the prompt; approve it if it is the read-only command you asked for, otherwise deny it.

[4] Look for further reports. The nightly fix narrows the check to external output and remembers approved flags. If a stable build still halts, open an issue with the version, the one command that stopped, and the mode you set (--yolo or a settings file). Where mode and settings files overlap is in Gemini CLI settings.json layers.

If the stop is a quota error (429) rather than this warning, see Gemini CLI 429 "No capacity available".

#gemini-cli#yolo#security