This article explains AI jailbreaking—techniques that bypass a language model's safety training to produce refused outputs—and distinguishes it from prompt injection, which targets application-level instructions instead. The article covers why models are vulnerable, the main families of jailbreak techniques, the actual risks they pose, and both defensive measures providers deploy and controls application builders can implement. Understanding jailbreaking matters because no model has proven immune, and security teams must manage this risk through tested, responsible approaches rather than assume it is solved.
- Safety training is learned behavior, not codeModels learn refusals through training, not through hard-coded rules, which makes them vulnerable to competing trained behaviors. The model is simultaneously trained to be helpful, follow instructions, play roles, and continue patterns, so jailbreaks work by pitting these tendencies against safety training until one wins. Because language allows infinite phrasings of the same request, providers cannot test every possibility.
- Five core families of jailbreak techniquesFraming and role-play wrap requests in stories or personas; multi-turn escalation (documented as Crescendo by Microsoft in 2024) starts harmlessly and gradually moves toward the goal; many-shot (published by Anthropic in April 2024) fills prompts with examples to establish patterns; obfuscation disguises requests through encoding or language switching; and instruction override claims new rules apply, including the Skeleton Key method Microsoft described in June 2024. Nearly all new techniques fall into these families, making them more important to learn than individual prompts.
- Jailbreaking and prompt injection are distinct threatsJailbreaking targets the model's own safety training to produce output its maker trained it to refuse, while prompt injection targets the application built around the model to make it ignore its developer's instructions. The two often combine—an attacker may use injection to deliver a jailbreak, or a jailbreak to make injection work—but they harm different parties and require different fixes: model providers address jailbreaking; application developers address injection.
- Risk escalates with system capability and scopeFor public chatbots, jailbreaks may only produce text the user could find elsewhere, but risks rise sharply with what the system can do: brand and legal exposure from statements under the company's name, policy bypass in customer-service or education tools, harmful uplift through detailed help with dangerous activities, and removing model caution from agents with tool access before steering them toward attacks.
- Provider defenses reduce success, not eliminate itProviders use safety training across many phrasings (retrained as new techniques emerge), input and output classifiers (Anthropic's Constitutional Classifiers, published 2025, reported large reductions in successful jailbreaks at modest cost), red teaming and bug bounties before and after release, and monitoring to detect repeated attempts at account level. No current technology fully prevents jailbreaking; the goal is to reduce success rates and raise effort required.
- Application-level controls limit jailbreak impactBuilders can narrow the assistant's job scope (reducing what it can get wrong, though scope instructions themselves can be bypassed), use independent output checks with a second model or rule set (adding cost and delay), limit context length and conversation turns (reducing room for many-shot and escalation but potentially harming legitimate tasks), keep the model away from consequences (effective for text-only output but not for agents), and implement logging and rate-limiting to detect repeated probing.
- Responsible testing requires permission and structureTesting should only proceed on systems you own or have written permission to test, within the provider's usage policy. Effective assessment requires writing specific system-level requirements, covering each technique family with one or two representative tests (not fifty variations of one), repeating each test and reporting rates rather than yes/no answers (such as 3 of 20 attempts), recording all inputs, outputs, model versions and settings for reproducibility, and reporting model weaknesses to the provider through disclosure programs and application weaknesses to developers.
- Newer models resist known techniques but face new attacksLater model releases are generally harder to jailbreak with known techniques because they are trained against them, but new techniques are discovered every few months, and expanding capabilities like larger context windows and tool use open additional attack routes. Jailbreaking differs from system prompt leaks, which reveal hidden application instructions rather than defeat the model's safety training.
Bottom line: Jailbreaking cannot be fully prevented with current technology, so security must assume it will succeed and design systems so that a jailbreak alone cannot cause serious harm, using layered controls including narrowed scope, output checks, rate-limiting, and testing before and after every model change. Testing resistance responsibly—with permission, specific requirements, repeated samples, recorded data, and proper disclosure—is the path builders and security teams should follow.
AI jailbreaking means getting a language model to produce output its maker trained it to refuse. The model has safety behaviour built in through training, and a jailbreak is any input that gets around it. No model released so far has been immune, which is why jailbreak resistance is measured and managed, not declared solved.
This guide explains what jailbreaking is, how it differs from prompt injection, the broad families of technique, why the problem is hard to close, and what builders and security teams can do about it. It describes how the techniques work in principle and does not include working jailbreak text.
Jailbreaking and prompt injection are not the same
| Jailbreaking | Prompt injection | |
|---|---|---|
| Target | The model’s own safety training | The application built around the model |
| Goal | Output the model’s maker does not allow | Making the application ignore its developer’s instructions |
| Who is harmed | Often nobody directly; sometimes the public or the provider | The application’s users and owner |
| Who fixes it | Mostly the model provider, plus the application’s own filters | The application developer |
The two are often combined. An attacker may use an injection to deliver a jailbreak, or a jailbreak to make an injection work. Our prompt injection guide covers the other half.
Why models can be jailbroken
A model’s refusals are learned behaviour, not rules in code. Training teaches the model that certain requests should be declined, but the same model is also trained to be helpful, to follow instructions, to continue patterns and to play roles. A jailbreak works by setting those other tendencies against the refusal until one of them wins. Because language allows endless ways to phrase a request, the provider can never test every one.
The main families of technique
- Framing and role-play. The request is wrapped in a story, a persona or a hypothetical, so that answering looks like staying in character.
- Multi-turn escalation. The conversation starts harmlessly and moves towards the goal in small steps. Microsoft researchers documented this pattern in 2024 under the name Crescendo.
- Many-shot. A very long prompt is filled with examples of the behaviour wanted, and the model continues the pattern. Anthropic published this in April 2024 and showed it becomes more effective as context windows grow. We cover it in our many-shot tutorial.
- Obfuscation. The request is disguised through encoding, another language, deliberate misspelling or splitting across messages, so filters and training do not recognise it.
- Instruction override. The prompt claims new rules apply. Microsoft described one widely effective form in June 2024 as Skeleton Key.
- Automated adversarial inputs. Software searches for strings that push a model towards compliance. Academic work in 2023 showed such strings can transfer between different models.
New named techniques appear every few months. Almost all of them fall into one of these families, which is why it is more useful to learn the families than to collect individual prompts.
What is actually at risk
For a public chatbot, a jailbreak usually produces text the user could have found elsewhere. The stakes rise with what the system can do:
- Brand and legal exposure. A company’s assistant producing offensive or false statements under its name.
- Policy bypass in products. A customer-service or education assistant doing things its operator promised it would not.
- Harmful uplift. Detailed help with seriously dangerous activity, the case model providers work hardest to prevent.
- A step in a larger attack. Removing a model’s caution before steering an agent that has tools. See our AI agent security guide.
How providers defend
- Safety training. The model learns to refuse across many phrasings, and is retrained as new techniques are reported.
- Input and output classifiers. Separate models screen what goes in and what comes out. Anthropic’s Constitutional Classifiers work, published in 2025, reported large reductions in successful jailbreaks at a modest cost in extra refusals.
- Red teaming and bug bounties. Internal teams and outside researchers attack models before and after release.
- Monitoring and enforcement. Repeated attempts are detected at account level.
What builders should do
| Control | What it does | Its limit |
|---|---|---|
| Narrow the assistant’s job | A system that only answers about your product has less to get wrong | Scope instructions can themselves be bypassed |
| Independent output checks | A second model or rule set reviews responses before the user sees them | Adds cost and delay |
| Limit context length and turns where possible | Reduces room for many-shot and slow escalation | May hurt legitimate long tasks |
| Keep the model away from consequences | If output cannot trigger actions, a jailbreak stays as text | Not possible for agents; use approvals there |
| Log and rate-limit | Repeated probing is visible and slowed | Detects; does not prevent |
| Test before launch and after every model change | You find the failures first | Results are a sample, never proof |
Testing jailbreak resistance responsibly
Test only systems you own or have written permission to test, and stay within the provider’s usage policy. A sound assessment works like this:
- Write down what the system must never do. Be specific to the product, not generic.
- Cover each family above. One or two representative tests per family tells you more than fifty variations of one.
- Repeat every test. Models are probabilistic. Report a rate, such as 3 of 20 attempts, not a yes or no.
- Record everything. Input, output, model version and settings, so the finding can be reproduced and retested.
- Report to the right owner. Model-level weaknesses go to the provider through its disclosure programme; application-level ones go to the developer.
Our AI red teaming guide explains how this fits into a full engagement.
Frequently asked questions
Is jailbreaking an AI illegal?
It depends on where you are, what system it is and what you do with the result. It usually breaks the provider’s terms of service, which can cost you the account. Testing a system without permission, or using the output to cause harm, can break the law. Authorised testing and published research programmes are the safe routes.
Can jailbreaking be fully prevented?
Not with current technology. Providers reduce the success rate and raise the effort needed. Systems should be designed so that a jailbreak alone cannot cause serious harm.
Are newer models harder to jailbreak?
Generally yes for known techniques, since each release is trained against them. New techniques keep being found, and larger context windows and tool use open new routes.
Is a jailbreak the same as a system prompt leak?
No. A leak reveals an application’s hidden instructions, which is a prompt injection outcome. A jailbreak defeats the model’s safety training.
Where can I practise legally?
On systems built for it. The SecurityElites labs run against live models in a safe range, and the SE-ARTCP certification tests the skill hands-on.
