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

  1. The attacker picks an instruction a filter would catch.
  2. It is encoded, distorted with invisible or look-alike characters, translated or split.
  3. The filter fails to recognise it but the model decodes and follows it.
  4. 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

TermHow it differs
ASCII smugglingASCII 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 attacksAdversarial 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 smugglingToken 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.

ON-PREMISES EXAMPLE

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.

Sources

In the glossary: Glossary, M to Q

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.