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. API keys come with hosted beta access, and the hosted platform is currently in closed beta. Join the waitlist for access.
Installation
- 1Copy the script below
- 2Save it as .cursor/hooks/pre-tool-use.sh in your project
- 3Run: chmod +x .cursor/hooks/pre-tool-use.sh
- 4Replace YOUR_API_KEY with your key
- 5Configure Cursor to use the hook script in Settings > AI > Hooks
.cursor/hooks/pre-tool-use.sh1#!/bin/sh2# Neptrix governance hook for Cursor3# Save this as .cursor/hooks/pre-tool-use.sh and make it executable4# Fails closed: if Neptrix is unreachable the action is denied.5# Set NEPTRIX_FAIL_MODE=open to proceed ungoverned instead (not recommended).67r=$(curl -sf --max-time 5 -X POST https://qpthort-backend-production.up.railway.app/hooks/claude-code/pre-tool-use -H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" --data-binary @-) && { printf "%s" "$r"; exit 0; }; [ "$NEPTRIX_FAIL_MODE" = "open" ] && { echo "[Neptrix] WARNING: governance service unreachable and NEPTRIX_FAIL_MODE=open - tool call proceeding UNGOVERNED. Unset NEPTRIX_FAIL_MODE to restore fail-closed." >&2; exit 0; }; echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"[Neptrix] Governance service unreachable - action denied. Set NEPTRIX_FAIL_MODE=open to override."}}'
Replace YOUR_API_KEY with your API key. Join the waitlist for hosted access.
How it works
Agent proposes action
Before each tool call, your agent sends the proposed action to Neptrix for evaluation.
Neptrix evaluates
Constitutional governance rules evaluate the action. The decision is logged to your audit trail.
Decision returned
ALLOW, BLOCK, ESCALATE, or MODIFY. Agents auto-discover — no registration needed.
The hosted platform is in closed beta.
Join the waitlist for first access when it reopens - or download the desktop beta and govern your agents on your own machine today.
