
Argent for Gemini CLI
Gemini CLI calls are checked, redacted, priced and signed by Argent, with hooks on every tool action. Here is what Argent governs, how it connects and what your team sets.
What Argent does with Gemini CLI
Every call Gemini CLI makes to a model goes through Argent first. Argent knows which agent sent it and which person owns that agent, checks it against your policy, and writes a signed record of what it decided.
- A named agent with a human owner. Each install of Gemini CLI gets its own Argent agent identity tied to an accountable person, so no call is anonymous. Identity tethering
- Only the models you allow. The agent can reach only the providers and models your policy names, and a request can be swapped to an approved model. Model control
- Sensitive data handled before it leaves. Prompts and replies are scanned for personal and secret data, then redacted or blocked as your policy says. Sensitive data redaction
- Spend priced and capped. Every request is priced and metered against budgets for the agent, its owner and the teams above them. AI spend caps
- A signed record you can replay. Each decision becomes a hash-chained, signed audit record, and requests are grouped into sessions you can replay. Session replay
- Tool actions checked before they run. Shell commands, file reads and writes, web fetches, MCP calls and prompt submits ask Argent first; if Argent cannot answer, the action is refused. Agent permissions
How Gemini CLI connects
Gemini CLI reaches Argent in two ways.
- TLS-inspecting forward proxy. Gemini CLI keeps its normal provider settings and sends its HTTPS traffic through the Argent forward proxy and trusts your Argent certificate; the exact settings are below. The proxy signs in with the agent's own key, so every call is attributed, then runs the same checks as the gateway. It opens only known AI hosts, and its certificate is limited to those hosts.
- Tool hooks. Before Gemini CLI runs a tool or submits a prompt, its hook asks Argent for a decision and a data-loss scan. If Argent cannot answer, the hook refuses.
One command does the setup. argent connect gemini-cli registers a per-tool agent under the signed-in person, keeps its key only in the OS keychain, and writes the tool's own config with a backup. --revert puts the old config back. Keyless agents explains why keys stay out of config files.
A small loopback relay holds the agent key and adds it to each proxy connection, so the key is never written into the tool's settings.
Proven with the real tool. Argent's team has driven Gemini CLI itself through a live Argent gateway and checked the signed records it produced.
The same steps are in the Argent console under Integrations > AI Clients, and each agent's Connect tab gives the copy-paste values for your tenant.
What you configure
What your team sets in Gemini CLI. These are the settings the Argent console shows for this tool. Values in angle brackets come from your tenant.
- Sign in and connect.
argent login && argent connect gemini-cli. Writes ~/.gemini/settings.json: telemetry.enabled=true, telemetry.otlpEndpoint=<gateway>/_argent/otlp, telemetry.otlpProtocol=http, telemetry.logPrompts=false, hooks.BeforeTool/BeforeAgent/BeforeModel ->argent hook gemini-cli. - Route model traffic. Set HTTPS_PROXY=<Argent forward proxy as http:// URL or loopback relay> and NODE_EXTRA_CA_CERTS=<per-tenant intercept CA PEM> (or NODE_USE_SYSTEM_CA=1 after installing the CA in the OS store) in the environment of
gemini. Target host is generativelanguage.googleapis.com (API-key auth). - Gateway alternative. GOOGLE_GEMINI_BASE_URL=https://<argent-gateway>/... works with gemini-api-key auth (HTTPS required except localhost); GOOGLE_VERTEX_BASE_URL for vertex-ai auth. Use GEMINI_API_KEY with an Argent-issued key.
Roll it out to every machine
Make it the only way Gemini CLI runs on company machines. These controls are documented by the platform each one belongs to (linked); pair them with the Argent settings above.
- System settings override file (Linux). Highest-precedence settings file (system overrides win over user ~/.gemini/settings.json and project.gemini/settings.json for conflicting single values). Pin hooks, telemetry, security.auth.enforcedType, mcp.allowed, admin.mcp.enabled, security.allowedExtensions, tools.sandbox. Vendor docs
- Auth method lock in system settings. Require one auth method so users cannot switch to a personal Google login or free-tier key. Vendor docs
- Hooks pushed through the system file. Argent hooks (BeforeTool, BeforeModel) that ask Argent before tool and model actions. Vendor docs
Argent ships the push kit. For managed fleets the console produces per-MDM scripts (Jamf, Kandji, Intune-style, shell and PowerShell) with your tenant certificate and proxy address built in, plus a fleet setup script and certificate bundle. Your company CA can sign the Argent certificate, so managed machines already trust it.
Want to see which AI tools people already run before you push anything? Start with Shadow AI discovery in watch mode. Watch before you enforce
Check that it works
Send one request and look for the signed row. argent doctor gemini-cli, run gemini -p 'say OK', confirm the signed llm row for the gemini agent in the Argent console live stream.
Every request also appears on the live stream with the agent's name and owner, and in the session view. Session replay
Where to go next
Keep going. Pages that cover the same ground from another angle.
- Use case: Securing AI coding agents
- Goals: See all AI in your company, Data loss prevention, Budget and token spend, Model control and routing, Agent identity and ownership
- Capabilities: Keyless agents, Prompt injection defense, Response screening, One-click audit evidence
- Related integrations: Claude Code, OpenAI Codex CLI, GitHub Copilot CLI, Cursor Agent CLI
- All integrations: Browse every AI client, provider, vault and identity source
Want this running on your own use cases?
Book a demo