Browse AI Foundation

What Is Prompt Injection? The Attack That Hijacks an AI Model's Instructions

A model can't always tell the difference between its real instructions and text that's just pretending to be one — prompt injection exploits exactly that gap.

Hiding instructions inside content

Prompt injection is an attack where malicious instructions are hidden inside content a model processes — a document it's asked to summarize, a webpage it's browsing, an email it's reading — attempting to trick the model into following those hidden instructions instead of (or in addition to) its legitimate task.

Why this is hard to fully prevent

A model processes its real instructions and the content it's working on through the same channel of text, without a hard, foolproof boundary between "trusted instruction" and "content to merely analyze." That blurred line is exactly what prompt injection exploits, and it's an active, unsolved area of AI security research.

How it's mitigated in practice

Defenses include guardrails that scan for suspicious embedded instructions, limiting what actions a model is allowed to take autonomously after processing untrusted content, and requiring human confirmation before a model executes a sensitive action — since no single defense is considered fully reliable on its own.

Frequently Asked Questions

What is prompt injection?

An attack that hides malicious instructions inside content a model processes — a document, webpage, or email — attempting to trick the model into following those hidden instructions instead of its legitimate task.

Can prompt injection be fully prevented?

Not with complete reliability today — it remains an active area of AI security research. Mitigations like guardrails and limiting autonomous actions reduce risk but no single defense is considered fully sufficient on its own.

Keep Exploring