An employee asks the company AI assistant to summarise this week's supplier emails. One of those emails was written for the assistant, not for the employee. It tells the model to gather internal information and send it somewhere else. Nobody clicks anything.
That is the shape of prompt injection attacks: instructions hidden inside content an AI model reads, which the model then follows as if they came from its owner. They work because large language models do not separate instructions from data. The UK National Cyber Security Centre puts it plainly: current models "do not enforce a security boundary between instructions and data inside a prompt."
For security leaders, the question is no longer whether a model can be tricked. It can. The question is what the tricked model can reach, and what it can send.
This guide covers direct and indirect AI prompt injection, real examples, the difference from jailbreaking, and the controls that limit the damage.
Table of contents
- What prompt injection attacks are, and why they work
- Direct vs indirect prompt injection
- Prompt injection examples
- Prompt injection vs jailbreak
- Why filters alone will not stop it
- How to prevent prompt injection from becoming a breach
- What security leaders should do now
- Frequently asked questions
Key takeaways
- Prompt injection attacks place instructions inside content an AI model processes, and the model may follow them instead of its owner's instructions.
- The UK NCSC wrote in December 2025 that prompt injection may never be totally mitigated, because models draw no inherent distinction between data and instructions.
- Indirect prompt injection is planted by a third party in emails, web pages, documents or tool descriptions, and the person harmed is often the model's own user.
- EchoLeak (CVE-2025-32711) showed that a single crafted email could make Microsoft 365 Copilot exfiltrate data with no user interaction.
- The defences that hold limit what a model can reach and send: scoped permissions, egress control, human approval for high-risk actions and policy enforced on every connection.
What prompt injection attacks are, and why they work
OWASP ranks prompt injection first in its Top 10 for LLM Applications 2025, as LLM01. Its definition is deliberately broad: a vulnerability that occurs when prompts alter a model's behaviour or output in unintended ways.
The mechanism is simple. An application joins its own instructions with content it did not write: a user's message, a retrieved document, a web page, an API response. The model receives one sequence of tokens and has no reliable way to tell the operator's instructions from data phrased as a command.
That is why the comparison with SQL injection misleads. SQL injection is mitigated by keeping code and data in separate channels, for example with parameterised queries. The NCSC's analysis of prompt injection argues that no equivalent separation exists inside a language model, and concludes that "it's very possible that prompt injection attacks may never be totally mitigated."
Key Insight
A language model reads instructions and data as one stream. Any content it processes can try to give it orders, so the security question is what the model can do when it obeys.
A model that only writes text can be embarrassed by an injection. A model that can call tools, read mail or fetch URLs can be steered into acting. Our guide to LLM security argues that the real risk is that blast radius; this piece focuses on the trigger, so your teams can recognise prompt injection attacks when they arrive.
Direct vs indirect prompt injection
NIST's adversarial machine learning taxonomy, NIST AI 100-2 E2025, separates the two by who delivers the instruction.
Direct prompt injection comes from the person typing: a user tells a bot to ignore its instructions or reveal its system prompt. The attacker and the user are the same party, so the damage is usually bounded by what that session can reach.
Indirect prompt injection comes from somewhere else. NIST describes these attacks as mounted "not by the primary user of a model but instead by a third party," who plants instructions in resources the system will later process. In many cases, NIST notes, it is the primary user who is harmed.
Researchers set out indirect prompt injection attacks systematically in a 2023 paper, arguing that LLM-integrated applications "blur the line between data and instructions" and demonstrating them against real systems, including Bing's GPT-4 powered chat.
| Direct prompt injection | Indirect prompt injection | |
|---|---|---|
| Who plants the instruction | The user of the AI system | A third party who never touches the interface |
| Where it hides | The chat box or API request | Emails, web pages, documents, tickets, tool descriptions and tool outputs |
| Typical victim | The application owner | The user, and the organisation whose data the model can reach |
| Control that matters most | Input handling and output validation | Limiting what the model can access and send |
Prompt injection examples
The prompt injection attacks below come from disclosed vulnerabilities, published research and the OWASP and NIST catalogues. Each shows a different delivery route.
1. An email that talks to the assistant
EchoLeak, tracked as CVE-2025-32711 with a CVSS score of 9.3, affected Microsoft 365 Copilot. The researchers' published case study describes "remote, unauthenticated data exfiltration via a single crafted email." The email sat in the mailbox until a user asked Copilot an ordinary business question. Retrieval pulled the email into context alongside internal data, and the hidden instructions did the rest.
The exploit chained bypasses: it evaded Microsoft's cross-prompt injection classifier, slipped past link redaction with reference-style Markdown, used automatically fetched images, and abused a Microsoft Teams proxy that the content security policy allowed. Microsoft fixed it in June 2025; reporting at the time said there was no evidence of malicious exploitation.
2. A web page that rewrites the summary
OWASP's indirect injection scenario is a user asking an LLM to summarise a web page that contains hidden instructions. The instructions make the model insert an image whose URL carries the private conversation to the attacker. The user sees a summary. The attacker receives the chat.
Hidden is literal. NIST lists hiding techniques including text in non-visible parts of a resource, multi-stage injections and Base64-encoded commands the model is told to decode.
3. A poisoned document in the knowledge base
Retrieval-augmented generation (RAG) systems answer from an internal document store. NIST describes research in which a single crafted document inserted into a RAG knowledge base can steer answers to targeted queries. Anyone who can edit a wiki page or upload to a shared drive may be able to place one.
4. A tool description that carries orders
In April 2025, Invariant Labs described tool poisoning attacks: malicious instructions embedded in the description of a Model Context Protocol tool, "invisible to users but visible to AI models." Their proof of concept was a harmless-looking add tool whose description told the model to read the user's MCP configuration file and SSH private key, then pass them out through an extra parameter. The user saw a calculator. Agents read tool descriptions as trusted context, which is why our companion guide to securing MCP servers treats them as untrusted input.
5. A link or image that carries data out
A recurring exfiltration channel is the rendered output itself. If a model can be told to produce a Markdown image or link whose URL contains data from its context, the client that fetches or displays that URL completes the leak. NIST notes that attackers may be able to exploit Markdown image rendering to exfiltrate data. EchoLeak used the same idea with automatically fetched images.
6. A message that spreads itself
NIST also describes self-propagating injections: a malicious email that, when read by an assistant built into an email client, instructs it to send similar emails to everyone in the user's contact list. The prompt behaves like a worm.
Key Insight
Every one of these examples ends the same way: the model did what the content told it to do, using access it legitimately held. Injection is the entry point. Permissions and egress decide the damage.
Prompt injection vs jailbreak
The two terms are often used interchangeably. OWASP treats jailbreaking as a form of prompt injection in which the attacker's inputs cause the model to disregard its safety protocols entirely. The difference that matters to a security team is the goal and the victim.
| Jailbreak | Prompt injection (broader) | |
|---|---|---|
| Goal | Make the model produce content its safety training should refuse | Make the model follow the attacker's instructions, including actions |
| Typical attacker | The user | The user (direct) or a third party (indirect) |
| Typical delivery | Crafted prompts, role-play, adversarial suffixes | Any content the model processes |
| Primary harm | Harmful or policy-breaking output | Data exfiltration, unauthorised actions, manipulated decisions |
| Where it is addressed | Model training and output filtering | System design: permissions, isolation, egress control, approval |
A jailbreak is mostly a problem for the model provider and the brand. Indirect prompt injection attacks are a problem for the CISO, because they turn your own AI tools against your own data.
Why filters alone will not stop it
The instinct is to filter: detect malicious instructions on the way in and strip suspicious output on the way out. Filtering helps. It is not a boundary.
OWASP states that, given the stochastic way models work, "it is unclear if there are fool-proof methods of prevention for prompt injection." It also notes that RAG and fine-tuning do not fully mitigate the problem. NIST lists training-based defences, detection schemes and input processing techniques such as spotlighting, then says that current mitigations "do not offer full protection against all attacker techniques." EchoLeak got past a production classifier built for exactly this job.
Automation widens the gap. NIST describes researchers automating indirect injection with optimised execution triggers that survive multi-stage RAG pipelines. A defence that relies on recognising an attack's wording is racing an optimiser.
The conclusion NIST, the NCSC and OWASP share is to design on the assumption that some prompt injection attacks will succeed. NIST points to multiple models with different permissions, and to letting models touch untrusted data only through well-defined interfaces.
How to prevent prompt injection from becoming a breach
You cannot fully prevent prompt injection attacks. You can stop them becoming incidents. These controls follow OWASP's mitigation list and the failure points above.
- Grant the least privilege that still works. OWASP advises restricting the model's access to the minimum its task requires, and handling sensitive functions in code with the application's own tokens rather than handing them to the model. An assistant that summarises email does not need permission to send it.
- Separate untrusted content. Mark external content with its source, and avoid mixing confidential data with open-internet content in one context when the task does not need both.
- Control egress. Most exfiltration needs an outbound request. Disable automatic fetching of images and links in model output, allow-list destinations and inspect what leaves. EchoLeak's final hop was an outbound request through a proxy the policy permitted.
- Require human approval for high-risk actions. Payments, external email, permission changes and code deployment should need confirmation the model cannot give itself. OWASP lists human-in-the-loop control of privileged operations as a core mitigation.
- Log actions, not just prompts. Record every tool call, data access and outbound connection against the agent's own identity, so an investigation can reconstruct the sequence.
- Test adversarially. Treat every new connector and tool as a new injection route, and attack it before it reaches production.
The thread through all of these is the connection. A model that can reach only approved systems, with scoped credentials, through a point that enforces policy and can cut traffic, is a model whose injections fail quietly. That is the case for a cybersecurity gateway in front of AI systems: it does not need to understand the prompt to stop the request.
It is also why AI governance is not the same as AI security. A policy forbidding the assistant to send customer data out is a statement. A control that blocks the connection is a defence.
What security leaders should do now
Start with an inventory. List every AI system that reads outside content, such as email, web pages, uploads, tickets and third-party tools, and record what each can access and where it can send data. Systems with both untrusted input and outbound reach come first.
Then plan for speed. Autonomous AI attacks run at machine speed against security tools that were built to alert a person. An injected agent moving data out does not wait for a ticket to be triaged, so the block has to happen at the connection, in seconds, without an analyst in the loop.
There is a second clock. Data that leaves through an injected agent, or by any other route, is usually protected in transit by public-key cryptography that a future quantum computer is expected to break. Adversaries running harvest now, decrypt later collect that traffic today. CNSA 2.0 requires new US national security system acquisitions to be compliant with its post-quantum algorithms from 1 January 2027.
Conux is the cybersecurity gateway every connection passes through, including the connections your AI models and agents make. At the gateway, Conux governs machine identities with scoped permissions, enforces policy on each request, stops autonomous attacks in seconds and generates audit evidence for every action, while applying quantum-safe encryption to each connection. It sits in front of your existing cloud, identity, applications and AI models, so nothing is ripped out and deployment takes weeks.
To find out where prompt injection attacks could reach in your environment, talk to our team.




