prompt_injection_scan
Scan user input or prompts for common prompt injection patterns. Detects system prompt overrides, jailbreak attempts, role manipulation, encoding tricks, delimiter attacks (chat-template tags <|im_start|>/[INST]/<<SYS>> AND fake role headers imitating markdown or chat separators: "### System:", "--- SYSTEM ---", "---BEGIN SYSTEM OVERRIDE---", "---
SYSTEM:"), template/interpolation injection ({{...}}, ${...}), and context-exfiltration attempts ("repeat everything above"). A match inside quoted or fenced text (documentation citing a payload) is reported one severity level lower and marked quoted — never suppressed, since an LLM reading the document as data can still follow a quoted instruction. A quote preceded by a live imperative ("output the following: ...") keeps its full severity.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The user input or prompt to scan for injection patterns | |
| sensitivity | No | Detection sensitivity (default: medium) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | ||
| detections | No | ||
| risk_level | No | ||
| sensitivity | No | ||
| input_length | No | ||
| detections_count | No | ||
| quoted_detections | No | ||
| injection_detected | No |