Is my AI tool safe?Coding agentsGoogle
Is Gemini CLI safe?
No tool is safe or unsafe on its own: it depends on what it can reach and how it is set up. The record for Gemini CLI: 3 incidents in this center's library and 0 CVEs in its advisory feed. Below: what went wrong, what was fixed, and how to use it safely.
What to watch for
A README prompt injection ran hidden commands in 2025; in 2026 the headless mode trusted the workspace automatically and an allowlist entry acted as a wildcard (GHSA-wpqr-6v78-jr5g, CVSS 10.0, fixed in 0.39.1; no CVE was assigned, so it is not in the count). It was deprecated by the time Plugin4Shell was disclosed, so that flaw stays open.
How to use it safely
Do not run it headless on untrusted repositories, keep allowlists explicit, and plan a migration if you depend on it, since deprecated tools stop getting fixes.
What it can reach
- Reads attacker-controlled content
- Runs commands with your permissions
- Holds API keys and tokens
- Installs plugins, skills or tools from registries
What went wrong: incidents in the library
- Plugin4Shell: zero-click takeover of four coding agents through plugin pinning Critical
AIR found that Claude Code, Codex, GitHub Copilot and Gemini CLI checked out a pinned plugin commit without verifying they had landed on it, so a trusted plugin could be swapped for a malicious one and auto-installed with no… - Coding agents in GitHub Actions: one public issue to stolen CI secrets Critical
At Black Hat USA 2026, Novee Security showed that anyone able to open a GitHub issue could take over the official GitHub Actions setups for Claude Code, Gemini CLI and Codex. Hidden instructions in the issue made the agent run… - Gemini CLI: a README prompt injection runs hidden commands High
A booby-trapped README could make Google's Gemini CLI secretly run commands on a developer's computer and send their secrets out, combining prompt injection with a weak allowlist check and a misleading display.
How many people use it
- 438k npm downloads in a week (Sep 22 to 28, 2026) · npm download counts
- 107k GitHub stars · GitHub
A high CVE count can mean heavy scrutiny as much as weak engineering, so read the incidents and advisories, not only the number. The counts are what this center has recorded, not every flaw ever found; usage figures are the vendors' and registries' own published numbers.
Sources
- npm download counts: npm downloads in a week (Sep 22 to 28, 2026)
- GitHub: GitHub stars
- GitHub Advisory Database: @google/gemini-cli
- AIR: Plugin4Shell
- Help Net Security: Plugin4Shell AI coding agents vulnerability
- The Register: AI coding agents 0-click RCE flaw could hand attackers the keys to the kingdom
- Novee Security: critical flaws in Anthropic, Google and OpenAI's coding agents
- GitHub Advisory: Gemini CLI GHSA-wpqr-6v78-jr5g
- Anthropic: Claude Code advisory GHSA-fg94-h982-f3mm
- Tracebit: Gemini CLI hijack
- BleepingComputer: Gemini CLI flaw