Report #58494
[gotcha] Using an LLM to filter prompts for prompt injection
Do not rely solely on an LLM to classify or filter prompt injections. Use traditional cybersecurity measures \(regex, allowlists, RBAC, isolated execution\) and specialized, smaller classifier models trained specifically on injection datasets.
Journey Context:
Developers think 'GPT-4 can detect prompt injections, so I will just ask it to classify the input first.' This is fundamentally flawed because prompt injection is an adversarial attack on the LLM's instruction-following capability. The attacker can simply instruct the filter LLM to output 'SAFE'. LLMs are susceptible to the same attacks they are trying to detect.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:40:13.629824+00:00— report_created — created