Prisma AIRS Cursor Hooks scans prompts and AI responses in the Cursor IDE in real-time via the Prisma AI Runtime Security (AIRS) Sync API. Blocks prompts before they reach the LLM and audits AI responses for prompt injections, malicious code, sensitive data leakage, toxic content, and policy violations.
Install¶
How It Works¶
flowchart LR
A[Developer Prompt] --> B[beforeSubmitPrompt Hook]
B -->|AIRS Scan| C{Verdict}
C -->|Allow| D[Cursor AI Agent]
C -->|Block| E[Block Message]
D --> F[MCP Tool Call]
F --> G[beforeMCPExecution Hook]
G -->|AIRS Scan| H{Verdict}
H -->|Allow| I[Tool Execution]
H -->|Block| J[Block Message]
I --> K[Tool Output]
K --> L[postToolUse Hook]
L -->|AIRS Scan| M[Log + Warn]
D --> N[AI Response]
N --> O[Display to Developer]
O --> P[afterAgentResponse Hook]
P -->|AIRS Scan| Q{Verdict}
Q -->|Clean| R[No Action]
Q -->|Violation| S[Log + Warn]
postToolUse and afterAgentResponse are observe-only
postToolUse and afterAgentResponse fire after content is already processed or displayed. They cannot block or retract content — they scan for audit, compliance, and security alerting. See Cursor Limitation.
Capabilities¶
-
Prompt Scanning
Scans every prompt before it reaches the AI agent. Detects prompt injection, DLP violations, toxicity, and custom topic policy violations.
-
Response & Code Auditing
Parses AI responses to extract code blocks separately. Natural language and code are scanned independently for audit and compliance. Observe-only — Cursor cannot block responses.
-
Tool & MCP Scanning
Scans MCP tool inputs before execution (
beforeMCPExecution, can block) and tool outputs after execution (postToolUse, observe-only). Routes by tool type: MCP →tool_event, Bash →response, Write/Edit → DLP scan. -
Enforce or Observe
Three modes:
observe(log only),enforce(block on detection),bypass(skip). Start in observe mode to audit, switch to enforce when ready. -
Fail-Open Design
Never blocks the developer on infrastructure failures. Circuit breaker pattern bypasses scanning after consecutive API failures with automatic recovery.
Get Started¶
-
Install
Install from npm, set environment variables, and register hooks in Cursor.
-
Quick Start
Get scanning in under 5 minutes.
-
Configure
Modes, enforcement actions, profiles, circuit breaker, and logging.
-
Architecture
Scanning flow, module design, and key decisions.