Articles & BlogBy 9 min read

For anyone who uses an AI assistant, and anyone about to connect one to email, files or a browser. By the end you will know what prompt injection is, why it has no clean fix yet, and how to set an assistant up so a successful attack finds little to take.

Phishing works by putting a message in front of a person and hoping they act on it. Prompt injection puts a message in front of an AI assistant with the same hope.

You ask your assistant to summarize a web page, sort your inbox or read a PDF. Somewhere in that content is text that was never meant for you. It is addressed to the machine, and it is written as an order.

An early robotic hand in a museum case: three blue metal fingers at the end of a forearm packed with a row of small motors, with dozens of thin grey cables running from the motors to the fingers and bundles of colored wire hanging belowA robotic hand from 1982 at the MIT Museum. A machine does what its wires tell it, whoever is pulling them, and that is the weakness prompt injection uses. Photo by Daderot, CC0, via Wikimedia Commons.

What is prompt injection?

An AI assistant is built on a large language model (LLM), a program that takes text in and produces text out. The text it is given is called the prompt. In a real product the prompt has several parts: the maker's standing instructions, your request, and whatever content the assistant was asked to read. To the model, all of it is text in one long stream.

Prompt injection is the trick of placing instructions in that stream so the model follows them in place of, or on top of, what it was supposed to do. OWASP, the group behind the well-known Top 10 list of web application risks, keeps a separate Top 10 for LLM Applications. Prompt injection is its first entry, LLM01 in the 2025 edition, and OWASP defines it as prompts that alter the model's behavior or output in unintended ways.

The planted text does not have to be visible. OWASP notes that an injection need not be readable by a human at all, as long as the model parses it. In practice that means things like text in the same color as the page background, text in a tiny font, a comment in the page's underlying code, or words tucked into a document's properties. You see a recipe. The assistant sees a recipe and a paragraph telling it what to do next.

Direct versus indirect

OWASP splits the problem in two.

DirectIndirect
Who writes itThe person typing to the assistantA third party the user never sees
Where it sitsIn the chat boxIn a web page, email, file or calendar invite
Who is harmedUsually the service, whose rules are talked aroundUsually the user who asked the assistant to read it
Everyday comparisonTalking your way past the front deskA forged memo slipped into the inbox

Direct injection is a user trying to argue a model out of its own rules. Indirect injection is the one this article's title describes, because the victim is an ordinary user who did nothing wrong. The US National Institute of Standards and Technology (NIST) uses the term agent hijacking for a type of indirect prompt injection in which an attacker inserts malicious instructions into data an assistant may read, such as an email, a file or a website, to make it take harmful actions.

The parallel with phishing is close enough to be useful.

PhishingIndirect prompt injection
TargetA personAn AI assistant working for a person
LureA message that looks routineContent that looks routine, with instructions inside
What the attacker wantsA click, a password, a paymentAn action taken with the user's access
What stops itA pause and a second checkLimits on what the assistant can do without asking

Why is it hard to fix?

NIST puts the cause plainly: the attack arises when a system lacks a clear separation between trusted internal instructions and untrusted external data.

Older software had this problem and solved it. SQL injection, covered in SQL Injection and Cross-Site Scripting, Shown Safely, was fixed by sending the command and the data to the database in two separate channels. A language model has one channel. The instructions and the web page arrive as the same kind of thing, and the model has to judge which words carry authority. Usually it judges well. An attacker only needs it to be wrong once.

Nobody claims to have closed the gap. OWASP says it is unclear whether fool-proof methods of prevention exist. Vendors say so about their own products: Anthropic wrote in November 2025 that prompt injection is "far from a solved problem" and that no browser agent is immune. In the same post it reported cutting the measured attack success rate against its browser agent to 1.4% on one model, and added that even 1% is a meaningful risk.

NIST's own testing shows why a low number on a standard test is not the end of the matter. In work published in January 2025, a red team wrote new attacks aimed at one specific model, and the success rate of the strongest attack rose from 11% to 81%.

Agent hijacking success rate against one model in NIST's test, before and after red teaming
Agent hijacking success rate against one model in NIST's test, before and after red teaming
Strongest baseline attack11%
Strongest red team attack81%

Source: NIST CAISI, Strengthening AI Agent Hijacking Evaluations, January 2025

A March 2026 NIST post describes a public competition with more than 250,000 attack attempts by over 400 participants against 13 leading models. At least one attack succeeded against every model. Filters and training shift the odds, and they are worth having. They do not make it safe to hand an assistant everything.

What is at risk when an assistant has tools?

A chat-only assistant that gets fooled gives you a wrong or slanted answer. That matters, since a hijacked summary can point you to a scam link, but the damage passes through you.

An agent is an assistant that can take actions through tools, and with tools the picture changes. With email access it can read and send. With file access it can open, change and delete. With a browser it can click and fill in forms on sites where you are already signed in. The scenarios NIST tested were all of this kind: getting an agent to download and run a program, to send a user's files to a stranger, and to email phishing messages to the user's own contacts.

The risk is highest when three things meet: access to private data, exposure to content from strangers, and a way to send information out. Remove any one and the attacker's path is broken.

A diagram. On the left a box labeled you asks the AI assistant to summarize this page. On the right a box labeled web page holds the article you see and, in red, a hidden instruction. The page text flows into the AI assistant, which reads it all as one stream of text. An arrow runs down from the assistant, labeled action requested, to a box of tools: email, files and browser. A dashed red arrow runs from the tools to a red box labeled attacker's goal: your data, sent out. Three numbered guard points are marked. One, on the page text entering the assistant: fetched content is data to read, never orders to follow. Two, on the arrow to the tools: a person confirms before anything is sent, deleted or bought. Three, on the tools: least privilege, only the tools the task needs and no secrets in reach.The hidden instruction only pays off if the assistant can act on it. Each guard point breaks the path.

Picture a home user who connects an assistant to their inbox and asks for a summary of unread mail. One message, from a stranger, contains a paragraph addressed to the assistant. If the assistant can only read and summarize, the worst outcome is a strange summary. If it can also send mail and open files without asking, the same message is a real threat. Now picture a clinic's front desk assistant that reads incoming patient email and can also reach the scheduling system. The inbox is open to the whole world, and what sits behind the assistant is far more sensitive.

What do users and builders do?

Nothing here stops injection from being attempted. The aim is to make a successful one cheap. Each row maps to a mitigation in OWASP's LLM01 guidance.

GuardIf you use an assistantIf you build one
Least privilegeConnect only the accounts the task needs, read-only where offeredGive the model the narrowest tools and access, enforced in code and not in the prompt
Confirm before actionsLeave approval prompts on, and read themRequire human approval for high-risk actions: send, delete, pay, share
Treat fetched content as untrustedBe suspicious when a summary tells you to click, call or payMark external content as separate from instructions, and filter what goes in and out
Keep secrets out of reachDo not paste passwords, keys or ID numbers into a chatKeep credentials out of prompts and out of files the agent can open
Test itNot your jobRun adversarial tests that treat the model as an untrusted user

For users, the signs that an assistant was steered look a lot like the signs of phishing. The answer contains a link, phone number or request for a password that has nothing to do with what you asked. The assistant proposes an action you did not request. A summary pushes one product or one urgent step. Treat it the way you would treat a suspicious email: stop, approve nothing, and look at the source yourself.

For builders, the hard rule is that the model's good behavior is not a security control. Decide in ordinary code what the assistant is allowed to do, assume its instructions can be overridden by anything it reads, and design so that the worst case is survivable.

Watch out

Do not switch on "act without asking" for an assistant that both reads content from strangers (web pages, incoming mail) and can send, delete or spend. The confirmation step is the last check between a hidden instruction and a real action. Approving without reading removes it just as surely.

Tip

Give an assistant its own browser profile for web tasks, one with no bank, mail or work account signed in. A hijacked session in an empty profile has nothing to reach.

What to remember

  • Prompt injection hides instructions in content an AI assistant reads. It is first on OWASP's 2025 Top 10 for LLM Applications.
  • Direct injection comes from the person typing. Indirect injection comes from a page, email or file, and the user is the victim.
  • It is hard to fix because a language model receives instructions and data in the same stream of text.
  • No vendor or standards body claims it is solved. A competition NIST reported on found a working attack against every model tried.
  • The risk grows with what the assistant can touch: private data, outside content, and a way to send things out.
  • Limit access, keep confirmations on, treat fetched content as untrusted, and keep secrets where the assistant cannot read them.

Open the settings of any assistant you use and look at what it is connected to and what it may do without asking. Remove one thing it does not need. For the human version of this attack, read Phishing, Vishing, Smishing: How the Message Gets In, and for what a leaked credential costs once something does get out, read APIs and API Keys: Why Leaked Keys Hurt.