Security

What Is Prompt Injection? Direct vs Indirect, and What It Means for the AI Tools on Your Site

A blueprint technical drawing in white line on deep Prussian blue paper of a player piano's roll mechanism in cutaway, a long punched paper roll feeding over the tracker bar, with one short strip of differently punched paper spliced into the roll, a visual for prompt injection: a machine that plays every hole it reads, whoever punched it

Prompt injection is an attack where text that an AI model reads changes what the model does. The text can come from the person typing, or it can hide in a web page, an email or a file the model was asked to handle. OWASP lists it first in its 2025 Top 10 for LLM applications, and no major AI vendor says it is solved.

Our guide to what a CVE is covers flaws that have an ID, a fixed version and a patch. Prompt injection works differently. It is a weakness in how language models handle text, so it shows up in every product built on them. Some product-level cases get CVE IDs. The underlying problem stays open after each fix. This piece covers what prompt injection is, the difference between direct and indirect attacks, where it hits the AI tools our readers run, and the defenses that limit the damage.

The short version: a language model reads instructions and data as one stream of text, and it cannot reliably tell them apart. Anyone who can put text in front of your AI tool can try to give it orders. You cannot filter that risk away. You can limit what the tool is allowed to do, require a person to approve risky actions, keep untrusted content apart, and log what happens.

What prompt injection is, in plain terms

A large language model takes in text and predicts what comes next. An app built on one usually sends it three kinds of text at once: the developer’s instructions, the user’s request, and content pulled from somewhere else.

NIST’s glossary defines prompt injection as "An attack which exploits the concatenation of untrusted input with a prompt constructed by a higher-trust party." In plain terms, the app glues trusted and untrusted text together, and the model has no hard line between them.

The OWASP LLM01:2025 entry puts it more broadly: "A Prompt Injection Vulnerability occurs when user prompts alter the LLM’s behavior or output in unintended ways." OWASP notes the input does not have to be visible to people. It only has to be read by the model.

That is the difference from a classic web flaw like SQL injection. Databases have a fixed way to separate code from data. Language models do not have one yet.

Direct vs indirect prompt injection

Security writers split prompt injection into two types. The difference is who writes the attack and how it reaches the model.

Type Who supplies the text Example
Direct The person typing into the tool A visitor tells a member-site chatbot to ignore its rules and reveal its instructions
Indirect A third party, through content the tool reads A web page hides text that tells a browser agent to send the user’s data elsewhere

NIST AI 100-2 E2025, its taxonomy of attacks on AI systems, defines indirect prompt injection as one "executed through resource control rather than through user-provided input." The attacker controls a resource the model will read, such as a page, a document or a calendar invite.

The idea came into focus with a 2023 paper by Kai Greshake and five co-authors, "Not what you’ve signed up for". They showed that apps which retrieve outside content blur the line between data and instructions. They demonstrated attacks on Bing’s GPT-4 chat and on code-completion tools, with no direct access to the victim.

For most organizations, indirect injection is the bigger worry. Direct attacks come from your own users, who can only reach what the tool already gives them. Indirect attacks come from anyone who can publish a page, send an email or upload a file your tool might read.

Why prompt injection has no single patch

OWASP is blunt about it: "it is unclear if there are fool-proof methods of prevention for prompt injection." It adds that retrieval and fine-tuning do not fully fix it either.

The vendors say the same. OpenAI calls prompt injection "a frontier, challenging research problem." Anthropic calls it "far from a solved problem" and says "no browser agent is immune to prompt injection."

Specific products still get CVE IDs when an injection path is found and closed. Two examples from the NVD:

  • CVE-2025-32711, published June 11, 2025, is described as “Ai command injection in M365 Copilot” that lets an attacker disclose information over a network. Microsoft scored it 9.3, Critical.
  • CVE-2024-5184, published June 5, 2024, is a prompt injection flaw in EmailGPT, an email assistant. OWASP cites it as one of its attack scenarios.

Our guide to reading a CVSS score explains what numbers like 9.3 mean. The point here is narrower. Each fix closes one path in one product. The next tool that reads untrusted text starts with the same weakness.

Where prompt injection hits the AI tools on your sites

The risk depends on two things: what untrusted text the tool reads, and what the tool can do. A chatbot that can only answer questions is a small target. An agent that can publish, send or delete is a large one.

Tool Untrusted text it reads What an attacker could get First control
Chatbot on a member site Visitor messages; pages and documents it searches Leaked instructions, member data in its index, false answers Index only public content
AI browser extension Every page, ad and document the user opens Actions in logged-in accounts; data sent to outside sites Limit which sites it can act on
Agent with CMS write access Form submissions, comments, imported content Changed or published pages, new user accounts Drafts only; a person publishes
Email assistant Every incoming message and attachment Forwarded mail, replies sent in your name Approval before any send

Member-site chatbots. Direct attacks are the common case: visitors try to make the bot reveal its setup. The larger risk is what it can search. If it reads member records, a crafted question may pull them out.

AI browser extensions. These read whatever the user reads, logged in as the user. Our agentic browser landscape covers the products. Our agentic browser security post covers why the browser boundary got harder to hold.

Agents with CMS write access. Our agentic CMS roundup found little agreement on what these agents may do. Anything a visitor submits becomes text the agent may read. Our post on an HTTP GET that rewrote a wiki shows how write access goes wrong.

Email assistants. An inbox is open to anyone with your address. OpenAI’s own example is an agent tricked by one email into sharing bank statements.

What the vendors do about prompt injection, as of October 2026

Vendor defenses change with each model release. This section reflects pages we read in October 2026.

Google lists six layers for Gemini on its Workspace admin page, last updated October 13, 2026. They include classifiers for injected content, removal of risky markdown and suspicious links, and a user confirmation step for risky actions such as deleting calendar events.

OpenAI describes layers of safety training, automated monitors, sandboxing, link approval and red-teaming in its November 2025 explainer. Its advice to users: give agents only the access they need, check confirmations before approving, and give specific instructions instead of broad ones.

Anthropic trains Claude on injected web content and scans untrusted input with classifiers, according to its November 2025 research post. That post reported a 1.4% attack success rate for Claude Opus 4.5 with safeguards, against an adaptive attacker given 100 tries. Our Claude Opus 5.5 prompt injection post covers newer results, which vary a lot by where the attack text comes from.

All three put confirmation before risky actions on the list. None claims to stop every attack.

Defenses that limit the damage

Since you cannot stop every injected instruction, plan for one to get through. OWASP’s related entry, LLM06:2025 Excessive Agency, names three root causes of harm: "excessive functionality", "excessive permissions" and "excessive autonomy". Each defense below cuts one of them.

  1. Least privilege. Give the tool the fewest tools, accounts and data it needs. A chatbot that answers from public pages has nothing private to leak. A CMS agent that can only save drafts cannot publish.
  2. Human approval for actions. Require a person to confirm anything that publishes, sends, deletes, pays or shares data. OWASP, Google, OpenAI and Anthropic all recommend this.
  3. Separate untrusted content. Mark outside text as data, and keep it out of the instructions. OpenAI’s agent builder safety guide says to keep untrusted input out of developer messages and to use fixed output formats between steps.
  4. Logging. Record what the tool read, what it decided and what it did. When something goes wrong, the log is how you find which page or email caused it.
  5. Testing. Try to break your own tool before someone else does. OWASP recommends treating the model as an untrusted user.

Keep normal security in place too. Not every AI flaw is prompt injection. The first MCP flaw in the KEV catalog was an authentication check that failed open.

Five questions to ask about each AI tool

  1. What outside text does it read: pages, forms, email, uploads?
  2. What can it do without asking anyone?
  3. Whose account does it act as, and what can that account reach?
  4. Which actions need a person to approve them?
  5. Where are its actions logged, and who reviews the log?

If the answer to the second question is "publish, send or delete," start there.

Frequently Asked Questions

What is prompt injection?

It is an attack where text an AI model reads changes what the model does. The text can be typed by a user or hidden in content the model processes, such as a web page, email or file.

What is the difference between direct and indirect prompt injection?

Direct prompt injection comes from the person using the tool. Indirect prompt injection comes from a third party, through content the tool reads, such as a page, document or email.

Is prompt injection the same as a jailbreak?

OWASP describes jailbreaking as a form of prompt injection, where inputs make the model ignore its safety rules. Prompt injection is the broader term and includes hidden instructions from third parties.

Can prompt injection be fixed with a patch?

Not fully. OWASP says it is unclear whether fool-proof prevention exists. Vendors fix specific paths in specific products, and some get CVE IDs, but the weakness remains.

Does a chatbot that only answers questions need protection?

Yes, but less. Its risk depends on what it can search. Keep its index to content you would publish anyway, and keep member records out.

Are AI browser extensions safe to use for work?

They carry more risk than a chatbot because they act inside your logged-in accounts. Limit the sites they can act on and approve each risky action.

Should a CMS agent be allowed to publish?

We suggest drafts only, with a person publishing. Anything a visitor can submit, such as a form entry or comment, can carry instructions the agent may follow.

Can a filter or classifier stop prompt injection?

It can catch many attempts. Google, OpenAI and Anthropic all use classifiers, and none claims they catch everything. Treat a filter as one layer.

What is the single most useful defense?

Limit what the tool can do. An injected instruction can only cause harm through the permissions and actions the tool already has.

Digital Matters

Security Desk