Skip to content

Cursor ​

Integrate Intutic governance with Cursor — the AI-powered code editor.

How it works ​

Intutic governs Cursor in these layers:

  • Rules — your SOPs in .cursor/rules/intutic-governance.mdc, a project rule with alwaysApply: true, which Cursor adds to every request. Your own rules stay in other files in .cursor/rules/.
  • A blocking gate — .intutic/hooks/cursor-check.js, registered in Cursor's hooks for beforeShellExecution (every shell command), beforeMCPExecution (every MCP tool call) and preToolUse with the matcher Write|Delete (file writes and deletions). It refuses with exit code 2, and is registered with timeout: 10 and failClosed: true, so a gate that crashes or times out blocks the call too. The gate refuses on its own after 9 seconds.

Setup ​

1. Check that Cursor is detected ​

intutic init detects Cursor from a .cursor/ directory or a .cursorrules file in the project, or from ~/.cursor, which installing Cursor creates. There is usually nothing to do.

2. Initialize Intutic ​

bash
intutic init
  ✔ cursor → /path/to/project/.cursor/rules/intutic-governance.mdc

intutic init only detects the harness and records it in ~/.intutic/config.json; it writes no harness files. The files described on this page are written by intutic gates install (open core, no control plane), from the rule sets in .intutic/sops/ — see What writes harness files:

bash
intutic gates install

3. Start the proxy ​

bash
intutic start

What gets written ​

.cursor/rules/intutic-governance.mdc, written when at least one SOP targets Cursor:

markdown
---
description: Intutic governance rules
alwaysApply: true
---

# Intutic Governance Rules (auto-generated)
# DO NOT EDIT — managed by intutic sync daemon; put rules of your own in another file

> **Proxy URL:** `http://localhost:4000`

## Code Review Requirements

All code changes must include unit tests...

---

## Security Policy

Never commit secrets or API keys...

The file is Intutic's own and is replaced each time it is written; keep your own rules in other files in .cursor/rules/, or as SOP files in .intutic/sops/ (see SOP Front Matter). Earlier versions overwrote .cursorrules whole; the first write with this version gives you your own copy of it back. See Where rule sets go.

Hooks ​

The gate is merged into .cursor/hooks.json (project) and ~/.cursor/hooks.json (user); your own hooks in those files are kept:

json
{
  "version": 1,
  "hooks": {
    "beforeShellExecution": [{ "command": "node \"/path/to/project/.intutic/hooks/cursor-check.js\"", "timeout": 10, "failClosed": true }],
    "beforeMCPExecution": [{ "command": "node \"/path/to/project/.intutic/hooks/cursor-check.js\"", "timeout": 10, "failClosed": true }],
    "preToolUse": [{ "command": "node \"/path/to/project/.intutic/hooks/cursor-check.js\"", "matcher": "Write|Delete", "timeout": 10, "failClosed": true }]
  }
}

Proxy routing ​

Set Cursor's OpenAI Base URL override (Settings → Models) to http://localhost:4000/v1 to send requests for your own API keys through the proxy. Cursor's built-in models are served from Cursor's backend and do not use this setting.

To undo what intutic gates install writes here, run intutic disconnect --harness cursor: each file goes back to what it held before Intutic first wrote it, or is deleted if Intutic created it, and edits you made since are kept. See intutic disconnect.

Config details ​

PropertyValue
Harness typecursor
Rules file.cursor/rules/intutic-governance.mdc
Hook files.cursor/hooks.json, ~/.cursor/hooks.json, .intutic/hooks/cursor-check.js
Detection.cursor/ or .cursorrules in the workspace root, or ~/.cursor
FormatMarkdown with alwaysApply: true front matter (header + SOP sections)
Write strategyAtomic (write to .intutic-tmp, then rename)

The circuit breaker for AI agents