Skip to content
A smoked translucent slab carries a hidden pink thread toward the agent's tools, and an amber ring stops it before it reaches them.

Attack technique

Prompt injection when AI agents can act: how to contain it

The short answer

Prompt injection is an instruction hidden in something an AI agent reads, like an email, a web page or a file, that makes it work for the attacker. You can't train it away completely. You contain it: treat what agents read as data, keep their tools narrow, and have a person approve anything that leaves the business.

Written byBrian GagneCo-founder and CTO, Kief Studio
Technical review byAmelia GagneCo-founder and CEO, Kief Studio

Published

Waiting on you queue with a staff question, a reply awaiting a Go ahead, a blog post review and a social post, each with buttons.
If prompt injection fools an agent, this is where the attempt stops: anything that sends, posts or spends waits in one queue for the person who owns it.

What is prompt injection?

Prompt injection is text that changes what an AI system does once the system reads it. OWASP ranks it first in its Top 10 for LLM Applications (opens in a new tab) (LLM01) and describes it as prompts that alter the model's behavior or output in unintended ways.

With a chatbot, the worst outcome is usually a bad answer on a screen. AI agents are different, because they act. An agent that can send email, update the CRM, move files or book a payment turns a bad answer into a bad action, and that's the case this page is about.

Here's the example I give owners. Your agent reads a supplier's email so it can draft a reply. At the bottom, in white text on a white background, there's a line telling it to forward the last ten invoices to an outside address. You never see that line. The agent reads every word of it.

Direct prompt injection: someone types it

Direct prompt injection comes from the person using the system, who types instructions meant to get around its rules. It matters most for public chat tools. Inside a business, the people talking to your agents are usually your own team, so this is rarely where the real damage starts.

Indirect prompt injection: it arrives with the work

Indirect prompt injection arrives in content the agent fetches or is handed. Researchers named it in a 2023 paper, Not what you've signed up for (opens in a new tab), which found that apps built on these models blur the line between data and instructions.

NIST's adversarial machine learning taxonomy, NIST AI 100-2e2025 (opens in a new tab), explains why it works. The models combine the data and instruction channels, so whoever controls something the agent reads can steer it without ever touching your app. NIST also notes that the attack comes from a third party, and that in many cases the person who gets hurt is the primary user.

An inbox tray of envelopes on a walnut desk, one with a hidden pink-lit slip inside, beside a closed laptop lit amber.

Where indirect prompt injection hides

Anything an outsider can write and an agent can read is untrusted content. In a small business, that covers more than people expect.

  • Email. Anyone on the internet can put text in front of an agent that reads your inbox, which makes it the most common path in.
  • Web pages. An agent that researches or browses reads whatever the page's author wrote, including text no person can see.
  • Documents and shared files. A PDF, a spreadsheet or a shared document can carry instructions in comments, metadata or hidden text.
  • Tool output. A search result, an API response or another agent's answer is untrusted content too. NIST points to research that tests agents against exactly this: data returned by outside tools that hijacks the agent.
  • Calendar invites, chat messages, reviews and web form submissions: anything a stranger can fill in.
Many dark slabs drift past, a few with hidden pink veins, and one amber lens frame marks outside content as untrusted.

Why prompt injection can't be fully trained away

Every few months a model ships that resists it better, and the improvement is often real. Each one narrows the gap without closing it. OWASP's own guidance says it is unclear if there are fool-proof methods of prevention for prompt injection.

The UK's National Cyber Security Centre went further in Prompt injection is not SQL injection (it may be worse) (opens in a new tab), published December 8, 2025. It says current large language models simply do not enforce a security boundary between instructions and data inside a prompt, and that the attack may never be totally mitigated the way SQL injection can be. The NCSC describes the model as an inherently confusable deputy.

NIST arrives at the same place. Because current mitigations don't offer full protection, it says designers may build systems on the assumption that prompt injection attacks are possible whenever a model is exposed to untrusted input. That's the assumption I build on, and it's the one I'd hold any vendor to.

The taxonomy keeps moving. NIST released the initial public draft of its next edition, SP 2400-102e2026 (opens in a new tab), on November 9, 2026, with its focus on attacks against agentic systems, and comments are open until December 18, 2026. Until it's final, the 2025 edition is the current one.

A fused stone block has a pink crack that can't be sealed, so an amber cradle is built to hold it safely.

What prompt injection does to an agent

OWASP's Top 10 for Agentic Applications (opens in a new tab) ranks Agent Goal Hijack first (ASI01): an attacker changes what the agent is trying to achieve, very often through prompt injection. OWASP's first-quarter 2026 exploit round-up (opens in a new tab) maps a disclosed indirect prompt injection case to ASI01 with one line: external content redirected the assistant's behavior.

Once an agent's goal is hijacked, these are the outcomes I design against.

  • Data exfiltration. The agent sends data out, by email, by calling a web address, or by rendering an image whose link carries the data. NIST lists markdown image rendering as one of the ways attackers pull data out.
  • Unwanted actions. The agent sends, deletes, books or pays, using tools it legitimately holds. OWASP calls that Tool Misuse and Exploitation (ASI02).
  • A poisoned memory. The agent saves the attacker's instruction as a note and follows it next week. OWASP calls that Memory & Context Poisoning (ASI06).
  • A cascade. One agent's hijacked output becomes the next agent's input, and the problem spreads. OWASP calls that Cascading Failures (ASI08).

Data exfiltration

The agent sends data out by email, by calling a web address, or by rendering an image whose link carries the data.

Unwanted actions

The agent sends, deletes, books or pays, using tools it legitimately holds.

A poisoned memory

The agent saves the attacker's instruction as a note and follows it next week.

A cascade

One agent's hijacked output becomes the next agent's input, and the problem spreads.

A rack firewall where one pink-lit cable runs out into the dark, and the other ports sit behind an amber-lit brass lock bar.

Containing prompt injection: five controls

Since you can't count on the model catching every attack, you build so that a fooled agent can't do much. These five controls carry most of the weight.

Treat what agents read as data

Mark outside content as outside content in every agent's context, and never let it carry the authority of a rule. OWASP lists segregating and identifying external content as a mitigation. The NCSC says marking it can make injection harder, and that prompt injection may never be fully mitigated, which is why the next four controls exist.

Give each agent narrow tools

The agent that summarizes your inbox doesn't need to send from it. OWASP's guidance on excessive agency (opens in a new tab) (LLM06) says to limit the extensions an agent can call, and the permissions those extensions hold, to the minimum necessary. That's least privilege for AI agents.

The NCSC gives the reason in one sentence: assume the worst case is that an attacker has direct access to every tool the agent can use. The rule it quotes is a good one to design by. When a model processes information from a party, its privileges should drop to that party's.

Human approval before anything leaves

Drafting, summarizing and sorting can run on their own. Sending, posting, publishing, paying and deleting wait for a person. OWASP lists human approval for high-risk actions among its mitigations, and the NCSC asks for deterministic safeguards, meaning checks that aren't another model, that constrain what the system can do. An approval button is exactly that kind of check.

Limit where data can go

Data exfiltration needs a way out. Allow agents to reach only the services their job needs, block calls to addresses nobody approved, and don't let agent output load remote images or links on its own. When the destination list is short, a hijacked agent has nowhere to send what it took.

Keep rules apart from learned notes

Rules a person wrote and notes an agent picked up should live in different places, and a note should never outrank a rule. Then an injected instruction that slips into memory stays a note someone can review, and it can't rewrite how the agent behaves.

  1. Treat reads as data. Mark outside content as outside content, and never let it carry the authority of a rule.
  2. Give agents narrow tools. Limit the tools an agent can call, and their permissions, to the minimum necessary.
  3. Approve before anything leaves. Sending, posting, publishing, paying and deleting wait for a person.
  4. Limit where data goes. Allow agents to reach only the services their job needs, and block addresses nobody approved.
  5. Keep rules apart from notes. Rules a person wrote and notes an agent picked up live in different places, and a note never outranks a rule.
A pink light trail passes through five narrowing dark rings, and the last ring glows amber where the trail comes to a stop.

Watch for it in the log

The NCSC recommends logging inputs, outputs, tool use and API calls, and watching for failed tool calls, which can be an attacker probing what the agent is allowed to do. A log written before each action also answers the question every incident starts with: what did it touch?

Amelia, who runs Kief Studio with me, covers that side in audit trails for AI agents: what to record, how to make it tamper evident, and how to use it when something goes wrong.

A long stack of graphite plates records each action, and one plate glows amber.

Prompt injection defenses that don't hold up alone

Some fixes sound good in a sales call and fall over in practice. Each of these can be one layer, and none of them is enough by itself.

  • A list of banned phrases. The NCSC warns against deny-lists that block phrases like ignore previous instructions, because there are endless ways to rephrase an attack.
  • Telling the model to ignore instructions in documents. It helps a little, and it's still a request to the same model the attacker is talking to.
  • A second model checking the first. Detection schemes are a real research area, and NIST lists them among the mitigations, but a checker can be fooled by the same tricks.
  • A vendor that says it has solved the problem. Ask for the controls that limit damage when an agent is fooled, and how they're enforced.
An office door with a thin chain latch hanging loose in pink light above a heavy brass deadbolt glowing amber.

Prompt injection and Massachusetts law

If your agents can reach personal information about Massachusetts residents, 201 CMR 17.00 (opens in a new tab) already applies to them. It asks you to restrict access to records containing personal information to those who need it for their job, and to monitor systems for unauthorized use. An agent with narrow tools and a complete log meets those words when the user is software.

If an injected instruction gets an agent to send that information out, it can be a breach under M.G.L. c. 93H (opens in a new tab), which requires notice as soon as practicable and without unreasonable delay. The approval step and the egress limits above are what keep an attempt from becoming a notice.

How LTFI contains prompt injection

LTFI is the agentic business operating system Kief Studio makes and runs, and we run our own company on it. We built it on the assumption that an agent will be fooled sometimes. These controls ship with it today.

  • Anything that sends, posts, publishes or spends waits in one queue for the person who owns it, on a computer or a phone.
  • Standing approvals are given for one kind of work and taken back at any time.
  • Rules, permissions, credentials, deleting and money stay with people. An AI teammate can't change them.
  • The activity log records every action by the staff and the team in plain words, newest first, with who approved it.
  • Each company runs on its own dedicated server, managed, patched and watched by us.

What to do about prompt injection this month

Two lists: one for the person who owns the business, one for whoever runs its systems.

If you own the business

  1. List which agents read outside content: email, web pages, uploaded files and form submissions.
  2. For each one, write down what it can do besides read. Anything that sends, pays or deletes should need your yes.
  3. Ask every AI vendor what happens when an agent is fooled, and ask to see the approval step.
  4. Read the activity log once a week until you know what normal looks like.

If you run the systems

  1. Mark untrusted content in every agent's context, and keep rules a person wrote apart from notes an agent learned.
  2. Cut each agent's tools and permissions to the minimum, and split read agents from act agents where you can.
  3. Allowlist outbound destinations and turn off automatic loading of remote images and links in agent output.
  4. Log every tool call before it runs, and alert on failed tool calls and unexpected destinations.

Key takeaways

  • Prompt injection is an instruction hidden in content an agent reads, and the indirect kind, planted in email, pages and files, is the one that reaches a small business.
  • No model reliably separates instructions from data today, so design for the day an agent gets fooled.
  • Narrow tools, human approval, egress limits and rules kept apart from learned notes keep a fooled agent from doing real harm.
  • A log written before each action tells you what an attack touched.

Where this lines up with the standards

The frameworks and rules this page maps to, with the exact item and what it asks of you.

FrameworkItemWhat it asks
OWASP Top 10 for LLM ApplicationsLLM01 Prompt Injection; LLM06 Excessive Agency (opens in a new tab)Segregate external content, enforce least privilege, and require human approval for high-risk actions.
OWASP Top 10 for Agentic ApplicationsASI01 Agent Goal Hijack; ASI02 Tool Misuse and Exploitation; ASI06 Memory and Context Poisoning (opens in a new tab)Contain goal hijack, limit tool misuse, and keep poisoned memory from steering an agent.
NIST adversarial machine learning taxonomyNIST AI 100-2e2025 (opens in a new tab)Assume prompt injection is possible whenever a model reads untrusted input, and design around it.
UK NCSCPrompt injection is not SQL injection (opens in a new tab)Reduce impact with deterministic safeguards, lower privileges for outside content, and logging.
Massachusetts201 CMR 17.00 and M.G.L. c. 93H (opens in a new tab)Restrict access to personal information, monitor for unauthorized use, and give notice if it leaks.

Key terms

Questions

Prompt injection

What is prompt injection in AI agents?

It's an instruction hidden in something an agent reads, such as an email, a web page or a file, that makes the agent do what the attacker wants. Because agents can act, the result can be a sent email or a deleted record as well as a wrong answer.

What is the difference between direct and indirect prompt injection?

Direct prompt injection is typed by the person using the AI. The indirect kind is planted in content the agent reads later, like an email or a document, by someone who never touches your system.

Can prompt injection be prevented?

Not completely with today's models. OWASP, NIST and the UK NCSC all say current defenses don't offer full protection. You reduce the impact with narrow tools, human approval for risky actions and limits on where data can go.

How do I protect my business from prompt injection?

Treat everything an agent reads as untrusted content, give each agent only the tools its job needs, make a person approve anything that sends, pays or deletes, and keep a log of every action.

Can an email hack my AI assistant?

An email can carry hidden instructions, and an assistant that reads it may try to follow them. If that assistant can't send, pay or delete without your approval, the attempt stops in the queue.

Is prompt injection on the OWASP list?

Yes. It's LLM01 on the OWASP Top 10 for LLM Applications, and it's the main route to agent goal hijack, ASI01 on the OWASP Top 10 for Agentic Applications.

Keep reading

  • A heavy threshold gate lets one cleared path through while dozens of pink trails stop at it.

    Start here

    Agentic AI security

    Agentic AI security explained for owners: identity, least privilege, approvals and an audit trail for AI agents, from the team that runs them in Massachusetts.

    Brian Gagne

  • Ten black pillars veined with pink fractures stand in a row, and three amber rings thread through every one of them.

    Threats

    OWASP Agentic Top 10

    The OWASP Agentic Top 10, ASI01 to ASI10, explained for owners: each risk in everyday terms, a small-business example, and the control that answers it.

    Brian Gagne

  • A blurred hub drowns in pink cables while a clean hub in front holds one amber line.

    Identity and access

    AI agent permissions

    AI agent permissions decide what an agent can read, change and send. How to scope its tools, catch permission drift and run an access review.

    Brian Gagne

  • Many pink cables converge on one hub, and every connection passes through its amber iris.

    Threats

    MCP security

    MCP security for businesses running AI agents: what the Model Context Protocol's authorization rules require, and how to vet servers and stop tool misuse.

    Brian Gagne

  • A pink stream of light is held at a round amber valve gate, waiting for a person's yes before anything leaves.

    Oversight

    Human approval for AI agents

    Human approval for AI agents that people actually read: which actions need a yes, how to avoid approval fatigue, and how standing approvals work.

    Amelia Gagne

  • A column of stacked plates with pink-lit seams sealed by an amber top.

    Oversight

    Audit trails for AI agents

    An AI agent audit log proves what an agent did, who asked and who approved it. What to record, how to keep it tamper evident, and how long to keep it.

    Amelia Gagne

  • Reference

    Glossary

    An agentic AI glossary in plain words: AI agents, agentic IAM, non-human identities, prompt injection, shadow AI, MCP and more, each with a short definition.

Most MSPs are resellers. Kief Studio is the manufacturer.

A reseller sends your problem to the company that made the software. We are that company: we build LTFI and run it, so the people you talk to can change it. Book a walkthrough and see it on your own business.

Nothing plays until you press play.