guardrailsJailbreaksmulti-turn

LLM Jailbreak Techniques and Defenses

Six LLM jailbreak techniques, from role-play to many-shot and multi-turn Crescendo attacks, why they matter for agents, and defenses that work.
Nov 26, 20268 min read
Book a Demo
BotGauge blog cover: LLM Jailbreak Techniques and Defenses, in the AI Agent Red Teaming category

TABLE OF CONTENT

SHARE THIS ARTICLE

TL;DR

An LLM jailbreak gets a model to ignore its safety training. The six common techniques are role-play, hypothetical framing, encoding and translation, many-shot, multi-turn Crescendo, and automated adversarial prompts. In agents, a jailbreak is the step that unlocks a harmful tool call, so the best defense is making compliance harmless. BotGauge keeps pushing after refusals and flags the turn your agent gave ground.

What is an LLM jailbreak?

Short answer: An LLM jailbreak is an input that gets a model to ignore its safety training and produce content or actions it would normally refuse. Prompt injection overrides your app’s instructions; a jailbreak overrides the model’s own rules. In an agent, a jailbreak is rarely the end goal. It is the step that unlocks a harmful tool call.

Jailbreaks are one of the seven threat families in our guide to AI agent security. Here is how they work and how to defend against them.

Find the jailbreak before your users do

Start Now

What are the most common LLM jailbreak techniques?

Short answer: Role-play and persona, hypothetical framing, encoding and translation, many-shot jailbreaking, multi-turn escalation (Crescendo), and automated adversarial prompts.

Six common LLM jailbreak techniques

1. Role-play and persona

The user asks the model to play a character with no rules. Early examples like “DAN” (“Do Anything Now”) made this famous. Modern models resist the obvious versions, but layered fiction still works surprisingly often.

2. Hypothetical and research framing

“For a novel I’m writing…” or “For a security class, explain…” reframes a refused request as harmless.

3. Encoding and translation

The request is sent in Base64, leetspeak, a low-resource language, or split across variables, so safety training keyed to plain English doesn’t trigger.

4. Many-shot jailbreaking

A long prompt contains dozens or hundreds of fake dialogue examples where an assistant complies. Anthropic described this technique in 2024 and showed it gets more effective as context windows grow.

5. Multi-turn escalation (Crescendo)

The attacker starts benign and moves toward the goal over several turns, using the model’s own earlier answers as leverage. Microsoft researchers named this pattern Crescendo in 2024. It is especially dangerous for agents, as covered in our guide to multi-turn attacks on AI agents.

6. Automated adversarial prompts

Optimization methods, such as the adversarial suffixes in Zou et al. (2023), or attacker LLMs generate strings that break safety training. These scale far beyond what humans write by hand.

Test injection and jailbreaks together

Start Now

What is the difference between a jailbreak and prompt injection?

Short answer: Prompt injection overrides your app’s instructions; a jailbreak overrides the model’s own safety rules. Real attacks often combine them.

They are often combined. A typical agent attack uses prompt injection to get its instructions in, and a jailbreak to get the model to follow them. See these prompt injection examples against agents for the injection side.

How do you defend against LLM jailbreaks?

Short answer: Don’t depend on refusal: limit what compliance can do, judge whole conversations, normalize inputs, cap example dialogue, and re-test on every change.

Layered LLM defenses: input checks, system prompt, model alignment, output checks and tool permissions.
  • Don’t depend on refusal. Assume the model will eventually comply, and make sure compliance can’t cause harm: least privilege, hard limits in code, approval for high-impact actions.
  • Conversation-level guardrails. Judge the whole conversation, not only the latest message, so escalation becomes visible.
  • Input normalization. Decode, translate and normalize inputs before classifiers see them.
  • Context limits. Cap how much user-supplied example dialogue reaches the model, which blunts many-shot attacks.
  • Continuous testing. New jailbreaks appear constantly, and model updates change what works. Re-test on every model or prompt change.

How are jailbreak attacks and defenses classified?

Short answer: Attacks split into white-box (using model internals) and black-box (using prompts only). Defenses split into prompt-level and model-level.

Attack familyNeedsExamples
White-boxAccess to model weights or outputsGradient-based suffixes, logits-based attacks, fine-tuning attacks
Black-boxOnly the ability to send promptsTemplates and role-play, rewriting in other languages, attacker LLMs
Defense familyWhere it worksExamples
Prompt-levelAround the model, without changing itInput filters, prompt rewriting, a second model checking outputs
Model-levelInside the modelSafety training, fine-tuning on attack examples

This split comes from Yi et al.’s survey of jailbreak attacks and defenses. For agents, most teams only control the prompt level, which is why limits on actions matter more than any single filter. Measure progress with an attack success rate across many attempts, not one test.

Re-test on every model change

Start Now

The bottom line

Assume your model will eventually be jailbroken, and make sure that moment can’t cause harm. Then keep testing, because what works against your model changes with every update.

The BotGauge AI agent red teaming platform keeps pushing after refusals, adapts its framing turn by turn, and flags the exact turn where your agent gave ground.

Find the jailbreak before your users do. BotGauge is an AI agent red-teaming platform. Start for free or book a 30-minute demo.