Docs / Integrations
Coding-tool hooks
Check tool, MCP and shell actions from Cursor and Gemini CLI hook points.
Hooks are early. Local hooks can be changed by anyone with access to the machine, and a connected integration does not mean complete coverage. Confirm that a denied action is really blocked in the client version you use.
| Client | Enforced | Observed only |
|---|---|---|
| Cursor | MCP calls, shell commands | Prompt, model output |
| Gemini CLI | Tools | Prompt, model request and response |
| Claude Code | Do not rely on it yet (see below) | — |
Set up
- Register the tools and MCP servers the coding agent uses, and declare them on its agent version.
- Create a runtime identity and credential.
- Open the identity in the console and generate the client setup, or call
POST /v1/runtime-identities/{id}/client-integrations/{client}/setupwithcursororgemini_cli. - Install the bridge from the repository (
uv syncprovidesrai-hook) and place the wrapper where the generated command points. - Set
RAI_BASE_URLandRAI_AGENT_KEY, merge the generated configuration, and run Test Connection.
{
"version": 1,
"hooks": {
"beforeMCPExecution": [
{ "command": ".cursor/hooks/rai-hook cursor beforeMCPExecution", "timeout": 10, "failClosed": true }
],
"beforeShellExecution": [
{ "command": ".cursor/hooks/rai-hook cursor beforeShellExecution", "timeout": 10, "failClosed": true }
]
}
}{
"hooks": {
"BeforeTool": [
{
"matcher": "*",
"hooks": [
{
"name": "rai-runtime-enforcement",
"type": "command",
"command": "$GEMINI_PROJECT_DIR/.gemini/hooks/rai-hook gemini BeforeTool",
"timeout": 10000
}
]
}
]
}
}Enforcement hooks deny when the bridge cannot reach RaiCentral or the key is missing. Observation hooks never block. Set RAI_HOOK_DEBUG=1 to log mapping and decisions to standard error.
Claude Code
The configuration and deny response that the current build produces do not match Claude Code's documented hooks format, so a denied tool call may still run. Support will be documented here once the adapter is updated and verified.