Example scripts for batch-scanning prompts against Palo Alto Networks Prisma AIRS using the pan-aisecurity Python SDK.
Two scanning modes:
main.py— synchronous, one prompt at a time with 0.5s delaymain_threaded.py— multi-threaded with configurable worker pool (default 20)
Both scripts read from prompts.csv and write results back to the same file.
- Python 3.11+
- Prisma AIRS API key and AI security profile name
git clone git@github.com:cdot65/prisma-airs-sdk-example.git
cd prisma-airs-sdk-examplecp .env.example .envEdit .env:
AIRS_API_KEY="your-api-key-here"
AIRS_AI_PROFILE="your-ai-profile-name-here"
uv syncOr with pip:
python -m venv .venv
source .venv/bin/activate
pip install pan-aisecurity python-dotenvcp prompts.example.csv prompts.csvEdit prompts.csv to add your test prompts. Only three columns are required as input:
| Column | Description |
|---|---|
index |
Row number (0-based) |
prompt_preview |
The prompt text to scan |
expected |
TRUE if the prompt should be blocked, FALSE if allowed |
All other columns are populated by the scanner after running.
uv run main.pyuv run main_threaded.pySet AIRS_THREAD_COUNT to control worker pool size (minimum 20):
AIRS_THREAD_COUNT=50 uv run main_threaded.pyAfter scanning, prompts.csv is updated with these result columns:
| Column | Description |
|---|---|
action |
AIRS verdict: allow or block |
category |
AIRS classification: benign or malicious |
scan_id |
Scan identifier |
report_id |
Report identifier |
agent |
Agent security detection triggered |
injection |
Prompt injection detection triggered |
dlp |
Data loss prevention detection triggered |
toxic_content |
Toxic content detection triggered |
malicious_code |
Malicious code detection triggered |
url_cats |
URL filtering detection triggered |
topic_violation |
Topic violation detection triggered |
match |
PASS if result matches expected, FAIL otherwise, ERROR on failure |
error_message |
Error details if scan failed |
Additional verdict detail columns (dlp_verdict, tc_verdict, overall_actions, etc.) are populated when report data is available.
uv run pytestuv run ruff check --fix .
uv run ruff format .