# Cursor

Connect Cursor to Kastra policies and verify the hook boundary.

Updated: 2026-09-22

Canonical: https://docs.kastra.ai/edge/cursor

## Prerequisites

[Install Edge](https://docs.kastra.ai/edge/install), install Cursor, and sign in to the intended Kastra workspace. Use a test environment for initial policy checks.

## Connect the hook

```sh
kastra-edge login
kastra-edge install-cursor --dry-run
kastra-edge install-cursor
kastra-edge doctor
```

The installer targets `~/.cursor/hooks.json`. Review its proposed change and restart the agent so it loads the new configuration. Keep unrelated hooks intact.

## What is governed

The Cursor integration checks supported pre-action events, including shell and file operations exposed by Cursor. Post-action events record activity after execution; their existence does not mean they can block the completed action.

The hook calls Kastra's service before the supported action. Work outside the hook is not governed. Network or harness failures can allow work to continue under the integration's failure behavior; read [failure handling](https://docs.kastra.ai/reference/failure-behavior).

## Verify the connection

Run a harmless action and inspect the exact decision in the console. Then test a narrow deny rule and a HOLD rule in your test environment. Confirm the actual side effect, not only the banner or notification. [Verification checklist](https://docs.kastra.ai/start/first-workflow).

## Operational notes

Windows configuration writing is implemented, but Cursor execution was not part of the recorded Windows validation. To remove the managed hooks, use `kastra-edge uninstall-cursor`.

If no decision appears, check the hook file, PATH, login, environment, agent restart, and [troubleshooting guide](https://docs.kastra.ai/edge/troubleshooting). Installation detection alone cannot prove that the host invoked the hook.
