Installation
Prerequisites
- Node.js 18+ (native fetch, crypto.randomUUID)
- Cursor IDE with hooks support
- Prisma AIRS API key (
x-pan-token) - AIRS security profile configured in Strata Cloud Manager
Install
- npm (recommended)
- From source
npm install -g @cdot65/prisma-airs-cursor-hooks
This installs the CLI globally and makes the prisma-airs-hooks command available system-wide.
git clone https://github.com/cdot65/prisma-airs-cursor-hooks.git
cd prisma-airs-cursor-hooks
npm install
npm run build
Environment Variables
Add to your shell profile (~/.zshrc, ~/.bashrc, or ~/.zsh.d/):
export PRISMA_AIRS_API_KEY=<your-x-pan-token> # required
export PRISMA_AIRS_PROFILE_NAME="Cursor IDE - Hooks" # recommended
export PRISMA_AIRS_API_ENDPOINT=https://service.api.aisecurity.paloaltonetworks.com # optional
PRISMA_AIRS_API_KEY is requiredThe endpoint defaults to the US region. PRISMA_AIRS_PROFILE_NAME sets the AIRS security profile for all scan directions. If you need different profiles per direction, use PRISMA_AIRS_PROMPT_PROFILE, PRISMA_AIRS_RESPONSE_PROFILE, and PRISMA_AIRS_TOOL_PROFILE as overrides.
Regional Endpoints
| Region | Endpoint |
|---|---|
| US (default) | https://service.api.aisecurity.paloaltonetworks.com |
| EU | https://service-de.api.aisecurity.paloaltonetworks.com |
| India | https://service-in.api.aisecurity.paloaltonetworks.com |
| Singapore | https://service-sg.api.aisecurity.paloaltonetworks.com |
Validate Connectivity
- npm global install
- From source
prisma-airs-hooks validate-connection
prisma-airs-hooks validate-detection
npm run validate-connection
npm run validate-detection
Register Hooks in Cursor
- npm global install
- From source
prisma-airs-hooks install --global
npm run install-hooks -- --global
This writes hooks.json pointing at the precompiled JS in dist/ and copies airs-config.json to the hooks config directory.
Optional hooks
The default install registers the four core hooks (beforeSubmitPrompt, afterAgentResponse, beforeMCPExecution, postToolUse). Additional hooks ship as opt-in — pass --optional with a comma-separated list of hook names, or all:
# everything
prisma-airs-hooks install --global --optional all
# just the ones you want
prisma-airs-hooks install --global --optional beforeShellExecution,beforeReadFile
Optional hooks never fail verify-hooks when absent, and uninstall-hooks removes them along with the core hooks.
Use --global to install hooks at ~/.cursor/hooks.json so they apply across all workspaces without per-project setup.
Restart Cursor
Cursor reads hooks.json at startup. Restart Cursor to activate the hooks.
Verify
- npm global install
- From source
prisma-airs-hooks verify --global
npm run verify-hooks -- --global
Uninstall
- npm global install
- From source
prisma-airs-hooks uninstall --global
npm run uninstall-hooks -- --global
Removes AIRS entries from hooks.json while preserving other hooks, config, and logs.