Jailbreak pattern detection is implemented
Why it matters
Off-the-shelf jailbreak prompts—"ignore previous instructions," "DAN mode," "you are now"—are the first tool any attacker tries because they succeed against unprotected models at a high rate. OWASP LLM01:2025 identifies these as direct prompt injection; MITRE ATLAS AML.T0054 classifies them as adversarial prompt crafting. Without a detection layer, your AI feature is vulnerable to the most amateur-level attacks documented in public jailbreak databases, not just sophisticated adversaries. For applications in regulated sectors (finance, healthcare, legal), a successful jailbreak that causes the model to produce non-compliant output creates liability exposure regardless of whether the developer "intended" the application to behave that way. NIST AI RMF MEASURE 2.6 requires demonstrable controls against known adversarial patterns.
Severity rationale
High because publicly documented jailbreak patterns have known success rates against unprotected models, making exploitation accessible to non-technical attackers with no specialized knowledge.
Remediation
Layer at least two detection mechanisms: a fast regex pass for known patterns, and a moderation API for nuanced cases. The OpenAI Moderation API is free, adds under 100ms, and catches a broad surface area.
// Layer 1: fast pattern matching
const INJECTION_PATTERNS = [
/ignore\s+(all\s+|previous\s+|your\s+)?(instructions|prompt|rules)/i,
/you\s+are\s+now/i,
/pretend\s+(you\s+are|to\s+be)/i,
/disregard\s+(previous|all|your)/i,
/forget\s+(everything|your\s+instructions)/i,
]
if (INJECTION_PATTERNS.some(p => p.test(userMessage))) {
return Response.json({ error: 'Message not allowed' }, { status: 400 })
}
// Layer 2: moderation API before primary completion
const mod = await openai.moderations.create({ input: userMessage })
if (mod.results[0]?.flagged) {
return Response.json({ error: 'Message not allowed' }, { status: 400 })
}
Update the regex list as new jailbreak patterns emerge—treat it as a living file, not a static configuration.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the AI Prompt Injection Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-1427 — Improper Neutralization of Input Used in AI/ML Prompt Injection
- owasp-llm:2025 · LLM01 — Prompt Injection
- mitre-atlas:v4 · AML.T0054 — LLM Jailbreak
- nist-ai-rmf:1.0 · MEASURE 2.6 — Evaluate AI system trustworthiness and risk posture
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-prompt-injection·automated