Skip to content
AIDownload

Explainer · Updated November 28, 2026 · 4 minute read

What is prompt injection?

The short answer

Prompt injection is an attack in which text written by an attacker gets treated as instructions by an AI system. The text is often hidden in content the system reads, such as a web page, an email or a document. The model may act on it, leaking private information or taking actions its user never asked for.

Why it works

A language model receives everything as one stream of text. The developer's instructions, the user's request and the contents of a web page all arrive in the same form, and the model has no reliable built-in way to tell which parts carry authority. If a page contains a sentence addressed to the AI, the model may follow it.

Direct and indirect injection

Security researchers usually separate two forms.

  • Direct injection is typed by the person using the AI, for example a message telling a customer service bot to ignore its rules.
  • Indirect injection is planted in content the AI will read later, such as hidden text on a web page or a line in an email.

Why agents raise the stakes

A chatbot that falls for an injection may say something wrong or embarrassing. An AI agent that can browse the web, read email and run code can do more damage, because injected text can direct those tools. A typical attack tells the agent to find private data and send it to an address the attacker controls.

The risk is highest when one system combines access to private data, exposure to content written by strangers and a way to send information out.

How it is defended against

No known method stops prompt injection completely, and AI developers describe it as an open problem. Defenses lower the odds and limit the damage. For everyday use, be careful about pointing an AI agent at untrusted websites or inboxes while it also has access to accounts that matter.

  • Models are trained to treat content from tools and web pages as information and to distrust instructions inside it.
  • Applications ask for human approval before actions that send or delete anything.
  • Agents are given the least access they need, so a successful attack reaches less.
  • Separate filters scan incoming content for text that looks like an attack.

Common questions

Is prompt injection the same as jailbreaking?

No, though the two overlap, and the OWASP security guidance for LLM applications treats jailbreaking as one form of injection. A jailbreak talks a model out of its developer's safety rules, and the person doing it is usually the user. Prompt injection makes an application follow text it was only meant to process, and the person harmed is usually that application's user or owner.

Am I at risk when using a normal chatbot?

The risk is low when a chatbot only answers from its own knowledge. It rises when the AI reads web pages or email, and again when it can act on your accounts.

Written and reviewed by AI DownloadHow we write and review explainers

Prompt injection in the news

Research · Nov 25 · arXiv cs.AI + cs.CL

ContextLure: Exploiting Benign Conversation History for Indirect Prompt Injection

ContextLure is a red-teaming framework where an attacker quietly observes an existing benign agent conversation, pulls out useful evidence such as task results and user concerns, and uses it to craft a more convincing indirect prompt injection. The attacker does not alter earlier turns, and the work studies how well evidence can be selected and framed as justification for an unauthorized action.

Why it matters. It shows that long, tool-using agent conversations can leak material that makes prompt injections stronger, which matters for anyone designing agent defenses.

Research · Nov 19 · arXiv cs.AI + cs.CL

AutoPI: Taxonomy-Guided Adaptive Red Teaming for Prompt Injection in LLM Agents

AutoPI is an adaptive red-teaming system for prompt injection against LLM agents that aims for breadth of attack techniques rather than just a high attack success rate. It uses PIAtlas, a taxonomy of injection techniques, to guide an attacker LLM that writes an injection for each sub-technique and revises failures based on feedback from an LLM judge, all in a black-box setting.

Why it matters. Measuring how many distinct ways an agent can be broken, not just how often, gives a more honest picture of prompt injection robustness and better material for hardening models.

Research · Nov 19 · arXiv cs.AI + cs.CL

PIPETTE: Prompt Injection Purple-Teaming for Robust LLM Agents

PIPETTE is a purple-teaming approach for hardening LLM agents against indirect prompt injection. The authors show that high attack success rates in RL-based red-teaming do not ensure better robustness after adversarial training, since methods like RL-Hammer and PISmith suffer mode collapse and keep finding similar attack strategies.

Why it matters. It challenges the assumption that stronger automated red-teaming attacks automatically yield safer agents, pointing to attack diversity as key for effective adversarial training.

Keep reading

Follow the news behind these terms

The digest covers what happens in AI each day, with terms linked to these explanations.