Jailbreak (AI)
What is a jailbreak?
A jailbreak is an input that gets a model to ignore its own rules. The model was trained and instructed to refuse certain things, and a jailbreak is the phrasing that makes it do them anyway.
The name comes from phones, where jailbreaking meant removing the manufacturer's restrictions. The idea transfers well. You are not breaking into the model, you are talking it out of the limits somebody put on it.
What gets bypassed is worth being precise about, because there are two layers. There is the safety training the provider baked into the model, and there is the system prompt you wrote for your own application: stay on the topic of our products, never quote a price, always refer medical questions to a human. A jailbreak can target either. In practice, your own rules are the softer target, because they are instructions in a prompt rather than something trained into the weights.
Jailbreak and prompt injection
These two terms get used as if they were the same thing, and the relationship is more specific than that.
OWASP places jailbreaking inside prompt injection. Prompt injection is the broad category: manipulating a model's behaviour through crafted input. Jailbreaking is the particular case where the input makes the model disregard its safety protocols entirely.
The other distinction worth carrying is direct versus indirect. A direct injection comes from the person typing. An indirect injection comes from content the model reads: a web page, an email, a document retrieved by a tool. That difference matters enormously for who the attacker can be. With a direct jailbreak, your own user is the one trying it. With an indirect one, a stranger who put text in a document you retrieved is the one trying it, and your user has no idea it is happening.
The patterns that keep working
The specific phrasings go stale quickly, because providers patch them. The shapes underneath do not.
Roleplay and fiction. Asking the model to play a character who has no restrictions, or to write a story in which a character explains the thing. The request is reframed as creative writing rather than as a request.
Encoding and obfuscation. The request is written in Base64, in leetspeak, backwards, with spaces between letters, or with lookalike Unicode characters. The model still reads it, and the safety layer sometimes does not recognise what it is looking at.
Building up over several turns. Instead of asking once, the attacker establishes context across a conversation. Each message is innocuous on its own, and the model has agreed to a frame before the actual request arrives.
Escalating gradually. A crescendo attack takes small steps, each one slightly beyond the last. No single message looks like something to refuse, and the model finds it hard to say no to a small extension of what it already said yes to.
Claiming authority. Text asserting that the developer is speaking, that the rules have been updated, or that this is an authorised test. Models have no way to verify who is typing.
What actually reduces the risk
You will not solve this at the prompt layer. A model will always be talk-out-able to some degree, so the real defence is arranging things so that a successful jailbreak does not matter much.
OWASP's prevention list for prompt injection reads like a set of architecture decisions rather than prompt tips, and that is the right instinct.
Constrain what the model may do, not just what it should say. An agent that can only read cannot be talked into writing.
Define and validate the output format. If your system expects a JSON object with three fields, an essay is rejected by your code before anyone sees it.
Filter input and output. A content safety layer around the model catches a category of attempt on the way in and a category of result on the way out.
Apply least privilege to the model's access. The model gets the permissions the task needs, and nothing else. This is the single most effective item on the list.
Require human approval for high-risk actions. Sending money, deleting records, mailing a customer. A jailbreak that reaches a confirmation dialog has not achieved much.
Separate and mark external content. Text that came from a document is data, not instruction, and your system should treat it that way.
Test adversarially. Attack your own system on a schedule, so you find out before someone else does.
What to watch out for with jailbreaks
Your system prompt is not a security boundary. Rules written in a prompt are instructions the model usually follows, not restrictions it cannot break. Anything that must never happen belongs in your code or in your permissions.
Assume the system prompt is readable. Getting a model to reveal its instructions is one of the easier jailbreaks. Do not put anything in there you would mind a customer seeing, and never put a credential in there.
Every tool widens the consequence. A jailbroken chatbot says something embarrassing. A jailbroken agent with a mailbox and a payment tool does something expensive. The exposure grows with the toolset, not with the model.
Indirect attacks bypass your user entirely. If your system reads incoming email, retrieved documents or web pages, an attacker never has to talk to your users at all.
A patch is not a fix. A jailbreak that stops working after a model update stops working for that phrasing. The shape it belongs to is still there, and someone will find the next phrasing.