Install in Cursor
Have Cursor's Agent chat install and connect LeoPrevent, or copy the local plugin package yourself on macOS, Linux or Windows.
LeoPrevent works with Cursor's local Agent chat. It installs as a local plugin package, which your agent can copy for you or you can copy yourself. In Cursor, LeoPrevent's advice arrives as one automatic follow up message. See How each agent handles a finding.
Before you start#
- Cursor is installed, and your organisation's policy allows local plugins.
gitis installed.- You have a LeoPrevent account, and you work in a git repository.
Set it up with your agent#
Your agent installs the plugin and opens your browser to connect it. The same prompt is in the dashboard under Plugin setup, with Copy.
Open Cursor's Agent chat and send this prompt:
Install LeoPrevent for Cursor from https://github.com/leotrace-hq/leoprevent-plugin, copying cursor/leoprevent into ~/.cursor/plugins/local/leoprevent. Ask me to reload Cursor, then run ~/.cursor/plugins/local/leoprevent/bin/leoprevent-plugin login --agent=cursor. Keep login running until it prints "LeoPrevent · Connected". Browser login saves the credential locally, so no licence key needs to be copied. Do not ask for, paste, or print one; keep credentials out of this transcript. Tell me what I need to approve or restart myself. Verify with a real turn, not by running the hook by hand: LeoPrevent fails open, so a successful manual run does not prove your coding agent invokes it. Confirm that turn appears in the LeoPrevent dashboard; report verification as pending if you cannot check it.Install LeoPrevent for Cursor on Windows from https://github.com/leotrace-hq/leoprevent-plugin, copying cursor-windows/leoprevent into ~/.cursor/plugins/local/leoprevent. Ask me to reload Cursor, then run ~/.cursor/plugins/local/leoprevent/bin/leoprevent-plugin.exe login --agent=cursor. Keep login running until it prints "LeoPrevent · Connected". Browser login saves the credential locally, so no licence key needs to be copied. Do not ask for, paste, or print one; keep credentials out of this transcript. Tell me what I need to approve or restart myself. Verify with a real turn, not by running the hook by hand: LeoPrevent fails open, so a successful manual run does not prove your coding agent invokes it. Confirm that turn appears in the LeoPrevent dashboard; report verification as pending if you cannot check it.On the setup screen you see when you first sign in, Open in Cursor opens Agent chat with the prompt filled in.
Approve what it asks for, reload Cursor when it asks, and choose Link installation when the browser opens.
Manual setup#
- 1Download the plugin
git clone --depth 1 https://github.com/leotrace-hq/leoprevent-plugin ~/.cursor/leoprevent-source - 2Install the local package
mkdir -p ~/.cursor/plugins/local/leoprevent cp -R ~/.cursor/leoprevent-source/cursor/leoprevent/. ~/.cursor/plugins/local/leoprevent/ - 3Reload Cursor
Reload the window, then confirm LeoPrevent appears in Customize.
- 4Connect to LeoPrevent
Run this in a terminal, then choose Link installation on the page it opens in your browser. Keep it running until it prints LeoPrevent · Connected.
~/.cursor/plugins/local/leoprevent/bin/leoprevent-plugin login --agent=cursor
- 1Download the plugin
git clone --depth 1 https://github.com/leotrace-hq/leoprevent-plugin "$HOME\.cursor\leoprevent-source" - 2Install the local package
On Windows, use the
cursor-windowspackage shown here. Its hooks run the Windows binary.New-Item -ItemType Directory -Force "$HOME\.cursor\plugins\local\leoprevent" | Out-Null Copy-Item -Recurse -Force "$HOME\.cursor\leoprevent-source\cursor-windows\leoprevent\*" "$HOME\.cursor\plugins\local\leoprevent\" - 3Reload Cursor
Reload the window, then confirm LeoPrevent appears in Customize.
- 4Connect to LeoPrevent
Run this in a terminal, then choose Link installation on the page it opens in your browser. Keep it running until it prints LeoPrevent · Connected.
& "$HOME\.cursor\plugins\local\leoprevent\bin\leoprevent-plugin.exe" login --agent=cursor
To confirm the hooks are loaded, check they appear in Cursor's Hooks tab.
Check it worked#
Paste this into your agent and let it reply. The finished turn is what checks in.
Hello! I just installed LeoPrevent. Say hi back so this turn finishes.The installation then shows as Live in Plugin setup. See Check it's working.
Already installed this before?#
Copy the package again and reload Cursor. Your LeoPrevent connection survives.
Update#
Refresh the source, copy the package again, then reload Cursor.
git -C ~/.cursor/leoprevent-source pull --ff-onlycp -R ~/.cursor/leoprevent-source/cursor/leoprevent/. ~/.cursor/plugins/local/leoprevent/git -C "$HOME\.cursor\leoprevent-source" pull --ff-onlyCopy-Item -Recurse -Force "$HOME\.cursor\leoprevent-source\cursor-windows\leoprevent\*" "$HOME\.cursor\plugins\local\leoprevent\"Remove#
Delete the ~/.cursor/plugins/local/leoprevent folder (on Windows, $HOME\.cursor\plugins\local\leoprevent) and reload Cursor. You can also delete ~/.cursor/leoprevent-source.