Skip to content
ContentLora

    Tip: press / anywhere to search.

    Explainer

    Prompt injection and jailbreaks explained

    Prompt injection is an attack in which untrusted text, typed by a user or hidden in a web page, email or file, is mixed into an AI model's prompt and changes what the model does.[1][2] A jailbreak is a kind of prompt attack aimed at getting past a model's safety restrictions.[3] OWASP ranks prompt injection as the top risk for language-model applications,[4] and the UK's National Cyber Security Centre says models do not enforce a boundary between instructions and data, and a blog post there argues it may never be fully mitigated.[5][6]

    Editor reviewedUpdated Explainer19 claims · 100% primaryAI safety and alignment, Cybersecurity
    Reading level: 1 passage differs; the rest is the same for everyone.

    This explainer describes prompt injection as security agencies and standards bodies define it, as of November 2026. It does not include working attack prompts. For AI browsers specifically, read AI browsers explained.

    What prompt injection is

    AI applications built on large language models usually combine the developer’s instructions with other text, such as a user’s question, a document or a web page, into one prompt.[1][5] NIST defines prompt injection as an attack that exploits this concatenation of untrusted input with a prompt built by a higher-trust party, such as the application designer.[1] The UK National Cyber Security Centre (NCSC) says the term was coined in 2022 and says current models do not enforce a security boundary between instructions and data inside a prompt.[5] How such models process text is explained in how large language models work.

    Imagine asking an assistant to summarise a web page, and the page contains hidden text telling the assistant to do something else. If the assistant follows it, that is indirect prompt injection.[2] OWASP notes that such instructions do not even need to be visible to people, as long as the model reads them.[4]

    NIST attributes the problem to generative models combining the data and instruction channels, which lets attackers act through the data channel by manipulating resources the system reads.[7] An NCSC blog post from December 2025 argues that, unlike in SQL injection, a language model makes no distinction between data and instructions: it only predicts the next token, so prompt injection may never be totally mitigated.[6]

    Direct, indirect and jailbreaks

    OWASP, which lists prompt injection first in its 2025 Top 10 for LLM applications,[4] distinguishes two routes:[2]

    • Direct prompt injection: the user’s own input changes the model’s behaviour, deliberately or by accident.
    • Indirect prompt injection: the model takes in content from outside, such as websites or files, that carries the instructions.

    Indirect injection was set out in a 2023 paper that showed attackers could plant prompts in data likely to be retrieved by an AI application, and demonstrated attacks on real systems including Bing Chat.[8] Multimodal models add routes such as instructions hidden in images.[9]

    A jailbreak is a related attack. NIST defines it as a direct prompting attack meant to get around restrictions on a model’s outputs, such as its refusals.[3] OWASP treats jailbreaking as a form of prompt injection in which the model is made to disregard its safety protocols entirely.[10] Testers probe for jailbreaks in AI red teaming, and the UK AI Security Institute said in December 2025 that it had found universal jailbreaks for every system it had tested.[11]

    Why it matters more for AI agents

    OWASP lists possible outcomes including disclosure of sensitive information, unauthorised access to functions available to the model and execution of arbitrary commands in connected systems.[12] NIST notes that attackers can use prompting attacks to manipulate an agent’s tool use and API calls.[13] OpenAI, for example, has said browser agents are susceptible to instructions hidden in web pages or emails, which could lead to data theft or unintended actions.[14] How agents take actions is covered in how AI agents work.

    Defences and their limits

    In 2023 the NCSC wrote that hundreds of prompt injection attacks had been published and that no failsafe measures could remove the risk.[15] OWASP says it is unclear whether fool-proof prevention exists, and that retrieval-augmented generation and fine-tuning do not fully mitigate the problem.[16]

    Defences fall into two groups:

    • Making models harder to fool. NIST lists training models to follow a hierarchy of trust in prompts, detection schemes, and processing untrusted input, such as filtering or marking it. It adds that current mitigations do not offer full protection.[17]
    • Limiting the damage. OWASP recommends least-privilege access for the model, human approval for high-risk actions, separating untrusted content and regular adversarial testing.[18] The same NCSC blog post suggests treating models as inherently confusable and reducing the risk and impact of an attack; if a system cannot tolerate the remaining risk, it may not be a good use for a language model.[19]

    Next in the crash course

    Questions readers ask

    What is prompt injection?

    An attack that exploits the way AI applications combine their own instructions with untrusted text in one prompt. NIST defines it as exploiting the concatenation of untrusted input with a prompt built by a higher-trust party, such as the application designer.[1]

    What is the difference between prompt injection and a jailbreak?

    A jailbreak is a type of prompt attack whose goal is to get around a model's safety restrictions, such as its refusals. Prompt injection is broader: OWASP describes it as prompts that alter a model's behaviour or output in unintended ways, with outcomes that can include running commands in connected systems, and treats jailbreaking as one form of it.[3][10][4][12]

    What is indirect prompt injection?

    An attack in which the instructions arrive in content the AI reads, such as a web page or file, rather than from the user. Researchers demonstrated it in 2023 against real systems including Bing Chat.[2][8]

    Can prompt injection be prevented?

    Not reliably so far. OWASP says it is unclear whether fool-proof prevention exists, NIST says current mitigations do not offer full protection, and an NCSC blog post argues it may never be fully mitigated the way SQL injection can be.[16][17][6]

    How do developers reduce the risk?

    By limiting what the AI can do: least-privilege access, human approval for high-risk actions, separating untrusted content and adversarial testing. An NCSC blog post advises designing systems to reduce the risk and impact of an attack.[18][19]

    Sources

    · 19 claims from 7 publishers

    Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.

    1. [1]

      NIST defines prompt injection as an attack that exploits the concatenation of untrusted input with a prompt built by a higher-trust party, such as the application designer. confirmedas of 2025-03-24

    2. [2]

      OWASP distinguishes direct prompt injection, where a user's own input changes the model's behaviour, intentionally or not, from indirect prompt injection, where the model takes in content from external sources such as websites or files. confirmedas of 2026-11-21

      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · Types of Prompt Injection Vulnerabilities (retrieved 2026-11-21)
      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · Types of Prompt Injection Vulnerabilities, Direct Prompt Injections (retrieved 2026-11-21)
    3. [3]

      NIST defines a jailbreak as a direct prompting attack intended to get around restrictions on a model's outputs, such as its refusal behaviour. confirmedas of 2025-03-24

    4. [4]

      OWASP's 2025 Top 10 for large language model applications lists prompt injection first (LLM01), describes it as user prompts altering a model's behaviour or output in unintended ways, and notes that injected inputs can affect a model even when they are invisible to humans. confirmedas of 2026-11-21

      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · LLM01:2025 Prompt Injection, description (retrieved 2026-11-21)
      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · LLM01:2025 Prompt Injection, description (retrieved 2026-11-21)
    5. [5]

      The UK National Cyber Security Centre (NCSC) says the term prompt injection was coined in 2022, and that current large language models do not enforce a security boundary between instructions and data inside a prompt. confirmedas of 2025-12-08

    6. [6]

      An NCSC blog post argued that, unlike SQL injection, prompt injection may never be fully mitigated, because inside a language model there is no distinction between data and instructions, only the prediction of the next token. confirmedas of 2025-12-08· interpretation

    7. [7]

      NIST says that because generative AI models combine the data and instruction channels, attackers can carry out indirect prompt injection by manipulating resources the system reads, without interacting with the application directly. confirmedas of 2025-03-24

    8. [8]

      A 2023 paper introduced indirect prompt injection, in which attackers plant prompts in data likely to be retrieved by an AI application, and demonstrated attacks on real systems including Bing Chat. confirmedas of 2023-02-23

    9. [9]

      OWASP warns that multimodal models add new prompt injection risks, such as instructions hidden in images that accompany harmless text. confirmedas of 2026-11-21

      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · LLM01:2025 Prompt Injection, description (retrieved 2026-11-21)
    10. [10]

      OWASP treats jailbreaking as a form of prompt injection in which the attacker makes the model disregard its safety protocols entirely. confirmedas of 2026-11-21

      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · LLM01:2025 Prompt Injection, description (retrieved 2026-11-21)
    11. [12]

      OWASP says prompt injection can lead to disclosure of sensitive information, manipulated content, unauthorised access to functions available to the model and execution of arbitrary commands in connected systems. confirmedas of 2026-11-21

      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · Types of Prompt Injection Vulnerabilities, outcomes list (retrieved 2026-11-21)
      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · Types of Prompt Injection Vulnerabilities, outcomes list (retrieved 2026-11-21)
    12. [13]

      NIST notes that when language models act as agents, attackers can use prompting attacks to manipulate tool use and API calls and potentially compromise the system's back end. confirmedas of 2025-03-24

    13. [14]

      OpenAI said browser agents are susceptible to malicious instructions hidden in places such as a webpage or email, which could lead to data theft from logged-in sites or unintended actions, and that its safeguards would not stop every attack. confirmedas of 2025-10-21

    14. [15]

      In 2023 the NCSC wrote that hundreds of examples of prompt injection attacks had been published and that there were no failsafe security measures to remove the risk. confirmedas of 2023-08-30

    15. [16]

      OWASP says it is unclear whether there are fool-proof ways to prevent prompt injection, and that retrieval-augmented generation and fine-tuning do not fully mitigate it. confirmedas of 2026-11-21

      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · Prevention and Mitigation Strategies (retrieved 2026-11-21)
      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · LLM01:2025 Prompt Injection, description (retrieved 2026-11-21)
    16. [17]

      NIST lists defences against indirect prompt injection including training models to follow a hierarchy of trust in prompts, detection schemes and input processing such as filtering or marking untrusted data, but says current mitigations do not offer full protection. confirmedas of 2025-03-24

    17. [18]

      OWASP's suggested mitigations include constraining model behaviour, filtering inputs and outputs, giving the application least-privilege access, requiring human approval for high-risk actions, separating untrusted content and adversarial testing. confirmedas of 2026-11-21

      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · Prevention and Mitigation Strategies, item 5 (retrieved 2026-11-21)
      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · Prevention and Mitigation Strategies, item 4 (retrieved 2026-11-21)
      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · Prevention and Mitigation Strategies, item 6 (retrieved 2026-11-21)
      • LLM01:2025 Prompt Injection · OWASP GenAI Security Project · Primary source · Prevention and Mitigation Strategies, item 7 (retrieved 2026-11-21)
    18. [19]

      An NCSC blog post recommends treating language models as inherently confusable and designing systems to reduce the risk and impact of prompt injection, adding that a system that cannot tolerate the remaining risk may not be a good use for a language model. confirmedas of 2025-12-08· interpretation

    Revision history (1)
    1. Page created.

    Created Nov 21, 2026. Last reviewed by an editor on Nov 22, 2026. Next scheduled review: Sep 6, 2027.

    Cite this page

    "Prompt injection and jailbreaks explained." ContentLora, updated Nov 21, 2026. https://contentlora.com/explain/prompt-injection-explained

    Spotted an error? Suggest a correction or emailcorrections@contentlora.com.