Skip to main content

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 install -g @cdot65/prisma-airs-cursor-hooks

This installs the CLI globally and makes the prisma-airs-hooks command available system-wide.

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
Only PRISMA_AIRS_API_KEY is required

The 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

RegionEndpoint
US (default)https://service.api.aisecurity.paloaltonetworks.com
EUhttps://service-de.api.aisecurity.paloaltonetworks.com
Indiahttps://service-in.api.aisecurity.paloaltonetworks.com
Singaporehttps://service-sg.api.aisecurity.paloaltonetworks.com

Validate Connectivity

prisma-airs-hooks validate-connection
prisma-airs-hooks validate-detection

Register Hooks in Cursor

prisma-airs-hooks install --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.

Global installation recommended

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

prisma-airs-hooks verify --global

Uninstall

prisma-airs-hooks uninstall --global

Removes AIRS entries from hooks.json while preserving other hooks, config, and logs.