Lock the sign-in method, sandbox, tool and MCP allowlists, YOLO mode, and telemetry in Gemini CLI's system overrides file, which takes precedence over the other three settings files. Google says these controls prevent accidental misuse. A user with local administrator rights can still get around them.
When you need this
- You are rolling Gemini CLI out beyond a pilot group.
- Security wants to know which data terms apply to prompts and what the agent may run.
- Some engineers already sign in with personal accounts or unpaid API keys at work.
- Finance wants cost per engineer and per department.
Evaluation criteria
Pin the sign-in method
Which terms govern the code and prompts engineers send?
Look forSet security.auth.enforcedType in the system settings file. On a mismatch the CLI prompts users to switch, and non-interactive runs exit with an error. Code Assist Standard and Enterprise and Vertex AI run under the Google Cloud Platform Terms of Service. Unpaid API keys run under the Gemini API unpaid-services terms. Google stopped selling new Code Assist subscriptions on October 9, 2026, so teams without one pin Vertex AI or a paid API key.
Force the sandbox
What can a shell command the agent runs reach?
Look forSet tools.sandbox to docker, or to a hardened custom image, in system settings. Sandboxing is off unless configured, and when on it limits file system access to the project directory.
Allowlist tools and MCP servers
Which tools and servers can the model call?
Look forUse tools.core as an allowlist, with policy engine rules that allow, deny, or ask_user for specific tools and command prefixes. Set mcp.allowed with a canonical mcpServers definition for each approved server, because without mcp.allowed any server a user defines runs. Use includeTools to expose only the tools a third-party server needs.
Disable YOLO mode
Can an engineer skip confirmation for every tool call?
Look forSet security.disableYoloMode to true, which Google's enterprise guide calls highly recommended. Add security.disableAlwaysAllow to remove the always-allow option from confirmation dialogs.
Export telemetry without prompts
How will you see usage and cost per engineer?
Look forExport OpenTelemetry with telemetry.target set to gcp and logPrompts set to false, so usage reaches your Google Cloud project without prompt text.
Protect the settings path
Can a user point the CLI at a different settings file?
Look forSet GEMINI_CLI_SYSTEM_SETTINGS_PATH in a wrapper script or shell profile, and lock the file permissions on /etc/gemini-cli/settings.json on Linux, /Library/Application Support/GeminiCli/settings.json on macOS, or C:\ProgramData\gemini-cli\settings.json on Windows.
Questions to ask vendors
- Which sign-in method does each engineer use today, and could any of them fall back to an unpaid API key?
- Who approves a new MCP server or extension, and where is the approved list kept?
- Where does telemetry land, and have we confirmed logPrompts is off?
- How do we detect Gemini CLI calls billed to projects outside the one we manage?
- Who is told when an engineer reaches the daily request cap or spends unusually?
- Does the CLI start promptly behind your proxy? In October 2025 a DZ BANK engineer reported that Gemini CLI 0.9.0 blocked for about 2.5 minutes at startup while downloading ripgrep, holding up many colleagues.
Red flags
- System settings that define mcpServers but omit mcp.allowed, which leaves user-defined servers running.
- A blocklist of shell commands in place of an allowlist. Google marks excludeTools deprecated and less secure.
- Workspace sign-ins passing Admin console API controls you expected to block, as a Workspace Enterprise Plus administrator reported on GitHub in October 2025.
- Treating the settings file as a security boundary on machines where engineers hold administrator rights.
Products in this piece
Sources
- Official documentation
- 9
- Public source
- 2
- Gemini CLI docs: Enterprise configuration
- Gemini CLI docs: Configuration reference
- Gemini CLI docs: Authentication
- Gemini CLI docs: Terms and privacy
- Gemini CLI docs: Sandboxing
- Gemini CLI docs: Policy engine
- Gemini CLI docs: MCP servers
- Gemini CLI docs: Observability with OpenTelemetry
- Gemini Code Assist docs: Gemini Code Assist Standard and Enterprise subscriptions
- GitHub issue 12121: Workspace OAuth bypasses Admin console API controls (Oct 28, 2025)
- GitHub issue 11822: 2.5 minute startup delay behind a corporate proxy (Oct 23, 2025)