prompt_injection_audit
Statically analyze system prompts for prompt-injection vulnerabilities: identify untrusted placeholders, missing delimiters, dangerous instructions, and precedence inversion.
Instructions
Statically analyze a system prompt / template for prompt-injection surface.
Reports:
placeholders (jinja
{{x}}, fstring{x}, dollar${x}, percent%(x)s) with a trust classification (untrusted / trusted / unknown)missing-delimiter findings: untrusted placeholders not wrapped in XML tags / triple-backticks / triple-quotes /
[START]..[END]etc.dangerous-instruction patterns (
ignore previous instructions, role overrides, trust-boundary violations, system-prompt leakage hints, special-token sequences)precedence-inversion: untrusted content placed near the end with no instruction reinforcement after it
Pure function. No LLM call, no I/O, no chaining.
Args: prompt: The system prompt or template text.
Returns: Structured AuditReport.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "prompt_injection_audit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes |