Regex-based detection of instruction-override, prompt-extraction, jailbreak, and role-spoofing attempts — before they reach a model.
Prompt injection is an attack where a user crafts input designed to make the model ignore your system prompt and follow attacker-supplied instructions instead. OpenDunes screens incoming requests against a curated pattern set derived from the OWASP LLM Prompt Injection Prevention Cheat Sheet, evaluated locally at the gateway — detection is free and adds minimal latency.
Detection is on by default in flag mode — matches are recorded to your audit trail but nothing is blocked or rewritten until you opt into redact or block. Adjust it in Settings → Guardrails. (The dashboard persists it through the session-authenticated PUT /api/user/guardrails — a dashboard endpoint, not part of the key-authenticated /v1 API.)
When a pattern matches, the configured action is taken:
[PROMPT_INJECTION] and the sanitized request is forwarded to the model.403 before it reaches a model. No tokens are billed.HTTP status 403. The model is never called.
All user-supplied message content is checked against these case-insensitive patterns, grouped by technique:
| Category | Detects |
|---|---|
| Direct instruction override | "Ignore all previous instructions", "disregard prior rules", "forget the above guidelines", "new instructions:", "do not follow the system…", "supersedes prior directives", "previous instructions are void" |
| Developer / admin mode | "you are now in developer mode", "enter admin/debug/maintenance mode", "activate jailbreak mode" |
| System override | "system override", "override your instructions/rules/constraints" |
| Prompt extraction | "reveal your (hidden/secret/full) system prompt", "show me your prompt", "what are your exact instructions", "repeat the text above", "output your original prompt" — including common typo variants ("systme", "sysetm") |
| Role manipulation | "you are no longer bound/restricted", "act as if you're not bound", "pretend you're a different AI", identity-hijack framings with malicious modifiers |
| DAN-style jailbreaks | The classic "DAN … do anything now" prompt, "jailbreak mode/prompt" |
| Safety bypass | "bypass/disable your safety filters", "ignore your security guidelines" |
| Tag injection & role spoofing | <system> / <assistant> / <tool> tag injection, [system]: role delimiters, bracketed role labels ([System Message]), lines starting with System: |
| Control token injection | ChatML / Llama 3 tokens (<|im_start|>, <|eot_id|>, …) and DeepSeek fullwidth-pipe control tokens |
Beyond the regex patterns, three evasion detectors run on every scan:
ignroe for ignore) of the target words ignore, bypass, override, reveal, delete, system, prompt, instructions.i g n o r e p r e v i o u s is collapsed and re-scanned against all patterns.flag mode first, and exempt known-safe phrases with the Allowlist.Every detection is recorded with the matched detector names and the action taken. See Guardrails for details.