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 密钥
您需要 Neptrix API 密钥才能完成此设置。 免费注册获取密钥。
安装
- 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.sh.cursor/hooks/pre-tool-use.sh
1#!/bin/bash2# Neptrix governance hook for Cursor3# Save this as .cursor/hooks/pre-tool-use.sh and make it executable45RESPONSE=$(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)")910echo "$RESPONSE"
将 YOUR_API_KEY 替换为您的 API 密钥。 注册获取密钥。
工作原理
1
智能体提议操作
在每次工具调用之前,您的智能体将提议的操作发送给 Neptrix 进行评估。
2
Neptrix 进行评估
宪法治理规则评估操作。决策被记录到您的审计追踪中。
3
返回决策
ALLOW、BLOCK、ESCALATE 或 MODIFY。智能体自动发现——无需注册。
