What is prompt obfuscation?
Prompt obfuscation transforms a harmful instruction or request with encodings such as Base64, emoji, other languages, invisible Unicode characters, look-alike letters or splitting, so filters and detectors miss it while the model still understands it.
ASCII smuggling and token smuggling are specific techniques in this family; prompt obfuscation is the umbrella term. It is sometimes used defensively too, for protecting a system prompt from theft with an unreadable representation; this page covers the attack sense.
- Topic
- AI security
- Also known as
- Obfuscated prompt attack
How prompt obfuscation works
- The attacker picks an instruction a filter would catch.
- It is encoded, distorted with invisible or look-alike characters, translated or split.
- The filter fails to recognise it but the model decodes and follows it.
- Mitigation: stripping invisible, tag and BiDi characters, then Unicode normalisation, decoding and rechecking encoded blocks plus separate output checks.
In more detail
Unicode tag characters, the limits of NFKC and false positives
Not all invisible characters are removed by standard Unicode NFKC normalisation; ASCII smuggling relies on Unicode Tag characters (U+E0000 to U+E007F), zero-width joiners and BiDi override characters that require explicit category filtering (`Cf`) before normalisation. Conversely, aggressive stripping can break legitimate multilingual text, emojis or mathematical notation if not scoped carefully.
Programmatic, concatenated and multi-turn obfuscation
Attackers also use compositional and multi-turn obfuscation, for example defining string fragments across variables (`a="ign"`, `b="ore"`) or asking the model to solve a riddle, cipher or Python snippet that reconstructs the forbidden payload only at inference time. Single-turn static decoders cannot easily catch such deferred reconstruction.
Multimodal and document-layer obfuscation (PDF, HTML, vision language models)
In multimodal and document-grounded pipelines (RAG), obfuscation extends beyond plain text: instructions can be hidden in white-on-white PDF text, tiny fonts, HTML comments, CSS-hidden `display:none` elements or inside images rendered for vision-language models. Sanitising pipelines must inspect raw document DOM/layers rather than relying solely on OCR or rendered previews.
Commonly confused terms
| Term | How it differs |
|---|---|
| ASCII smuggling | ASCII smuggling specifically uses non-printing Unicode Tag characters (U+E0000 to U+E007F) to hide invisible instructions, whereas prompt obfuscation is the broader umbrella covering encodings, homoglyphs, multilingual switching and payload splitting. |
| Adversarial suffix attacks | Adversarial suffixes (e.g., GCG attacks) append optimised gibberish-looking tokens that exploit model gradients to trigger compliance, whereas prompt obfuscation transforms human-readable instructions so filters fail to recognise them while the LLM still decodes their meaning. |
| AI token smuggling | Token smuggling splits or disguises sensitive words across subword token boundaries or code variables so keyword/regex detectors miss them; it is a sub-technique under prompt obfuscation. |
Why prompt obfuscation matters for on-premises AI
OWASP's prompt injection scenarios include attackers using multiple languages or encoding instructions in Base64 or emoji to evade filters, as well as payload splitting. A paper on imperceptible text attacks shows a single invisible character, homoglyph, reordering or deletion can significantly reduce vulnerable models' performance, concluding text systems need input sanitisation. A study of why safety training fails names mismatched generalisation, where safety training fails to cover a domain the model's capabilities reach.
An online retailer normalises customer messages for Unicode, strips invisible characters and decodes blocks that look encoded before passing them back through its input guardrail.
Common questions
How is prompt obfuscation prevented?
Normalise input before filtering, strip invisible characters, decode and recheck encoded content and check output separately.
What is the defensive sense of prompt obfuscation?
Turning a system prompt into a representation that keeps its function but reveals nothing of its content, protecting it from theft.
Related terms
- Prompt injection
- ASCII smuggling
- AI token smuggling
- Prompt injection detection
- AI input guardrail
- Multilingual jailbreak
Sources
- OWASP Top 10 for LLM Applications 2025, LLM01: Prompt Injection
- Boucher, Shumailov, Anderson and Papernot, Bad Characters: Imperceptible NLP Attacks, 2021
- Wei, Haghtalab and Steinhardt, Jailbroken: How Does LLM Safety Training Fail?, 2023
- Pape et al., Prompt Obfuscation for Large Language Models, 2024
In the glossary: Glossary, M to Q