Two forms
Direct and indirect prompt injection: the difference
Direct injection comes from the person using the tool. Indirect injection hides in content the tool reads, which is why it is the bigger worry for business use.
Last reviewed against NCSC, OWASP GenAI Security Project and Microsoft Security Response Center. Sources

Definitions
Who writes the hostile text
OWASP describes direct injection as a user's input altering the model's behaviour, whether deliberately by an attacker or by accident [2]. Indirect injection hides the instruction in material the model is asked to read, for example a site or a document that came from elsewhere [2]. Microsoft defines the indirect form as text injected into content that the LLM misinterprets as legitimate instructions [3].

Side by side
How they compare
| Direct | Indirect | |
|---|---|---|
| Who supplies the text | The person typing | A third party, through content |
| Does the user know | Usually yes | Often no |
| Typical route | Chat box, form field | Email, web page, shared file, retrieval store |
| Main concern | Misuse of the tool's access | Content the user never saw acting through the tool |

Why it matters
The user may be the victim
In a direct case the person at the keyboard is usually the source, deliberately or not. In an indirect case the user is an innocent bystander: they ask a routine question and the tool acts on text planted by someone else. That was the pattern in EchoLeak, where a user's ordinary business question pulled a hostile email into context [4]. See the full case.
What to do
Match the control to the form
For direct injection
Limit what any single user can make the tool do, and keep sensitive functions in application code rather than handing them to the model [2].
For indirect injection
For both
Ask for human approval before high-risk actions, and test by playing the attacker against the tool [2].
A rule of thumb from the NCSC
Do not let an LLM that processes email from random outsiders have access to privileged tools [1].
The next page, prompt injection compared with SQL injection, explains why neither form can be patched away.
Keep reading
Read next
Lethal trifecta
The lethal trifecta explained: private data, untrusted content and outward communication. How to check your AI tools and remove one of the three.
Read the guide
Vs SQL injection
Why the NCSC says prompt injection is not SQL injection, why parameterised queries have no equivalent, and what 'confusable deputy' means in practice.
Read the guide
Prevention
Prompt injection controls for UK teams: least privilege, human approval, separating untrusted content and logging, from OWASP, Microsoft and the NCSC.
Read the guideHow CyPro can help
Need a hand planning for this?
Understanding the change is one job. Working out what it means for your systems, your suppliers and your roadmap is several more. CyPro's consultants can take any of them on.
Fractional CISO for the board
A senior security lead who advises the board on what to fix first, what to accept and what to tell customers, and owns the decision record.
More on cypro.co.uk
Hardening and segmentation
Our consultants put the controls in place that limit the damage when something is missed: firewall rules, network isolation and tighter admin access.
More on cypro.co.uk
Penetration testing
A focused test of your systems and the controls around them, so you know they hold before an attacker finds out for you.
More on cypro.co.uk
Vulnerability scanning
Find every internet-facing system you run, including the forgotten ones, and see which are still on a vulnerable build.
See the scanning service
24/7 security monitoring
Our SOC analysts watch your systems day and night for the signs of an attack in progress: unexpected processes, new outbound connections, logins that do not fit.
More on cypro.co.uk
Incident response
If you may already be compromised, our responders contain it, preserve the evidence, find out what was touched and get you running again safely.
More on cypro.co.uk
Plan ahead
Want a plan for your organisation?
Prompt injection only shows up when someone tries it against your own tools. Penetration testing can probe the AI features you run or build, to see what a hostile instruction could reach.