liveBook · Manning

Obfuscation

As explained in Generative AI in Action

Obfuscation is the transformation of content into a less recognizable representation while preserving information needed for later interpretation.

Obfuscation transforms an instruction into a less recognizable representation while preserving enough information for later interpretation. In prompt-injection attacks, encoding can disguise harmful requests from safety controls while leaving them executable after decoding. section 13.2.1

Common prompt-obfuscation patterns include:

  • Encode a prompt with Base64, then ask the model to decode and execute it. section 13.2.1
  • Hide forbidden terms by supplying partial words and requesting contextual completion. section 13.2.1
  • Combine obfuscation with broader jailbreaking strategies to bypass refusal behavior. section 13.2.1

Base64 prompt injection

A model refuses a plainly worded request about cutting down a stop sign. The attacker submits the same request as Base64 and asks the model to decode and follow it; the encoded form may produce a harmful response. section 13.2.1

Figure 13.6 Base64 prompt injection
figure

Inspect the Base64 prompt-injection example and compare the encoded request with the model’s response. section 13.2.1

How Generative AI in Action covers it

How deep it goes
Defines Base64 encoding and demonstrates an attack, but stops short of implementation or defense engineering.
Examples
Uses Base64-encoded harmful requests, partial forbidden words, universal transferable suffixes, and many-shot dialogue prompts.
What it assumes
Assumes familiarity with language models and prompt injection while defining Base64 from its transport-oriented purpose.
What you can do after
Diagnose prompt-injection weaknesses by testing whether models decode, complete, or follow obfuscated instructions.
How it connects
Connects obfuscation with prompt injection, jailbreaking, Base64 encoding, fill-in-the-blank attacks, and observability.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Generative AI in Action. The section links point to the parts of the book it draws on.