AI

AI Jailbreak vs Prompt Injection: The Difference

An AI jailbreak tricks a model into breaking its own safety rules; prompt injection hijacks an app. Types, real research examples, risks and how to defend.

By OmniAI Editorial · Nov 20, 2026 · 11 min read

An AI jailbreak is an attempt to get an AI model to produce content or take actions its developers trained it to refuse, such as harmful instructions, by wrapping the request in role-play, fiction, encoded text, long fake conversations or many small steps. Prompt injection is a related but different attack: it hides new instructions inside content an AI application processes, such as a web page, email or document, so the application does something its developer didn't intend, like leaking data or calling a tool. Put simply, a jailbreak targets the model's safety training, while prompt injection targets the application's instructions and trust boundaries. The two often overlap, and attackers chain them.

This guide explains what an AI jailbreak is, how it differs from prompt injection, the main jailbreak techniques documented in research, why it matters more for AI agents, whether jailbreaking is legal, and how developers defend against both.

What Is an AI Jailbreak?

Large language models are trained not only to be helpful but also to refuse certain requests: instructions for weapons, malware, self-harm content, harassment and other harms defined in each provider's policies. That refusal behaviour comes from safety training, such as reinforcement learning from human feedback and constitution-based methods, and from extra filters around the model.

An LLM jailbreak is any technique that gets around those safeguards. The term borrows from phone "jailbreaking", where users remove a manufacturer's restrictions. A jailbreak prompt is the text used to do it. Early, famous examples were "DAN" ("Do Anything Now") prompts that asked ChatGPT to pretend to be an unrestricted alter ego.

Researchers describe the goal of a jailbreak as closing the gap between what a model can do and what it's willing to do. The more capable models become, the more that gap matters.

Jailbreak vs Prompt Injection

The jailbreak vs prompt injection distinction was popularized by Simon Willison, who coined the term "prompt injection" in 2022 and has argued that mixing up the two leads to the wrong defences:

AI jailbreakPrompt injection
TargetThe model's safety training and content policiesThe application's instructions, data and tools
AttackerUsually the user typing into the chatOften a third party who controls content the AI reads
DeliveryDirectly in the conversationDirectly, or indirectly through web pages, emails, documents, images or tool outputs
Typical goalGet restricted content (harmful instructions, policy-violating text)Exfiltrate data, misuse tools, change outputs, spread to other systems
Who's harmedMainly third parties and the provider's policiesThe user and the organization running the app
Main defenceModel-level safety training and classifiersSystem design: least privilege, isolation, confirmations, filtering untrusted content

They overlap in practice. A malicious web page can carry a jailbreak payload inside an indirect prompt injection, and some security frameworks, including the OWASP Top 10 for LLM applications, treat jailbreaking as a form of prompt injection. Our guide to prompt injection covers that attack and its defences in depth.

On the left a grey figure, a light speech bubble and an ink arrow to a grey chip; a dotted ink divider; on the right a light browser window with ink lines, one of them orange, and an ink arrow to a grey box above two light circles.
A jailbreak attacks the model's rules; prompt injection attacks the app around it.

Common Jailbreak Techniques

Researchers and red teamers have documented many families of jailbreaks. The examples below describe how they work at a high level, without reproducing working attacks:

  • Role-play and persona prompts: asking the model to act as a character without rules, or to write "fiction" in which a character explains something harmful.
  • Hypotheticals and framing: presenting a harmful request as research, a test, a historical question or a safety exercise.
  • Obfuscation and encoding: hiding the request in another language, code, ciphers, unusual formatting or spelling, hoping safety training doesn't generalize.
  • Multi-turn escalation: starting with innocent questions and slowly steering the conversation, so each step seems small.
  • Many examples in the prompt: filling a long context window with fake dialogue in which an assistant complies with harmful requests.
  • Automated attacks: algorithms that search for prompt variations or adversarial strings that make a model comply.
  • Multimodal attacks: instructions hidden in images or audio rather than text.

Jailbreak Research: A Timeline

Published research shows how techniques and defences have evolved:

WhenResearchWhat it showed
July 2023Universal and Transferable Adversarial Attacks on Aligned Language Models (Zou and colleagues)Automatically generated adversarial suffixes appended to prompts could make several aligned models comply, and often transferred between models
April 2024Crescendo (Microsoft researchers)A multi-turn jailbreak that starts with harmless questions and escalates gradually, referencing the model's own earlier answers
April 2024Many-shot jailbreaking (Anthropic)Long context windows let attackers include many fake examples of compliance, making harmful answers more likely; effective on models from several companies
December 2024Best-of-N jailbreaking (Anthropic and collaborators)Simply sampling many random variations of a prompt, such as shuffled letters or capitalization, eventually succeeded, with attack success rates of 89% on GPT-4o and 78% on Claude 3.5 Sonnet at 10,000 samples
January 2025Constitutional Classifiers (Anthropic)Classifiers trained on synthetic data from a written "constitution" of allowed and forbidden content; in over 3,000 estimated hours of red teaming, no one found a universal jailbreak against an early prototype

The pattern: attacks get cheaper and more automated, defences add layers outside the model, and no model is fully jailbreak-proof.

Jailbreaks in Images and Audio

Multimodal models add new ways in. Instructions can be written into an image as text, hidden in small print or patterns, or spoken in an audio clip, and a model that reads images and listens to audio may treat them as part of the request. Research on Best-of-N jailbreaking found that the same "try many random variations" approach also worked against vision and audio inputs, for example by changing an image's colours or an audio clip's speed and pitch. For developers, the lesson is to treat images, audio and video from untrusted sources with the same caution as untrusted text.

Why Jailbreaks Matter More for AI Agents

When a chatbot is jailbroken, the result is usually text that violates a policy. When an AI agent with tools is jailbroken or injected, the result can be actions: sending emails, running code, moving money, deleting files or leaking private data. That's why agent builders treat jailbreak resistance as one layer of defence, never the only one. The model's refusal training can fail; the system around it must still prevent serious harm.

Common risks for agents include:

  • Tool misuse after instructions are injected through a web page or document the agent reads.
  • Data exfiltration by persuading the agent to include private data in a link, image request or message.
  • Escalation across connected systems, such as MCP servers, email and file storage.
Three nested rounded rectangles drawn in ink, light, grey and light, around a grey chip in the centre, with an orange dot on the outer layer.
Layered defences limit the damage when a jailbreak gets through.

Is AI jailbreaking legal? The short answer: experimenting with prompts isn't generally a crime in itself, but it's not risk-free.

  • Terms of service: AI providers' usage policies prohibit attempts to bypass safety measures for harmful purposes, and they can suspend or ban accounts.
  • What you do with the output matters: using a jailbreak to obtain help with illegal activity, malware, fraud or harassment can break laws regardless of how the content was produced.
  • Computer misuse laws: attacking someone else's AI application, for example to extract data through prompt injection, can fall under unauthorized-access laws in many countries.
  • Authorized security research: many AI companies run bug bounty programs and red-teaming partnerships that invite jailbreak research under clear rules. That's the legitimate route for finding and reporting weaknesses.

Laws differ by country, so this isn't legal advice. If you want to research jailbreaks, do it through official programs or on models you're licensed to test, and report findings responsibly.

How AI Companies Defend Against Jailbreaks

Model providers use several layers:

  1. Safety training that teaches the model to recognize and refuse harmful requests, including disguised ones.
  2. Input and output classifiers that screen prompts and responses for policy violations, such as Anthropic's Constitutional Classifiers.
  3. Monitoring and rate limits that spot accounts probing systematically and slow automated attacks.
  4. Red teaming before and after launch, by internal teams and outside experts; our guide to AI red teaming explains the process.
  5. Bug bounties that pay researchers to report universal jailbreaks.

How Developers Can Defend Their Apps

If you build on top of a model, you inherit its safety training but need your own controls:

  • Treat the model as untrusted. Assume it can be talked into anything, and design so that's survivable.
  • Least privilege for tools: give agents only the permissions they need, scoped to the user, with confirmations for risky actions such as payments, deletions and outbound messages.
  • Separate untrusted content: mark retrieved documents, web pages and emails as data, not instructions, and don't let them trigger privileged tools on their own.
  • Use guardrails: input and output filters, topic restrictions and checks for sensitive data; our guide to AI guardrails covers tools and patterns.
  • Limit output channels: block or sanitize links and images that could carry data out.
  • Log and monitor prompts, tool calls and refusals, and alert on suspicious patterns.
  • Test continuously with jailbreak and injection test suites as part of your evaluations, not just once before launch.

Jailbreaks and Open-Weight Models

Jailbreaking works differently for models whose weights anyone can download. Researchers have shown that refusal behaviour in many open chat models is controlled by a surprisingly simple internal mechanism: a 2024 study found that across 13 popular open models, refusals could be switched off by removing a single "direction" from the model's internal activations. Techniques based on this, sometimes called "abliteration", and ordinary fine-tuning can strip safety behaviour out of downloaded weights entirely.

That doesn't make open models unusable for responsible deployments, but it shifts responsibility. When you deploy an open-weight model, you can't rely on the original developer's refusals staying in place if someone else controls the weights, and the guardrails, monitoring and permission limits you build around the model become the main line of defence.

How to Report a Jailbreak Responsibly

If you discover a jailbreak that bypasses a model's safeguards in a serious way, report it rather than publishing it:

  1. Check the provider's security or bug bounty page for a reporting address and the rules for safe-harbour research.
  2. Describe the impact clearly: which model, what kind of restricted output or action was possible, and how reliable the technique is.
  3. Share minimal reproduction steps privately, without posting working attacks publicly.
  4. Give the provider time to fix it before discussing it publicly, following the program's disclosure guidelines.

Many AI companies explicitly invite this kind of research, and some offer rewards for universal jailbreaks that defeat their newest safeguards.

Common Misunderstandings

  • "A good system prompt prevents jailbreaks." System prompts help set behaviour, but they're not a security boundary; users and injected content can override them.
  • "Jailbreaks are only about offensive content." In agent systems, the bigger risk is unwanted actions and data leaks.
  • "Detectors solve it." Classifiers reduce risk but can be bypassed; combine them with system-level controls.
  • "Open models can't be protected." Once weights are released, built-in refusals can be removed by fine-tuning, so the deployer's own safeguards matter even more.

FAQ

What is an AI jailbreak?

An AI jailbreak is a technique for getting an AI model to ignore its safety training and produce content or take actions it would normally refuse, often using role-play, hypothetical framing, encoding or multi-step conversations.

What is the difference between a jailbreak and prompt injection?

A jailbreak targets the model's own safety rules, usually by a user in the chat. Prompt injection targets an application built on the model, often by hiding instructions in content the AI reads, to hijack its behaviour, tools or data. One attack can combine both.

Is AI jailbreaking legal?

Experimenting with prompts isn't generally illegal by itself, but it usually breaks providers' terms of service, and using the output for illegal purposes or attacking other people's AI systems can break the law. Authorized red teaming and bug bounty programs are the legitimate way to research jailbreaks.

Can AI models be made jailbreak-proof?

Not completely. Research shows that new techniques keep appearing and automated attacks can eventually succeed against many models. Layered defences, such as safety training, classifiers, monitoring and limited permissions, make jailbreaks much harder and less harmful.

What is a jailbreak prompt?

A jailbreak prompt is the text someone uses to try to bypass an AI model's safety rules, such as a role-play setup, a disguised request or a long series of fake example conversations.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog