POST /v1/scan/input and POST /v1/scan/output detect threats and return a verdict, while POST /v1/analyze/input and POST /v1/analyze/output run the same detection with additional PII analysis detail. All four endpoints require a scan key (or admin key).
All scan and analyze endpoints require the
Authorization: Bearer iwk_scan_YOUR_KEY header unless authentication is disabled in dev mode.Scoring and decisions
InferenceWall computes an anomaly score for each request using the formula:| Decision | Condition (inbound) | Condition (outbound) |
|---|---|---|
allow | score < 4.0 | score < 3.0 |
flag | score >= 4.0 | score >= 3.0 |
block | score >= 10.0 | score >= 7.0 |
POST /v1/scan/input
Scans user input (prompts) for threats such as prompt injection, jailbreaks, and system prompt extraction attempts.Request
The user input text to scan.
Response
The firewall verdict:
allow, flag, or block.The aggregate anomaly score across all matched signatures.
List of matched signatures. Empty when no threats are detected.
Unique identifier for this request, for correlation and logging.
Example
Python SDK equivalent
POST /v1/scan/output
Scans LLM output for data leakage, including PII, credentials, and other sensitive content. Uses outbound decision thresholds (flag >= 3.0, block >= 7.0).Request
The LLM output text to scan.
Optional session identifier for multi-turn conversation context.
Response
Same structure asPOST /v1/scan/input: decision, score, matches, request_id.
Example
Python SDK equivalent
POST /v1/analyze/input
Analyzes user input with the full detection pipeline, including deeper PII detection. Returns the same response shape as/v1/scan/input with additional detail in the matches array when PII patterns are found.
Request
The user input text to analyze.
Optional session identifier for multi-turn conversation context.
Example
POST /v1/analyze/output
Analyzes LLM output with the full detection pipeline, including deeper PII detection. Returns the same response shape as/v1/scan/output.
Request
The LLM output text to analyze.
Optional session identifier for multi-turn conversation context.