n8n: Prisma AIRS Runtime Security

Add AI prompt and response scanning to n8n workflow automations using the Prisma AIRS community node

Runtime Security (API Key Auth)

This guide integrates Prisma AIRS Runtime Security: real-time scanning of AI prompts and responses during workflow execution. Unlike the GitHub Actions and Jenkins integrations (which use Model Security with OAuth2), n8n uses a standard AIRS API key (x-pan-token) and an AI Profile Name to call the Runtime Security Scan API.

Two integration paths are available: the official Prisma AIRS community node (recommended) or direct HTTP Request nodes calling the Scan API. This guide covers both approaches.

Scanning PhaseSupportedDescription
Prompt✅"Prompt Scan" operation scans user input for threats
Response✅"Response Scan" operation scans AI-generated responses
Streaming❌Node processes complete responses after generation
Pre-tool call❌Workflow-based — not automatic tool interception
Post-tool call❌Tool result scanning not implemented

Architecture Overview

The n8n integration places Prisma AIRS scan nodes at two points in a workflow: before the user prompt reaches the AI model (prompt scan) and after the AI model generates a response (response scan). Each scan returns an allow or block verdict. An IF node routes blocked content to a handler that returns a safe message instead of the flagged content.

n8n workflow showing 7-step flow: Trigger, Prompt Scan via AIRS, IF decision, AI Model, Response Scan via AIRS, IF decision, Deliver. Block paths are shown for both scan points
Workflow Flow
  1. Trigger — Chat message or manual trigger receives user input.
  2. Prompt Scan — Prisma AIRS scans the user prompt for injection, PII, malicious URLs, and other threats.
  3. Route — IF node checks the scan verdict. Blocked prompts are logged and a safe message is returned.
  4. AI Model — Allowed prompts are forwarded to the AI model (OpenAI, Anthropic, Google Vertex, Ollama, etc.).
  5. Response Scan — Prisma AIRS scans the AI-generated response for data leakage, malicious code, and policy violations.
  6. Route — IF node checks the response verdict. Blocked responses are replaced with a safe message.
  7. Deliver — Allowed responses are returned to the user.
Community Node vs HTTP Request
  • Community node (@paloaltonetworks/n8n-nodes-prisma-airs) — provides a purpose-built UI with operation dropdowns (Prompt Scan, Response Scan, Dual Scan, Batch Scan, Mask Data). Credential management is handled natively. Recommended for most deployments.
  • HTTP Request node — calls the Prisma AIRS Scan API directly. Provides full control over request headers and body. Use when custom headers, metadata, or tr_id correlation are required.

Phase 1: Prerequisites

▶ Step 1.1: Confirm n8n Instance Access

The Prisma AIRS community node requires instance owner permissions for installation.

  1. Open the n8n instance (Cloud or self-hosted).
  2. Navigate to Settings > Community Nodes.
  3. Confirm the Community Nodes page loads and the Install button is visible.
Self-Hosted Setup

For a new self-hosted instance, follow the n8n Docker installation guide. Ensure the instance has outbound internet access to reach the npm registry and the Prisma AIRS API endpoints.

Verification

The Settings > Community Nodes page loads. The account has owner-level permissions to install nodes.

▶ Step 1.2: Confirm Prisma AIRS License and API Key

Runtime Security requires an active Prisma AIRS license, a configured AI Security Profile, and an API key.

  1. Log in to Strata Cloud Manager.
  2. Navigate to AI Access Security.
  3. Confirm a Security Profile (AI Profile) exists and note its exact name (case-sensitive).
  4. Obtain or generate an AIRS API key (this is the x-pan-token value).
Regional API Endpoints

The Prisma AIRS API is available in multiple regions. The community node uses the US endpoint by default. For other regions, use HTTP Request nodes with the appropriate base URL:

RegionBase URL
UShttps://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
Verification

The AI Security Profile name and AIRS API key are recorded. The regional API endpoint is identified.

▶ Step 1.3: Install the Prisma AIRS Community Node

The community node provides a native n8n interface for Prisma AIRS scan operations.

  1. In n8n, navigate to Settings > Community Nodes.
  2. Click Install a community node.
  3. Enter @paloaltonetworks/n8n-nodes-prisma-airs in the search field (or visit the npm package page).
  4. Click Install.
  5. Restart the n8n instance if prompted.
Verification

The @paloaltonetworks/n8n-nodes-prisma-airs node appears in the Community Nodes list. Adding a new node to a workflow and searching for Prisma AIRS returns the node.

Phase 2: Credential Setup

▶ Step 2.1: Create Prisma AIRS API Credentials in n8n

The community node uses n8n's built-in credential system to store the API key and profile name securely.

  1. In n8n, navigate to Credentials from the left-hand menu.
  2. Click Add Credential.
  3. Search for and select Prisma AIRS API.
  4. Fill in the credential fields:
FieldValueDescription
API KeyAIRS API key from Step 1.2The x-pan-token value used for API authentication
AI Profile NameProfile name from Step 1.2Exact name (case-sensitive) of the AI Security Profile configured in Strata Cloud Manager
  1. Click Save.
Verification

The credential appears in the Credentials list with type Prisma AIRS API. Click the credential to confirm both fields are populated (the API key is masked).

Phase 3: Workflow Configuration

▶ Step 3.1: Build a Prompt Scan Workflow (Community Node)

This step builds a minimal workflow that scans user prompts before forwarding them to an AI model. The community node handles API authentication and request formatting.

  1. Create a new workflow in n8n.
  2. Add a trigger node:
    • Chat Trigger for interactive chat workflows, or
    • Manual Trigger for testing.
  3. Add a Prisma AIRS node after the trigger.
  4. In the node properties:
    • Select the credential created in Step 2.1.
    • Set Operation to Prompt Scan.
    • Set Content to the expression referencing the trigger output (e.g., {{ $json.chatInput }}).
  5. Add an IF node after the Prisma AIRS node.
  6. Configure the IF condition:
    • Value 1: {{ $json.action }}
    • Operation: equals
    • Value 2: block
  7. Connect the true (blocked) output to a Set node that returns a safe message (e.g., Content blocked by security policy).
  8. Connect the false (allowed) output to the AI model node.
Available Operations

The community node supports five operations:

OperationDescription
Prompt ScanScans user input for threats (injection, PII, malicious URLs)
Response ScanScans AI-generated responses for policy violations
Dual ScanScans both a prompt and response in a single operation
Batch ScanScans up to 5 items in a single API call
Mask DataScans content and masks sensitive data found within it
Verification

The workflow has a trigger node connected to a Prisma AIRS node connected to an IF node. The IF node has two outputs: blocked (safe message) and allowed (AI model).

▶ Step 3.2: Add Response Scanning

After the AI model generates a response, add a second scan to check the output for data leakage, malicious code, and policy violations before returning it to the user.

  1. After the AI model node, add a Code node (optional) to clean the response text — normalize line endings, collapse excessive whitespace.
  2. Add a second Prisma AIRS node.
  3. In the node properties:
    • Select the same credential from Step 2.1.
    • Set Operation to Response Scan.
    • Set Content to the expression referencing the AI model output (e.g., {{ $json.output }}).
  4. Add a second IF node to check the response scan verdict ({{ $json.action }} equals block).
  5. Connect the true (blocked) output to a Set node returning Response blocked by security policy.
  6. Connect the false (allowed) output to the final output node.
Verification

The workflow now has two Prisma AIRS scan nodes: one for prompt scanning (before the AI model) and one for response scanning (after the AI model). Both feed into IF nodes that route blocked content to safe message handlers.

▶ Step 3.3: Alternative — Use HTTP Request Nodes

For deployments requiring custom headers, tr_id correlation, or non-US regional endpoints, use the HTTP Request node to call the Prisma AIRS Scan API directly.

Prompt Scan via HTTP Request

Add an HTTP Request node with the following configuration:

SettingValue
MethodPOST
URLhttps://service.api.aisecurity.paloaltonetworks.com/v1/scan/sync/request
Header: Content-Typeapplication/json
Header: x-pan-token{{ $env.AIRS_API_KEY }} (or hardcode the credential)
Body TypeJSON

JSON body:

{
  "tr_id": "{{ $execution.id }}-prompt",
  "ai_profile": {
    "profile_name": "YOUR_PROFILE_NAME"
  },
  "metadata": {
    "app_user": "n8n-user",
    "ai_model": "{{ $json.ai_model }}",
    "application_name": "n8n-airs-integration"
  },
  "contents": [
    {
      "prompt": "{{ $json.prompt }}"
    }
  ]
}
tr_id for Correlation

The tr_id field provides a unique identifier for each scan request. Using the n8n execution ID ({{ $execution.id }}) with a -prompt or -response suffix enables correlating scan results in Strata Cloud Manager back to the specific n8n workflow execution.

Environment Variables vs Hardcoded Values

The example uses $env.AIRS_API_KEY and $env.AIRS_API_PROFILE_NAME. For self-hosted n8n, set these as environment variables in the Docker configuration or .env file. For n8n Cloud, use the community node's built-in credential system instead.

Verification

The HTTP Request node is configured with the correct URL, headers, and JSON body. The x-pan-token header is populated. The response from the Prisma AIRS API contains an action field with value allow or block.

Phase 4: Verification

▶ Step 4.1: Test with a Safe Prompt

Run the workflow with a benign prompt to confirm the end-to-end flow works.

  1. Open the workflow in the n8n editor.
  2. Click Execute Workflow (or send a chat message if using the Chat Trigger).
  3. Provide a safe test prompt, e.g., What is the capital of France?
  4. Observe the workflow execution: the Prisma AIRS prompt scan node should return action: allow.
  5. The prompt flows to the AI model, generates a response, passes the response scan, and returns to the user.
Verification

The workflow completes end-to-end. Both Prisma AIRS nodes show action: allow in their output. The final output contains the AI model's response.

▶ Step 4.2: Test with a Blocked Prompt

Run the workflow with a prompt designed to trigger the security profile's block rules to confirm the block path works.

  1. Send a prompt that matches one of the security profile's detection categories (e.g., a prompt containing sensitive data patterns or a known injection attempt).
  2. Observe the workflow execution: the Prisma AIRS prompt scan node should return action: block.
  3. The IF node routes to the block handler, which returns the safe message instead of forwarding to the AI model.
Testing Blocked Content

Use test patterns appropriate to the security profile's configured rules. Consult the Prisma AIRS use cases documentation for detection categories and example patterns. Do not use actual sensitive data for testing.

Verification

The Prisma AIRS node output shows action: block with a category indicating the matched detection rule. The workflow returns the safe message. The AI model node did not execute.

▶ Step 4.3: Verify in Strata Cloud Manager

All scan events are recorded in Strata Cloud Manager for monitoring and compliance.

  1. Log in to Strata Cloud Manager.
  2. Navigate to AI Access Security > Activity Logs.
  3. Locate the scan entries from the test workflow executions.
  4. Confirm both the allowed and blocked scan results appear with the correct verdicts.
Note

If using HTTP Request nodes with a tr_id containing the n8n execution ID, filter by that identifier to correlate scan results with specific workflow runs.

Verification

Both test scans (allowed and blocked) appear in the Strata Cloud Manager activity logs with the correct AI Profile name, verdicts, and detection categories.

Troubleshooting

▶ Common Issues and Resolutions
IssueCauseResolution
Community node not found in node list Node installation incomplete or n8n not restarted Navigate to Settings > Community Nodes and confirm @paloaltonetworks/n8n-nodes-prisma-airs is listed. Restart the n8n instance if the node was recently installed.
Scan returns 401 Unauthorized Invalid or expired API key Verify the AIRS API key in the credential configuration. Generate a new key from Strata Cloud Manager if expired.
Scan returns 400 Bad Request AI Profile Name mismatch or malformed request body Verify the AI Profile Name in the credential matches the exact name (case-sensitive) in Strata Cloud Manager. For HTTP Request nodes, validate the JSON body structure against the API documentation.
Timeout on scan request Network connectivity or large content payload Confirm the n8n instance can reach the Prisma AIRS API endpoint. Increase the HTTP Request timeout (default 30 seconds). For large payloads, check content size limits in the API documentation.
All prompts are allowed (nothing blocked) Security profile rules are not configured or too permissive Review the AI Security Profile in Strata Cloud Manager. Confirm detection categories are enabled and thresholds are set appropriately.
Expression {{ $json.action }} is undefined Prisma AIRS node output structure does not match expected format Check the actual output of the Prisma AIRS node by examining the node's output data panel. The verdict field path may differ between the community node and HTTP Request node responses.
Verification

The troubleshooting table covers the issue encountered. If the issue persists, collect the n8n workflow execution log, the scan request/response payloads, and the AI Profile Name for a support case.