Prompt Injection

Prompt injection is an attack on AI systems built on large language models, where crafted text, typed by a user or hidden in a web page, email or file, makes the AI ignore its instructions and do something unintended.

IntermediateCategory: AI and emerging threats

Also called: indirect prompt injection, LLM prompt injection, jailbreak

Large language models (LLMs) follow instructions written in plain text, and they can't reliably tell their developer's instructions apart from text that arrives later. Prompt injection exploits that. OWASP ranks it first in its Top 10 risks for LLM applications.

There are two main forms:

  • Direct prompt injection, where a user types instructions designed to override the system's rules, sometimes called a jailbreak.
  • Indirect prompt injection, where the instructions are hidden in content the AI reads, such as a web page, email, document or support ticket. The user may never see them.

Indirect injection is the bigger risk for businesses deploying AI assistants and agents. An AI that can read email and send messages could be tricked by a single malicious email into forwarding sensitive data. The more tools and data an AI system can reach, the more damage an injection can do.

There is no complete fix yet. OWASP recommends layered controls: limiting what the AI can access, requiring human approval for sensitive actions, filtering inputs and outputs, and testing regularly. Our pages on AI penetration testing and AI red teaming explain how providers test for it.

Related terms

Sources

  1. LLM01:2025 Prompt Injection (OWASP Gen AI Security Project)
  2. Glossary: red teaming (NIST)

Drafted with AI assistance, then edited and fact-checked by a person. How we use AI.