Ask a well-built AI chatbot how to break into your neighbour’s house, and it will refuse. That refusal isn’t an accident. The companies that build these models train them to decline requests that could cause harm.
Some people try to get around that. They wrap the request in a story, ask the AI to play a character “with no rules”, or pile on clever instructions until the model goes along with it. When it works, it’s called a jailbreak. This guide explains what an AI jailbreak is, the main families of techniques at a high level, how jailbreaking differs from prompt injection, and how AI systems are defended. It’s written for understanding and defence, so it doesn’t include working jailbreak prompts.
What is an AI jailbreak?
An AI jailbreak is an attempt to trick an AI model into ignoring its safety rules or guidelines, so that it produces content or takes actions it was designed to refuse.
The term comes from phones. “Jailbreaking” an iPhone meant removing the limits the manufacturer built in. For AI, the “jail” is the set of safety behaviours a model has been trained to follow.
A jailbreak doesn’t hack the computer the AI runs on. It’s done entirely with words: the input (the prompt) is crafted to push the model into behaving differently.
How do AI safety rules work?
To understand jailbreaks, it helps to know what they’re trying to get around. A modern AI chatbot is usually protected in several layers:
- Safety training. After pre-training, models are fine-tuned on examples and human feedback that teach them to refuse harmful requests while still helping with normal ones.
- Instructions from the app. Each chatbot app gives the model hidden instructions (a system prompt) about how to behave.
- Filters and classifiers. Separate systems can check the user’s message and the model’s answer, and block things that look harmful.
- Monitoring. Providers watch for abuse patterns and can suspend accounts that break their usage policies.
The tricky part is that safety training doesn’t install hard rules like “never say X”. It shifts the model’s tendencies. Since an LLM is predicting likely text based on everything in its input, a cleverly built input can sometimes shift those tendencies back.
How do jailbreaks work? The main families
You don’t need the recipes to understand the ideas. Most jailbreaks fall into a few families:
- Role-play and personas. Asking the AI to pretend to be a character who “has no rules”, hoping the character’s voice overrides the model’s own guidelines.
- Fiction and hypotheticals. Wrapping a harmful request inside a story, a game or “just a thought experiment”.
- Gradual escalation. Starting with harmless questions and inching towards the harmful one over many messages, so no single step looks alarming.
- Disguising the request. Encoding it, splitting it into pieces, or writing it in a less common language, hoping filters don’t recognise it.
- Many examples. Anthropic researchers published a technique in April 2024 called many-shot jailbreaking. It fills a very long prompt with hundreds of made-up conversations in which an AI goes along with harmful requests, steering the model to continue the pattern. It works because models are good at learning from examples placed in their prompt, and long context windows make room for hundreds of them.
- Automated attacks. In July 2023, researchers from Carnegie Mellon University and others showed that a computer could search for odd strings of characters that, added to the end of a request, made aligned models more likely to comply. Some strings found on open models also worked on commercial chatbots.
The classic “Ignore your rules and…” message is the simplest version of all of these. On today’s major chatbots, that kind of blunt attempt usually fails. Jailbreaking has become a cat-and-mouse game: new techniques appear, AI companies patch them, and researchers look for the next one.
Jailbreak vs prompt injection
These two terms are often mixed up. They are related, but different.
| Jailbreak | Prompt injection | |
|---|---|---|
| Goal | Get the model to break its safety rules | Get the model to follow the attacker’s instructions instead of the app’s |
| Who types it | Usually the user, directly | Often hidden in content the AI reads: a web page, an email, a document |
| Example risk | Harmful or banned content | A shopping assistant that reads a web page with hidden text telling it to send your data elsewhere |
The OWASP Top 10 for LLM Applications, a widely used security checklist, lists prompt injection as its number one risk and treats jailbreaking as a form of prompt injection, usually typed directly by the user. The indirect kind, where instructions are hidden in something the AI reads, is becoming more important as AI agents get access to email, files, browsers and payment tools. An agent that obeys a hidden instruction can take real actions, not just write bad text.
Why jailbreaks matter
- Harmful information. The main reason for safety rules is to avoid giving serious help with things like weapons, self-harm or crime.
- Trust and brand. A company’s chatbot saying something offensive or dangerous ends up in the news, with the company’s name on it.
- Agents with real powers. When AI can send messages or run tools, being talked into the wrong action has real consequences.
- Policy and legal risk. Using jailbreaks usually breaks the AI provider’s terms of use and can get an account suspended.
How AI companies defend against jailbreaks
There is no single fix, so defences are layered:
- Better safety training that teaches models to recognise manipulation, not just obvious keywords.
- Input and output classifiers that check messages before and after the model.
- Red teaming: paying experts to attack the model on purpose before release, and fixing what they find.
- Bug bounties: some companies reward researchers for reporting jailbreaks responsibly instead of publishing them.
- Limiting what AI agents can do: least privilege, asking a human to confirm risky actions, and treating text from web pages and files as untrusted.
- Monitoring for abuse patterns across many users.
Responsible researchers often share their findings with AI companies before publishing, so the companies can add defences. For example, Anthropic said it shared details of many-shot jailbreaking with other AI developers before publishing.
Common misconceptions
“Jailbreaking is hacking.” It doesn’t break into any computer. It manipulates the model through its input.
“A jailbroken AI shows its true self.” There is no hidden “real” AI. A jailbreak pushes a model to produce text it was trained to avoid; it doesn’t reveal secret opinions.
“Jailbreaks only matter for people trying to get bad content.” As AI agents connect to email, files and money, prompt injection and jailbreaks become a security problem for everyone.
“A model that resists jailbreaks is perfectly safe.” No defence is perfect, which is why providers use several layers and keep updating them.
Key takeaways
- An AI jailbreak is an attempt to trick a model into ignoring its safety rules, using words alone.
- Common families: role-play, fiction framing, gradual escalation, disguised requests, many-shot examples, automated attack strings.
- Prompt injection is the broader risk: hidden instructions that hijack an AI app. OWASP ranks it number one for LLM apps.
- Defences come in layers: safety training, filters, red teaming, limited permissions and monitoring.
- It’s a constant cat-and-mouse game, so no model is perfectly jailbreak-proof.
Frequently asked questions
What is an AI jailbreak in simple words?
It’s a trick to get an AI chatbot to do something it’s designed to refuse, by writing the request in a sneaky way.
Is jailbreaking ChatGPT illegal?
It usually breaks the provider’s terms of use, which can get your account suspended. Whether it’s illegal depends on what you do and where you are; using AI output to cause harm can certainly be illegal.
What is the difference between a jailbreak and prompt injection?
A jailbreak tries to get a model to break its safety rules. Prompt injection tries to make an AI app follow an attacker’s instructions instead of the app’s own, often through hidden text in content the AI reads. Security experts often treat jailbreaking as one kind of prompt injection.
Why can’t AI companies just block all jailbreaks?
Because the model reads open-ended language, there are endless ways to phrase a request. Safety training changes the model’s tendencies rather than adding unbreakable rules, so new phrasings can sometimes get through until they are found and fixed.
Is it ever okay to try to jailbreak an AI?
Security researchers and red teams do it to find and fix weaknesses, usually with permission or through official bug bounty programmes, and they report what they find responsibly.
Comments