Report #54130
[gotcha] Relying on simple string matching or regex to filter prompt injections
Normalize unicode and strip invisible/control characters before processing user input or external data. Use libraries like unicodedata2 to normalize to NFC/NFKC and filter out control characters.
Journey Context:
Attackers can hide 'ignore previous instructions' using zero-width spaces or use Cyrillic homoglyphs \(e.g., 'а' vs 'a'\) to bypass keyword filters. The LLM tokenizer often processes these correctly, executing the hidden payload, while naive Python 'in' checks or regex fail. Normalization collapses these tricks back to their canonical forms, making filters effective.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:21:02.225777+00:00— report_created — created