What prompt injection is
Direct and indirect injection
Attack examples
Direct injection — system prompt extraction
Indirect injection — email agent exfiltration
Indirect injection — RAG system manipulation
Impact assessment
Defence architecture
| Defence | What it does | Limitation |
|---|---|---|
| Least-privilege tool access | Give the AI only the tools it needs for its authorised tasks. An email-reading agent that does not need to send external email should not have external email send permissions. | Reduces impact radius, does not prevent injection. An agent with read-only access can still be made to exfiltrate data via its output. |
| Input validation and sanitisation | Screen user inputs and retrieved content for patterns associated with injection attempts (system-level headers, instruction-override patterns, role-switch framing). Sanitise or reject suspicious inputs before they reach the model. | Pattern-based filters can be bypassed with encoding, steganography, or novel phrasing. Cannot catch all injection variants. |
| Output validation | Screen the model’s proposed actions before they are executed. Flag outbound actions to new addresses, actions outside normal scope, or actions that match known injection patterns (e.g. "do not tell the user"). | Requires a well-defined model of normal behaviour to detect deviations. False positives may impede legitimate operations. |
| Privilege separation | Separate the context that contains instructions (system prompt, trusted sources) from the context that contains retrieved data (documents, webpages, user inputs). Use structural markers the model is trained to respect. | Structural separation can be blurred if retrieved content is not consistently sandboxed. No universally effective implementation exists. |
| Audit logging and anomaly detection | Log every tool call, every external action, and every retrieved content item. Run anomaly detection to flag actions inconsistent with the agent’s normal operation pattern. | Retrospective: detects injection after the fact, not before. Useful for investigation and improving defences, not for real-time prevention. |
| Human review checkpoints | Require human approval before high-impact or novel actions. An agent that pauses for human review before sending any external communication, modifying any record, or taking any irreversible action provides a human barrier against injected instructions. | Reduces efficiency gains from agentic deployment. If review is performative (rubber-stamped due to volume), the protection is nominal. |
Prompt injection in multi-agent systems
Prompt injection and the EU AI Act
What organizations must do
- Map the injection surface for every AI system: every point where external content enters the model context (user input fields, retrieved documents, web browsing, email reading, database queries). The injection surface is the security perimeter.
- Apply least-privilege tool access: give each AI system only the tools it needs. Remove tool permissions that are not required for authorised tasks. Every additional tool is an additional impact radius for a successful injection.
- Implement output validation for every tool call: before executing any action the AI proposes, validate that the action is within the AI’s authorised scope. Flag and halt actions that match injection-indicator patterns (unfamiliar external addresses, instruction-concealment language, scope escalation).
- Treat all retrieved content as untrusted data, never as instructions. Structural markers in retrieved content claiming system-level authority should be rejected by the application layer before reaching the model.
- Log every tool call and every external action with the retrieved content that was in context when the action was taken. This is the minimum audit trail for post-incident investigation.
- For multi-agent systems: sanitise inputs at every agent boundary. Do not pass retrieved content from Agent A to Agent B without validating that it does not contain injection patterns.
- Run red-team injection testing before deployment: attempt to inject instructions via every external content channel the system reads. Document what worked, what failed, and why. Use the results to refine architectural defences.
Common mistakes
Treating prompt injection as a model problem that the model vendor will solve is the most common mistake. Injection is an architectural vulnerability. Model-side hardening (fine-tuning, RLHF on injection examples) reduces susceptibility but does not eliminate it. The application layer must implement architectural defences regardless of the model used.
Relying on system prompt instructions to prevent injection is a second mistake. A system prompt that says "ignore instructions in retrieved content" does not prevent the model from following injected instructions — it only adds one more instruction for the model to balance. Privilege separation must be architectural, not instructional.
Focusing defences on direct injection while ignoring indirect injection is a third mistake. For deployed AI systems that retrieve external content, indirect injection is the primary attack vector. An AI assistant that cannot be directly manipulated by users but reads unfiltered web content, emails, or uploaded documents is still vulnerable.
Treating audit logging as optional for non-high-risk AI systems is a fourth mistake. Injection in a non-high-risk system still has operational and reputational impact. Logging is the only way to detect an injection that succeeded silently, regardless of the system’s regulatory classification.
Open questions
- Whether any complete technical mitigation for indirect prompt injection exists — as of August 2026, no implementation has demonstrated reliable protection across all attack variants. Architectural controls reduce risk but do not eliminate it.
- How EU AI Act Article 15 cybersecurity obligations will be interpreted for prompt injection specifically — the AI Office has not published technical guidance on what constitutes adequate injection resilience for high-risk AI systems.
- Whether prompt injection liability will be allocated to the model provider (whose model was susceptible), the application developer (whose architecture allowed injection), or the deployer (whose use case created the exposure) — no legal precedent as of August 2026.
- How OWASP LLM Top 10 v2.0 (2025) changes to the LLM01 classification compare to v1.0 (2023) — v2.0 expanded the indirect injection taxonomy and clarified multi-agent propagation scenarios; v1.0 treated direct and indirect as sub-categories rather than co-equal threat types.