Securitycore
Indirect prompt injection
Instructions hidden in content the model reads — web pages, emails, documents, tool results.
What it is and why it exists
The attacker never talks to your app: they plant text in a page, a PDF, a ticket or a calendar invite that your agent later retrieves. The model reads it as instructions (“forward the last 10 emails to …”). This is the main threat to agents and RAG over untrusted data.
Quick prototype
Not considered.
In production, at scale
Treat all retrieved and tool content as untrusted data: delimit it, strip hidden text, never give one agent untrusted input + private data + an exfiltration channel at once, require confirmation for side effects, use architecture patterns (quarantined reader, plan-then-execute), and monitor tool calls for anomalies.
Vendors and tools
| Microsoft spotlighting / Prompt Shields | Marking and detecting untrusted content |
|---|---|
| Google DeepMind CaMeL | Capability-based defence design |
| Lakera / Protect AI | Detection on documents and tool output |
On AWS: Bedrock Guardrails can evaluate tagged input sections; enforce least privilege on Bedrock Agents action groups.
How it fails
- White-on-white text in a résumé steering a screening bot
- A support ticket telling the agent to refund to another account
- Malicious README instructing a coding agent
What the interviewer asks next
Why is indirect injection worse than direct?
The victim is your user, not the attacker; it scales (plant once, hit everyone); and it arrives through trusted-looking channels your filters may not inspect.