14 detected by the audit

At a glance

Critical 3  High 8  Medium 3

Severity reflects how directly a misconfiguration leads to credential theft, loss of production data or a supply-chain compromise. Audit check gives the Gemini Code Assist Security Audit checks that detect it; "manual" means review it by hand.

The misconfigurations

X1CriticalAudit check: I01, P11

Gemini CLI or run-gemini-cli running headless in CI on an old version, or with --yolo on outsider input.

Why it matters. Before 0.39.1, headless runs "automatically trusted workspace folders for the purpose of loading configuration and environment variables", and under --yolo ignored tool allowlists; workflows reviewing user-submitted pull requests were exposed (CVE-2026-12537, CVSS 3.1 10.0 by Google, 7.8 by NVD).

Fix. Update Gemini CLI to 0.39.1 and run-gemini-cli to 0.1.22, pin the action by SHA, and never run it with --yolo on outsider input.

X2CriticalAudit check: G03, P01, P08

Folder trust turned off, or every folder trusted without reading it.

Why it matters. A trusted folder's .gemini/settings.json, .env and MCP servers all load. An untrusted folder loads only four authentication variables and no MCP servers (Gemini CLI docs), so trust is what keeps a repository from configuring the agent.

Fix. Keep security.folderTrust.enabled on, and read .gemini/ and .env before trusting a folder.

X3HighAudit check: G06

Broad tools.allowed entries, such as the bare run_shell_command.

Why it matters. Tracebit hid instructions in a file presented as a licence, then used an allowed grep followed by a second command to send the user's environment variables to an attacker without a prompt; Google fixed it in 0.1.14 (Tracebit).

Fix. Allow only read-only commands, for example run_shell_command(git status).

X4HighAudit check: G02, G07

No sandbox (the default), or a permissive one.

Why it matters. "Sandboxing is disabled by default", and on macOS the default Seatbelt profile, permissive-open, confines writes but allows broad reads and network access (Gemini CLI docs).

Fix. Turn on tools.sandbox, use a strict- Seatbelt profile or a container on macOS, and keep sandboxNetworkAccess off.

X5HighAudit check: G04, C01, S01

YOLO mode: --yolo, a shell alias, or Code Assist's agentYoloMode.

Why it matters. YOLO mode approves every action, and Code Assist agent mode has its own geminicodeassist.agentYoloMode setting (Gemini CLI docs, Code Assist docs).

Fix. Set security.disableYoloMode, keep agentYoloMode off, and remove aliases.

X6HighAudit check: M04, P05

MCP servers with "trust": true.

Why it matters. trust makes Gemini CLI "bypass all tool call confirmations" for that server (Gemini CLI docs).

Fix. Remove "trust": true and keep confirmations on for every server.

X7HighAudit check: M02, P03

MCP servers that read content outsiders can write.

Why it matters. Fake Sentry error events carrying "fix" instructions hijacked coding agents through an MCP server (Agentjacking, The Hacker News).

Fix. Give these servers read-only scopes and read what they return before acting on it.

X8HighAudit check: P11

The Gemini CLI Action running on issue and pull request text from outsiders.

Why it matters. Researchers hid instructions in issue titles, bodies and comments that made the Gemini CLI Action post its GEMINI_API_KEY in a public comment (Comment and Control).

Fix. Run the action only on input from trusted contributors, without --yolo, and with only the secrets it needs.

X9CriticalAudit check: W01, W02

On Windows, C:\ProgramData\gemini-cli missing or writable by standard users.

Why it matters. Cymulate showed a standard user creating the folder and planting a system-defaults.json with a session-start hook that runs for every user; Google said it would be "addressed as a documentation update" (Cymulate).

Fix. Create the folder as an administrator before deploying Gemini CLI, remove write access for Users, and alert on changes to it.

X10HighAudit check: G09, E01, E02

Extensions installed from Git without restrictions.

Why it matters. Extensions bundle MCP servers, hooks and context files. AIR Security showed a Gemini CLI extension pinned to a commit being swapped for different code, and reported no fix for Gemini CLI (Plugin4Shell).

Fix. Set security.allowedExtensions or blockGitExtensions, and review each extension's manifest.

X11HighAudit check: P09, P10

Context files merged without review.

Why it matters. GEMINI.md and AGENTS.md are loaded as instructions (Gemini CLI docs), and hidden Unicode can keep injected instructions out of a reviewer's sight (Pillar Security).

Fix. Put context files under CODEOWNERS and add a pre-commit check for hidden Unicode.

X12MediumAudit check: R01

No policy rules, or allow rules for any shell command.

Why it matters. The highest-priority matching policy rule decides each call, and an allow rule runs matching calls without asking (Gemini CLI docs).

Fix. Deny destructive commands, ask before pushes and network commands, and never allow run_shell_command without a narrow prefix.

X13MediumAudit check: H01, P06, P07

Hooks that download code, or hooks from someone else.

Why it matters. Hooks run commands with your privileges on events such as SessionStart and BeforeTool (Gemini CLI docs).

Fix. Read every hook, including those extensions and projects add, and remove any that download code.

X14MediumAudit check: P13, P14

Opening repositories with disguised symlinks or their own .git/config.

Why it matters. Adversa showed approval prompts in coding agents displaying a harmless link name while the write landed on the real target (SymJack). Git settings such as core.fsmonitor run programs during ordinary git commands.

Fix. List links and their targets, and re-clone repositories that arrived as archives or folders.

Fix order

Work through them in this sequence, finishing each step before starting the next:

  1. Stop the worst exposure: X1, X2, X9. Update Gemini CLI and the GitHub Action, keep folder trust on, and lock the Windows ProgramData folder.
  2. Contain the agent: X3, X4, X5, X6, X12. Narrow allowed tools, turn the sandbox on, disable YOLO mode, remove trusted MCP servers, and add policy rules.
  3. Govern extensions and repositories: X7, X8, X10, X11, X13. Vet MCP servers, workflows, extensions, context files and hooks before trusting them.
  4. Close the rest: X14. Check links and git settings, then re-run the audit against your new baseline.

Sources

Informational only, with no guarantee of a vulnerability-free setup, so test every configuration in your own environment. AISecurityLabs.org is independent and not affiliated with Google.