Prompt injection is an attack that hides instructions inside a message, web page or file to make an AI model behave in ways its owner didn't intend. In AI agents that can use tools, it can lead to unauthorized actions.
Large language models can't always tell the instructions they were given apart from the text they're processing. An attacker uses that gap to slip their own instructions into what the model reads.
What are the two types?
- Direct: a user types an instruction like "forget your previous rules" into the chat.
- Indirect: the instruction is hidden inside an email, web page or document the model reads, sometimes where people can't see it.
OWASP, the application security community, ranks prompt injection first on its 2025 risk list for large language model apps (OWASP: LLM01:2025 Prompt Injection).
What should a business do?
There's no known foolproof way to prevent it, so the goal is to limit the damage. Give an AI agent only the access its job needs, require human approval for pricing, discounts, payments and sending data out, and set a human handoff rule for suspicious requests. For more, see our AI agent guide.