shell hook

Cursor

Drop a shell hook script into .cursor/hooks/ and point Cursor at it. Every AI action gets evaluated before it runs.

API key required

You need a Neptrix API key to complete this setup. Sign up free to get one.

Installation

  1. 1Copy the script below
  2. 2Save it as .cursor/hooks/pre-tool-use.sh in your project
  3. 3Run: chmod +x .cursor/hooks/pre-tool-use.sh
  4. 4Replace YOUR_API_KEY with your key
  5. 5Configure Cursor to use the hook script in Settings > AI > Hooks
Add this configuration to.cursor/hooks/pre-tool-use.sh
.cursor/hooks/pre-tool-use.sh
1#!/bin/bash
2# Neptrix governance hook for Cursor
3# Save this as .cursor/hooks/pre-tool-use.sh and make it executable
4
5RESPONSE=$(curl -s -X POST https://qpthort-backend-production.up.railway.app/hooks/claude-code/pre-tool-use \
6 -H "x-api-key: YOUR_API_KEY" \
7 -H "Content-Type: application/json" \
8 -d "$(cat)")
9
10echo "$RESPONSE"

Replace YOUR_API_KEY with your API key. Sign up to get your key.

How it works

1

Agent proposes action

Before each tool call, your agent sends the proposed action to Neptrix for evaluation.

2

Neptrix evaluates

Constitutional governance rules evaluate the action. The decision is logged to your audit trail.

3

Decision returned

ALLOW, BLOCK, ESCALATE, or MODIFY. Agents auto-discover — no registration needed.

Ready to govern your agents?

Create a free account, generate an API key, and have governance running in under 5 minutes.

Get started for free