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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes |