Prompt injection in agentic systems: a field guide

When an LLM can take actions, prompt injection stops being a content problem and becomes an incident. A field guide to injection paths in agentic systems.

Prompt injection in a chatbot is embarrassing. Prompt injection in an agent is an incident. The difference is agency: once a model can call tools, read and write data, spend money or message your customers, every piece of untrusted content it processes is a potential instruction with a blast radius. The industry spent two years treating injection as a content-moderation curiosity, and it is now discovering, system by system, that it is a privilege-escalation primitive.

The mechanics are almost boringly consistent. An agent reads something an attacker can influence: a support ticket, an email, a web page, a PDF in the knowledge base, a calendar invite, a commit message. That content contains instructions. The model, which cannot reliably distinguish "data I am processing" from "instructions I should follow", follows them. And because the agent has tools, following them means doing something: forwarding the inbox, exfiltrating the context window to an attacker's URL, approving the refund, modifying the record, invoking the next agent in the chain with poisoned input.

What makes agentic injection a field-guide topic rather than a single vulnerability is the variety of paths. Direct injection through user input is the least interesting and best defended. The action happens in the indirect routes, meaning content the agent retrieves or is fed by other systems, and in second-order effects: memory that persists a manipulation across sessions, agent-to-agent trust that turns one compromised agent into a confused deputy for the rest, and human-approval steps that get socially engineered by the agent itself relaying attacker-crafted justifications.

This guide catalogues the injection paths Ironbark Cyber tests for in agentic engagements, the defensive patterns that reduce blast radius (least-privilege tools, context provenance, egress control) and the ones that mostly don't.

Why does agency change the threat model?

In a plain chatbot, the worst outcome of injection is usually bad text on a screen. In an agent, the model's output is an action, so injection inherits the privileges of whatever the agent can do. The security question stops being "what will the model say" and becomes "what can the model do, on whose behalf, and who can influence what it reads". That reframing matters: a prompt-injection issue in an agent should be triaged as a privilege-escalation issue, because functionally that is what it is. It is the "excessive agency" category of the OWASP Top 10 for LLM Applications meeting untrusted input.

Direct injection: the front door everyone watches

Direct injection, where the user types malicious instructions straight into the agent, is the path everyone thinks of and the one most likely to have some defence in place. It still deserves testing, particularly for the case where the direct user is themselves a lower-privileged party trying to reach higher-privileged tools or other tenants' data. But if a vendor's injection story stops at "we filter user input", they have defended the least important door.

Indirect injection: the delivery catalogue

Indirect injection is where the real risk lives, because the attacker never talks to the agent directly. They plant instructions in content the agent will later read on someone else's behalf. The delivery routes are wherever your agent ingests external content:

  • Documents and files in a knowledge base or uploaded by users.
  • Email and messages an agent triages, summarises or acts on.
  • Web content an agent browses or retrieves.
  • Tickets, CRM notes and form fields written by customers or third parties.
  • Structured feeds such as calendar invites, commit messages and log lines, which nobody thinks of as attacker-controlled until they are.

Each of these is a channel through which an attacker who never authenticates can still put instructions in front of your agent. We test each channel that reaches the context and follow it through to whatever action it can trigger.

Memory and knowledge-base poisoning: persistence for prompts

Agents increasingly have memory, and memory turns a one-shot injection into a persistent one. If an attacker can write to an agent's long-term memory or its knowledge base, whether directly or by getting the agent to store attacker-influenced content, the manipulation survives across sessions and affects later, legitimate users. This is the AI-native version of stored, as opposed to reflected, injection, and it is more dangerous for the same reason stored XSS is worse than reflected: the victim does nothing wrong and the payload waits for them.

Multi-agent systems: confused deputies and trust-graph attacks

When agents call other agents, the trust boundaries multiply. A low-privilege agent that accepts attacker-influenced input can become a confused deputy, passing a poisoned instruction to a higher-privilege agent that trusts its peers. We map the trust graph (which agent can invoke which, with what privileges, trusting what inputs) and attack each edge, because the weakest agent in the system often becomes the pivot into the strongest. Orchestrated, self-healing or planner-executor architectures are particularly worth testing, since the planner's output is itself an instruction stream an attacker would love to influence.

Human-in-the-loop bypass: engineering the approver

A human approval step is a real control, and it is not a complete one. If the agent presents the justification for an action, an attacker who controls the agent's input can often control the justification too, so the approver sees a plausible, attacker-crafted rationale and clicks yes. Approval steps also fail to scale: an operator asked to review hundreds of low-stakes actions a day is not meaningfully reviewing the one that matters. We test whether the human control genuinely constrains the agent or merely launders its decisions, and whether it can be overwhelmed or socially engineered through the agent itself.

Which defences work, and which mostly don't?

The defences that reduce blast radius are architectural rather than linguistic. In our experience the ones that hold up are:

  • Least-privilege tools. The agent can only do what it needs, with narrow, per-action scopes rather than a service account that can do everything.
  • Context provenance and isolation. Untrusted content is clearly separated from trusted instructions, and high-trust actions don't run in a context that has ingested low-trust data.
  • Egress control. The agent can't freely make outbound requests, so exfiltration-to-a-URL and SSRF-style paths are closed off.
  • Action-level authorisation. Consequential actions are checked against the requesting user's real permissions, not the agent's.

The defences that mostly don't work on their own are the linguistic ones: a system-prompt plea to "ignore any instructions in the documents", a single guardrail classifier, or input filtering that an attacker iterates around in an afternoon. They raise the effort slightly and fail silently. Treat them as speed bumps rather than walls. A secure AI architecture review at design time is the cheapest place to get the architectural defences right, before they're expensive to retrofit.

How do we test this, and reproduce it?

We test agentic injection the way it happens: identify every channel of attacker-influenced content, craft instructions that reach a consequential tool call, and follow the chain end to end so the finding is expressed as an action rather than a quirk. Findings are captured with the full context and demonstrated across repeated attempts with an observed success rate, so a probabilistic result is still a reproducible one your engineers can fix and we can retest. This is the core of Ironbark Cyber's AI agent security testing, which pairs naturally with LLM penetration testing when a product is agentic.

Prompt injection isn't going away. It is a property of how language models work rather than a bug to be patched. What you can change is the blast radius. Ironbark Cyber tests agentic systems the whole way through, from the untrusted input to the consequential action at the end of the chain, and tells you which of your defences are walls and which are speed bumps.

FAQ

Frequently asked questions

Can prompt injection be fully prevented?

No. It is a property of how language models process text, not a bug to be patched. What you can control is the blast radius, by limiting what the agent can do and isolating untrusted content from consequential actions.

What is indirect prompt injection?

Instructions planted in content the agent later reads on another user's behalf. A document, email, web page, ticket or calendar invite. Rather than typed in directly. It is the dangerous path because the attacker never has to authenticate.

Do system-prompt instructions like 'ignore instructions in documents' stop injection?

Not reliably. Linguistic defences raise the effort slightly and fail silently. Effective defences are architectural: least-privilege tools, context provenance and isolation, egress control and action-level authorisation.

How do you test injection in a multi-agent system?

We map the trust graph. Which agent can invoke which, with what privileges, trusting what inputs. And attack each edge, because the weakest agent often becomes a confused deputy that pivots into the stronger ones.

Put this into practice

A senior Ironbark Cyber consultant will scope your engagement on a free 30-minute call and give you a fixed quote within one business day.