Skip to Content

Cursor

Cursor now ships a Claude-Code-compatible first-party hook API (cursor.com/docs/hooks), which replaces the older Arrakis-shipped Python hook. Deploy hooks.json via MDM (or via the Cursor admin dashboard for cloud-synced Team-level policy). Pair the hook path with periodic admin-API polling for administrative audit events. Privacy mode is enforced at the team level; the MDM AllowedTeamId policy blocks sign-in to personal (non-privacy) accounts on corporate machines.

When to use this

Use this page if your fleet uses any Cursor product — the IDE, Cursor CLI, Cloud Agents, or Mobile Remote Control. All four products share the hook-and-admin-API governance shape; the hook config auto-applies across IDE, CLI, and Cloud Agents. Mobile Remote Control is admin-gated per team.

3-step Quickstart

  1. In the Arrakis platform, paste your Cursor admin API key under Settings → Integrations → Cursor.
  2. Download the tenant-specific hooks.json fragment from Settings → Integrations → Deployment → Cursor.
  3. Deploy via your MDM to /Library/Application Support/Cursor/hooks.json (macOS), C:\ProgramData\Cursor\hooks.json (Windows), or /etc/cursor/hooks.json (Linux). Confirm a sessionStart event reaches the Arrakis ingest.

Where tenant-specific values come from

Sign in to the Arrakis platform → Settings → Integrations → Deployment. The Arrakis ingest endpoint, header secret, and per-tool MDM payload templates for your tenant live there.

Reference: full configuration walkthrough

Cursor hook API overview

Cursor’s hook system is a subprocess-over-stdio model — Cursor invokes a customer-supplied binary with a JSON payload, reads the JSON reply. Supported events:

EventFires on
sessionStart / sessionEndSession lifecycle
workspaceOpenWorkspace open
beforeSubmitPromptPrompt submission (pre) — can rewrite or block
preToolUse / postToolUseTool invocation
beforeShellExecutionShell command execution (pre) — can rewrite or block
beforeReadFileFile read (pre) — can redact or block
afterFileEditFile edit committed
beforeMCPExecutionMCP tool invocation (pre)
afterAgentResponseAgent turn completion

Tab hooks exist for tab-completion events; see the Cursor docs for the full list.

Config precedence (last wins): Enterprise (MDM) → Team (dashboard, cloud-synced) → Project → User.

MDM paths per OS:

PlatformPath
macOS/Library/Application Support/Cursor/hooks.json
WindowsC:\ProgramData\Cursor\hooks.json
Linux/etc/cursor/hooks.json

Env vars provided to hook subprocesses: CURSOR_PROJECT_DIR, CURSOR_USER_EMAIL, CURSOR_TRANSCRIPT_PATH, plus a CLAUDE_PROJECT_DIR alias for Claude-Code-compatible hook binaries.

The Arrakis hooks.json fragment configures each event to invoke the Arrakis hook binary (also delivered by MDM) with the tenant-specific ingest endpoint and bearer token baked in.

Admin API — audit-log pull

Poll GET https://api.cursor.com/teams/audit-logs for administrative events. Auth is Basic — API key as username, empty password.

FieldDetail
Rate limit20 req/min per team
Retention window30 days
AuthBasic (API key as username)
Envelopemetadata.timestamp, event_id, team_id, ip_address, user_email, event-specific fields

Event catalog: login, logout, add_user, update_user_role, team_api_key, user_api_key, privacy_mode, team_hook, team_command, team_repo, mcp_server_config, bugbot_*, directory-group events.

Important: Audit logs are metadata only. Cursor’s own docs state “We do not log agent responses or generated code content.” Prompt / tool-call / file-edit content is captured exclusively through the hook path — the admin API complements it, not the other way around.

Other admin/organization endpoints available on the same key: /teams/members, /teams/user-spend-limit, /teams/daily-usage-data, /teams/spend, /teams/filtered-usage-events, /teams/groups*, /settings/repo-blocklists/*; and (Enterprise) /organizations/members, /organizations/team-memberships/sync, /organizations/pooled-usage, /organizations/filtered-usage-events, /organizations/daily-usage-data, /organizations/groups*.

Webhook status

Cursor supports streaming audit logs to S3 / SIEM / webhook / Elasticsearch / CloudWatch, but only via manual setup — the customer emails hi@cursor.com. There is no self-serve HMAC-signed webhook API documented; do not promise one to customers. When the streaming path is available, Arrakis prefers it over the 20-req/min pull; where it is not, the pull path suffices.

Privacy mode

Privacy Mode is the toggle that governs whether Cursor logs prompts for training and retention. Team-level admins can enforce Privacy Mode across the team (“members cannot disable it individually”). On Enterprise, Privacy Mode is on by default.

For corporate machines, deploy the MDM AllowedTeamId policy to block sign-in to personal (non-privacy) accounts. Per-model retention approvals exist for models outside the standard Zero Data Retention set (e.g. “Claude Fable 5”).

Product coverage

  • Cursor IDE. The primary surface. Hooks apply.
  • Cursor CLI (curl https://cursor.com/install). Agent, plan, and ask modes; -p non-interactive; sandbox controls; Cloud Agent handoff via &. Hooks apply. Usage events flow through the same /teams/filtered-usage-events endpoint.
  • Cloud Agents. Separate opt-in per team. Encrypted repo storage during the run, deleted after. Governance via .cursor directory protection and browser origin allowlists. Hooks apply to a subset of events; see the Cursor docs for the current supported list.
  • Cursor Mobile (Remote Control). Admins enable Remote Control from the team dashboard. Usage flows through the same admin API endpoints.
  • Team Marketplaces. MCPs and skills distributed across IDE, CLI, and Cloud Agents. Governed by mcp_server_config and team_command audit events.

MDM payloads

Jamf Pro (macOS)

  • Files & Processes payload: deploy hooks.json to /Library/Application Support/Cursor/ (mode 0644, owner root:wheel).
  • Files & Processes payload: deploy the Arrakis hook binary (also downloaded from the Arrakis platform; signed — verify signature before packaging) to its install directory with mode 0755, owner root:wheel.
  • Custom Configuration Profile: set the Cursor AllowedTeamId preference to force sign-in to your team.
  • Smart Group: scope to machines with Cursor installed.

Microsoft Intune

  • macOS: shell-script policy that installs hooks.json and the hook binary. Set AllowedTeamId via Custom Configuration Profile.
  • Windows: Win32 app (.intunewin) installs hooks.json to C:\ProgramData\Cursor\ and the hook binary to Program Files. Settings catalog policy applies the AllowedTeamId registry key.
  • Assignment: developer device or user group.

Iru (macOS)

  • Custom Script library item (install) — marked Continuously Enforced so a missing hooks.json or binary is re-installed on each check-in.
  • Custom Profile library item — sets AllowedTeamId via .mobileconfig.

Generic

  • macOS launchd plist for env; file deploy for hooks.json and the binary.
  • Windows: PowerShell install script; Settings-catalog-equivalent for AllowedTeamId.

The hooks.json body, the hook binary artifact, and the tenant-specific ingest endpoint and bearer token are provisioned per-tenant in the Arrakis platform under Settings → Integrations → Deployment, or available from Arrakis support. Verify artifact signatures before MDM packaging.

Egress verification

Cross-link to OTel Collector & Arrakis Endpoint → Verifying connectivity for TCP/TLS, synthetic ingest, and failure-mode probes shared across tools.

Cursor-specific debug commands:

CommandWhat it shows
cat /Library/Application Support/Cursor/hooks.jsonVerify the file is present with the expected contents.
Cursor: Show Logs (Command Palette)Confirm hook invocation and any subprocess errors.
curl -u '<api-key>:' https://api.cursor.com/teams/audit-logsConfirm admin API auth works.

Troubleshooting matrix:

SymptomLikely cause
Hook file absentMDM scope did not include the device, or install script failed
Hook invocations missing from Arrakis ingestHook binary path in hooks.json incorrect, or binary lacks execute permission
401 Unauthorized on admin APIAPI key wrong or rotated — re-pull from the Arrakis platform
Personal-account sign-ins on corporate machinesAllowedTeamId policy not applied — force MDM sync
Connection refused / timeout to ingestEgress firewall does not allowlist the ingest host

Vendor-side complement

The Connectors → Coding Agents page (Cursor row) covers the vendor-side coverage scoring across the four pillars.

Cross-references

Last updated on