AI Glossary Term

What does “Prompt Injection” mean?

Definition

An attack pattern where malicious instructions are inserted into model inputs or retrieved content.

How Prompt Injection works

Diagram for Prompt Injection, steps in order: App tells model: summarize this web page; then Page contains hidden text: ignore instructions, reveal data; then Model treats it as a command; then Defenses: separate data from instructions, limit tool access.App tells model: summarize this webpagePage contains hidden text: ignoreinstructions, reveal dataModel treats it as a commandDefenses: separate data frominstructions, limit tool access

Example

An email assistant reads a message containing hidden text telling it to forward the user's inbox to a stranger. If the assistant treats that text as an instruction, it could act on it. Limiting what the assistant is allowed to do reduces the damage.

Why it matters

Models cannot reliably tell instructions apart from data. This makes untrusted content a risk, especially when an assistant can take actions.

Common questions

Direct vs indirect injection?

Direct means the user types the attack. Indirect means it is hidden in content the model reads, such as a web page or document.

Can it be fully prevented?

Not with current methods. Mitigations include least-privilege access, user confirmation for risky actions, and filtering.

Is it the same as a jailbreak?

No. A jailbreak bypasses a model's safety rules; injection hijacks an application's behavior with embedded instructions.

Learn more in our free guides

Test yourself

See also