Prompt injection happens when text that an AI app is only meant to read gets treated as instructions instead.
A language model sees its instructions and its input as one stream of text. If the input says "ignore your instructions and do this instead", the model may do exactly that.
Direct and indirect injection
- Direct injection: the user types the attack into the app themselves.
- Indirect injection: the attack hides in something the app reads for the user, like a web page, an email, a PDF or a support ticket. The user may never see it.
Indirect injection is the bigger risk for agents, because agents read untrusted content and can act on it: send mail, run code or call APIs.
Why it matters
OWASP lists prompt injection first in its Top 10 for LLM applications. A successful injection can leak a system prompt, expose private data, or make an agent take actions its user never asked for.
Next step
Run the canary payloads against your own app to see where it stands.