GlossaryPrompt injection
Prompt injection
Prompt injection is an attack in which text crafted to look like instructions is fed to a language model so that it ignores its intended instructions and does something else. It is the first entry in the OWASP Top 10 for LLM applications.
How it works
Language models read instructions and data in the same stream of text, and they have no reliable way to tell which is which. Prompt injection exploits that. In direct injection, a user types instructions meant to override the system prompt, such as telling the model to disregard its rules. In indirect injection, the instructions hide in content the model reads while doing its job: a web page, an email, a PDF, a code comment or a document in a knowledge base.
Research on indirect prompt injection showed that applications that let a model read outside content and call tools are exposed: hidden instructions in a retrieved page can make the model leak data, call tools it should not or give false answers. NIST's taxonomy of adversarial machine learning lists prompt injection among the attacks on generative AI systems.
A jailbreak is a related attack, aimed at getting a model to break its safety training rather than an application's instructions.
Prompt injection vs jailbreak
A jailbreak targets the model's own safety behavior, trying to make it produce content it was trained to refuse. Prompt injection targets the application, trying to make the model follow an attacker's instructions instead of the developer's. The techniques overlap, but the harm differs: a jailbreak produces bad content, while prompt injection in an agent with tools produces bad actions.
Why it matters
As soon as a model reads untrusted content and takes actions, prompt injection becomes a path to real damage: sending data out, changing records, approving orders. No prompt wording fully prevents it, so defense has to come from how the system is built. OWASP's Top 10 for agentic applications, published for 2026, lists agent goal hijack first: injected content redirects what an agent is trying to do, such as a datasheet PDF with hidden text telling a parts agent to approve a substitute.
How to get it right
- Treat all outside content as data, never as instructions.
- Give the model the least privilege its task needs.
- Require approval for actions that send data out, spend money or change released records.
- Separate trusted instructions from untrusted content in the prompt.
- Validate tool calls in code against what the task allows.
- Test with injected content, and log blocked attempts.
Prompt injection in robotics and drone hardware
Engineering agents read supplier documents, datasheets, emails and files from outside the organization. Any of them can carry hidden instructions. Keeping those documents as data, limiting which records an agent can change and requiring approval for releases and orders keep an injected instruction from reaching a design or a production order.