Stop Cursor’s agent from running something risky, no Enterprise plan needed
See, control, and price every tool call Cursor's Composer makes (file edits, Bash, MCP, and the model calls behind them) from one dashboard. No Enterprise plan, no code changes.
Cursor’s native audit log is on the Enterprise plan. Agentic Control Plane (ACP) adds an identity-attributed audit log and a policy check to any Cursor tier (free, Pro or Team) through Cursor’s own hook API for the Composer agent. Every Composer tool call (file edits, Bash commands, MCP tool calls) is logged, and your rules can block it.
Related: What is an MCP Control Plane? covers the overview that this install guide applies to Cursor.
Install
curl -sf https://agenticcontrolplane.com/install.sh | bash
irm https://agenticcontrolplane.com/install.ps1 | iex
Three things you get the moment it's running — click any to see it full-size:
rm -rf on home or system folders always blocked; force-push, destructive SQL, and curl | sh held for your OK. Enforced at the call, outside the model.See your first governed call →Free up to 5 agents · full install below
The script detects Cursor (a ~/.cursor directory, or cursor on your PATH), writes ~/.acp/govern.mjs, and registers it in ~/.cursor/hooks.json for both preToolUse and postToolUse. Restart Cursor and every Composer tool call goes through the check.
By default the installer opens your browser to create a workspace and sends decisions to the ACP API. Every Composer tool call then lands in one activity log, with the cost X-ray beside it, free up to 5 agents. You change policy in one place and you get a record you can read.
Prefer fully on-device? Add --local: no browser, no account, nothing leaves your machine. ~/.acp/decide.mjs makes the decisions from ~/.acp/policy.json (allow, ask or deny per tool, plus an always-on safety floor), and every call is logged to ~/.acp/audit.jsonl. The trade is that the log stays on that machine, with no shared activity view and no cost X-ray. Re-run without --local any time to upgrade.
How it works
Cursor’s hook system is close to Claude Code’s, with lowercase event names. ACP installs the same govern.mjs script for both, and the script handles either event shape.
- preToolUse fires before a tool runs. The script POSTs to
/govern/tool-useand returns a deny to block the call. - postToolUse fires after the tool returns. The script POSTs to
/govern/tool-output, writes an audit entry, and surfaces PII and secret findings.
Cursor’s hook API is newer than Claude Code’s, and a few quirks are listed under Limitations.
What happens to an ask on Cursor
Cursor does not enforce an ask from a hook. Its documentation says ask is accepted by the schema but not enforced for preToolUse. So ACP does not rely on it:
- Workspace mode (the default): a held call, such as a force-push, is blocked and the reason shows in Cursor. You approve it on the console Approvals page or from the approval email, then retry.
--localmode: anaskrule is not enforced by Cursor, so the call may simply run. Use deny for anything you must stop.
Only Claude Code shows a hold as a prompt inside the session.
What gets installed and where
| Path | Purpose |
|---|---|
~/.acp/govern.mjs |
Hook script, shared with Claude Code and Codex installs |
~/.acp/credentials |
Bearer token from browser OAuth |
~/.cursor/hooks.json |
Adds hooks.preToolUse[] and hooks.postToolUse[] entries |
Safe to re-run.
What you’ll see in the dashboard
Cursor traffic appears as Cursor in cloud.agenticcontrolplane.com/agents. Activity is split by the tier Cursor reports, when it reports one. For Composer-driven sessions that is typically interactive.
The Activity page (/activity) lists individual tool calls with the Cursor session ID, the tool name Composer reports (Read, Edit, Apply Patch, Run Terminal) and any policy decision.
Setting up policy
Cursor traffic follows the same three kinds of policy as any other client:
- Tool policies restrict destructive Bash commands, or file writes outside the workspace.
- Agent policies set rules per tier, for example interactive Composer versus autonomous Composer agent runs.
- User policies limit sensitive operations (Stripe, a production database) to specific people.
A new workspace starts in audit mode: everything is recorded and only the safety floor holds anything. Watch a few days of real traffic, then turn enforcement on. The rules page, Rules that stop the scary things, has copy-paste recipes.
Limitations
- Cursor’s hook API is less mature than Claude Code’s. Expect schema fields to change. The
govern.mjsscript accepts both Claude and Cursor field names, but it may need updates when Cursor changes. - No ask on Cursor. See above. A held call is blocked and approved elsewhere.
- No named-subagent data. Composer doesn’t expose a named-subagent concept comparable to Claude Code’s Agent tool, so the dashboard shows less per-agent detail for Cursor.
- YOLO mode is untested. We haven’t tested whether hooks fire for tool calls that Composer’s YOLO mode runs without prompting. Don’t assume they do.
- Privacy Mode doesn’t affect ACP. It changes what telemetry Cursor itself sends. ACP’s hook runs on your machine and talks to your workspace’s gateway.
- PostToolUse is observe-only. ACP can record PII and prompt-injection findings, but Cursor’s hook API doesn’t let it rewrite a tool’s output before Cursor sees it.
Troubleshooting
The hook isn’t firing. Quit Cursor completely and reopen it. Cursor reads hook configuration at startup.
Calls are blocked with “ACP unreachable”. By default an unreachable ACP fails open: calls run and are flagged as ungoverned. So a block means either you opted into fail-closed (~/.acp/failmode says closed) or a policy is denying the call. If ~/.acp/credentials is empty or expired, re-run the installer to sign in again.
Cursor doesn’t see the hook. Check that ~/.cursor/hooks.json exists and is valid JSON. Cursor silently ignores an invalid hook config.
Add the cost X-ray
The hook checks and logs tool calls. It doesn’t see the model’s token usage, so it can’t show cost. To meter spend and prompt-cache hit rate, route Cursor’s model calls through the ACP proxy. In Cursor’s model settings, set a custom OpenAI base URL of https://api.agenticcontrolplane.com/v1 and authenticate with your ACP key (gsk_...). Responses are the same, now metered, and the proxy also checks the tool-use blocks the model emits as a second layer.
Full walkthrough: Turn on Cost X-Ray.
Related integrations
- Claude Code: same hook pattern, more mature hook API
- OpenAI Codex CLI: Claude-style PreToolUse hooks covering shell,
apply_patchand MCP calls on current builds (shell-only on older ones; hosted tools such as web search are never hooked) - Cline: a VS Code extension that pairs well with Cursor for some workflows, and uses MCP instead of hooks
- Agent-to-Agent delegation: what happens when Composer chains across several agent invocations
Protected in 3 steps
Out of the box, ACP records every tool call your agents make. A short safety floor applies in every mode: catastrophic commands (rm -rf on your home or system folders, disk wipes) are always blocked, and force-push, destructive SQL, piping a download into a shell, and deleting outside your project are held for your approval. Your own rules (ask first / never) start applying when you turn on enforce. No rule can loosen the floor; a workspace owner or admin can switch it off on the Policies page (you were asked at install). With --local the always-blocked list is narrower: rm -rf on your home or root, disk wipes, fork bombs.
-
1
Install. One command, then approve this machine in the browser.
curl -sf https://agenticcontrolplane.com/install.sh | bash -
2
Turn on your rules. Run
/acp-enforcein your agent. The starter rules start applying:rmand keychain reads are held for your approval (you approve on the console Approvals page or from the approval email); everything else keeps running and is recorded. Add your own with/acp-ask Bash.curl,/acp-deny Bash.git.push,/acp-allow Bash.npm, or on the Policies page. With--localthere is no mode switch: the rules in~/.acp/policy.jsonapply from the first call, and the starter file asks beforerm,curl,git push,chmodandchown. -
3
See it work. Ask your agent to do something risky, for example
git push --forceon a scratch repo. ACP holds the call for your approval; the call and your answer land in the audit log (/acp-whyfor the last hold, the console Activity page, or~/.acp/audit.jsonlwith--local). In Cursor, a held call shows as a block in the agent; approve it on the console Approvals page or from the approval email, then ask the agent to retry.
Copy-paste rules for the things people are most afraid of (force-push, prod database, rm -rf, a secret in a curl, overnight runs, a cost cap): Rules that stop the scary things.

