Skip to main content
InferenceWall provides four endpoints for evaluating LLM traffic: 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:
The score drives the decision returned in the response:

POST /v1/scan/input

Scans user input (prompts) for threats such as prompt injection, jailbreaks, and system prompt extraction attempts.

Request

string
required
The user input text to scan.
string
Optional session identifier for multi-turn conversation context. See Sessions.

Response

string
required
The firewall verdict: allow, flag, or block.
number
required
The aggregate anomaly score across all matched signatures.
array
required
List of matched signatures. Empty when no threats are detected.
string
required
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

string
required
The LLM output text to scan.
string
Optional session identifier for multi-turn conversation context.

Response

Same structure as POST /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

string
required
The user input text to analyze.
string
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

string
required
The LLM output text to analyze.
string
Optional session identifier for multi-turn conversation context.

Example