Cursor hooks

Security scanning inside Cursor

Run checks from the host lifecycle instead of relying on a prompt. gate scans edits and inspects shell commands. turn answers at Stop: which of these did this turn just do?

Checks attached to host events

  1. 01 afterFileEditgate scans the file Cursor just changed
  2. 02 beforeShellExecutiongate decides before the command runs
  3. 03 stopturn reports only what this turn introduced
host event, local check, finding or clean result
npm i -D owlwarden
npx owlwarden init --cursor

What that writes

stop runs turn --hook cursor --record, not gate --since HEAD. The per-edit and pre-command hooks stay on gate.

The rules file is not the control

Rules reduce avoidable findings, but they remain prompt context. Hooks are the part that runs independently of the model's decision.

Cursor's own configuration is a scan surface

.cursor/mcp.json, .cursor/hooks.json, .cursorrules, and .cursor/rules/** are read by the agent-config rules. They check unpinned MCP server, a hook that pipes a fetch into a shell, a rules file with characters a reviewer cannot see. Cursor is one git pull away from any of them.

npx owlwarden vet .

Keep reading