Govern
Documentation

Version Latest

Govern Gemini CLI

Apply Neural Inverse Govern agent policy to Gemini CLI through its system overrides file, why the hook is advisory, and how Gemini CLI activity is monitored.

Control level

WhatLevel
Kinds the policy denies outrightManaged configuration: removed with tools.exclude in the system overrides file
Other actionsAdvisory hook: a developer can disable it
Model trafficNot routable: the gateway does not serve Google's native Gemini API
ActivityMonitored through OpenTelemetry events to vendor audit

Gemini CLI 0.64.0 was run for real with the compiled settings and the real endpoint agent: a denied rm -rf was refused (in YOLO mode too) and an allowed ls ran. The same deny was bypassed when the developer listed the hook in hooksConfig.disabled. That is why Gemini CLI is not Enforced.

1. Write the policy and enrol the machine

Write rules in Agent policy (Agent policy) and enrol the machine with the endpoint agent (Deploy). The agent fetches the policy compiled for the gemini-cli engine and installs settings.json as Gemini CLI's system overrides file:

OSLocation
Linux/etc/gemini-cli
macOS/Library/Application Support/GeminiCli
WindowsC:\ProgramData\gemini-cli

The file sets hooks.BeforeTool running Govern's enforcement hook on every tool, hooksConfig.enabled, and tools.exclude for each kind the policy denies outright.

2. What a developer can bypass

  • hooksConfig.disabled is merged from user settings, so a developer can disable the hook by name.
  • Hooks do not run in folders the developer has not trusted.
  • GEMINI_CLI_SYSTEM_SETTINGS_PATH can point to another file.
  • Gemini CLI lets a call run on a timeout or on any exit status but 0 and 2; the compiled command turns other failures into exit 2.
  • Hooks answer only allow or deny, so an ask rule becomes a deny.

What tools.exclude removes stays removed: that is the managed configuration part. Check the gaps on Agent policy > Policy preview with the engine gemini-cli.

Monitoring

Gemini CLI can push OpenTelemetry events to Govern's vendor audit receiver; see Evidence.

Last reviewed 17 October 2026View as Markdown

Govern Gemini CLI · Docs · Neural Inverse