Skip to the content

Govern Cursor, Copilot CLI, Devin, Cline and others

Install your agent's policy pack in audit mode, put AgentGarm's hooks where that agent reads them, and read what its hooks cannot do.

Built, not yet claimed preview: this guide describes a package that has not passed its release gate.

Find your agent on the coverage page, install its policy pack in audit mode, put AgentGarm's hooks where that agent reads them, let agentgarmd keep them there, start the agent through the launcher where it is a command-line tool, and read what its hooks cannot do.

1. Find your agent on the coverage page

The coverage page has a row for every agent AgentGarm has a hook adapter for: Cursor, GitHub Copilot CLI, Devin CLI and Devin Desktop (formerly Windsurf), Factory Droid, Gemini CLI, Amp, OpenCode v1 and v2, Cline (CLI and extension) and Antigravity, besides Claude Code and Codex. Each row says where the hooks live (managed hooks, a system file or a user file) and which version the adapter was verified against. The adapters for these agents are built but not yet claimed, so the page states no level for them. An agent with no row has no adapter: govern it with agentgarm wrap instead.

See also

Govern an agent with no hooks

Run an agent AgentGarm has no hook adapter for inside the same sandbox and proxy, and know which of your policy's rules that leaves unenforced.

2. Install the agent's pack in audit mode

agentgarm policy init takes the pack names cursor, copilot-cli, devin-cli, devin-desktop, factory-droid, gemini-cli, amp, opencode (both OpenCode lines), cline (both Cline surfaces) and antigravity-cli, as well as default, claude-code and codex; it has no windsurf alias. Every pack ships in mode: audit and is never written over an existing file unless you add --force. A root install (sudo agentgarmd install) writes every pack, readable by everyone, when its policy directory holds none yet; add a missing one with policy init and --dir, and --force restores a shipped pack you changed.

Besides the command and credential rules every pack has, each keeps the hook and plugin files AgentGarm relies on read-only to the agent's file tools, and its MCP configuration too where the agent does not rewrite that itself: Cline's ~/.cline/data, Amp's user settings.json and Cursor's cli-config.json stay writable. Restart agentgarmd to load the pack, and enforce it only after its blast radius on your own history is clear.

agentgarm policy init cursor
sudo agentgarm policy init copilot-cli --dir /etc/agentgarm/agents.d --force
schema: agentgarm.com/schemas/agents/v1
name: cursor
version: "1.1.0"
mode: audit
profile: interactive
on_internal_error: fail_open_alert

match:
  launcher: true
  binaries: [cursor-agent]
  process_tree_root: true
    read_only:
      - "~/.cursor/hooks.json"
      - "~/.cursor/mcp.json"
      - "~/.cursor/sandbox.json"
      - "~/.claude/settings.json"
      - "${WORKSPACE}/.cursor"
      - "${WORKSPACE}/.claude/settings.json"
      - "${WORKSPACE}/.claude/settings.local.json"
      - "${WORKSPACE}/.git/hooks"
      # User persistence: shell startup files, git's global configuration and per-user login
      # services. File tools are refused here; for agents launched through `agentgarm run` each is
      # also a sandbox write deny, and where an OS file sentinel runs it refuses any process's write.
      - "~/.bashrc"
      - "~/.zshrc"
      - "~/.profile"
      - "~/.bash_profile"
      - "~/.zprofile"
      - "~/.gitconfig"
      - "~/Library/LaunchAgents"
      - "~/.config/systemd/user"

Checked by the walk: these commands ran as written on a no-root Linux install and a root install on Linux.

See also

Watch your agent for a week, then enforce

Start a policy in audit mode, see what enforcing it would have blocked in your own history, fix the rules that get in the way, then switch it to enforce.

3. Install the agent's hooks

agentgarmd hooks install takes the adapter's name, which for some agents differs from the pack's: opencode-v1 or opencode-v2, cline (the CLI's plugin) or cline-hooks (the file hook both surfaces run), and antigravity; devin-desktop and its alias windsurf install the same entries as devin-cli, which Devin Local reads.

Cursor, Copilot CLI, Factory Droid, Gemini CLI and OpenCode take their hooks from a system file, so the install needs a root install. Copilot CLI gets a file of its own in its admin policy.d. Cursor's enterprise hooks.json (its failClosed following the pack's on_internal_error, so false for the shipped pack), Factory Droid's and Gemini CLI's system settings.json and OpenCode's system opencode.json are edited in place, keeping your organisation's own entries. For Factory Droid the install also sets allowManagedHooksOnly: true, and it is refused when no system settings.json exists unless you add --create-system-settings, because a new file makes Droid ignore the organisation's remote managed settings on that host. For Gemini CLI the install also writes agentgarm.toml into Gemini's admin policy directory, the deny rules of the policy agentgarmd enforces for Gemini projected into Gemini's own policy engine, and keeps it in step when that policy changes.

Devin, Amp, Cline and Antigravity read their hooks only from files in your home, such as ~/.config/devin/config.json or ~/.gemini/config/hooks.json. Those are written as you, never as root: add --user on a no-root install, or, on a root install, --for-user with your user name (other agents refuse it). Amp's and the Cline CLI's hooks are plugin modules that load AgentGarm's shim from beside the hook binary, so their install is refused while the shim is missing; the release carries it, and agentgarmd plugins install writes it where a package does not.

sudo agentgarmd hooks install cursor
sudo agentgarmd hooks install copilot-cli

Checked by the walk: these commands ran as written on a root install on Linux.

4. Let agentgarmd keep the hooks in place

Each install is recorded, and the running agentgarmd checks every recorded install every 500 ms. A deleted file or an edited AgentGarm entry (Cursor's failClosed changed, say) is written back and reported as a policy-source conflict, which also arrives as a “Policies conflict” notice; between the edit and the next check the agent can run with the edited file, which is one reason the hook layer is advisory. agentgarmd hooks remove takes the install off the record first, so a hook you remove on purpose is not put back.

sudo agentgarmd hooks status cursor
sudo agentgarmd hooks remove cursor

Checked by the walk: these commands ran as written on a root install on Linux.

See also

Get told when an agent is denied or asks

Follow each denial, approval ask and alert as it happens: in a terminal, as desktop notifications, or through your own Linux notifier.

5. Start command-line agents through agentgarm run

Hooks fail open for most of these agents, so what enforces is the launcher and its sandbox. agentgarm run picks the agent's pack from the command name for cursor-agent, copilot, devin, droid, gemini, amp, cline, agy (the antigravity-cli pack) and opencode, builds the sandbox from it, proves it with the canary and routes the agent through the proxy; any failure refuses the launch. Desktop agents such as Devin Desktop and the Cursor IDE are not started this way, so for them only the hooks apply, and on a Mac the airbag's host rule unlaunched preview, off by default, is what reaches the input they post (C).

agentgarm run -- cursor-agent

See also

Limit what an agent can read, write and reach

Decide which files an agent may read and write and which hosts it may reach, know which layer holds each rule, and recognise a denial.

6. Read what the agent's hooks cannot do

These adapters are built but not yet claimed: until a live, recorded run of the real agent on macOS and Linux, none is rated above C (observed). The coverage page lists an agent's gaps only once its adapter is claimed, so read them from the adapter itself. agentgarmd hooks status prints them, and so does agentgarm status for an agent installed, seen in a task or given a policy (agentgarm status --all for every adapter): under each agent's coverage line, which gives its hook tier and whether the managed hooks are in force, a cannot: line for each thing its hooks cannot do. The dashboard's Agents screen shows the same, with each agent's gaps when you open it.

agentgarm status

Checked by the walk: this command ran as written on a no-root Linux install.

See also

Check that protection is on

See whether AgentGarm's services are up, what assurance level each agent session has and why, and what to do about a bypass alert.