What tool use means inside an autonomous agent
Agent tool-use vulnerabilities arise the moment a language model is allowed to act, not just answer. An agent is a system where the model dynamically directs its own process and tool usage, maintaining control over how it accomplishes a task, while a workflow orchestrates models and tools through predefined code paths written in advance. That distinction, drawn by Anthropic in its guide to building effective agents, is the starting point for the whole threat model: in a workflow, a person has already decided which operations come next; in an agent, the model decides, step by step, in response to what it has just seen.
The basic building block is an augmented language model: a model enhanced with retrieval, tools and memory. The loop runs in a repeating pattern. The model receives a goal, decides which tool to call and with what arguments, and returns a structured tool call. Code outside the model executes that call against a real system — a search service, a database, an email service, a code runner — and the result returns into the model’s context as new input. Every turn of the loop is therefore a handoff between a probabilistic model that produces text and deterministic code that performs actions with real consequences.
The security problem sits at that handoff. A tool is declared to the model with a name, a description and a parameter schema, and the model chooses among the declared tools on the basis of those descriptions. The result of a tool call arrives as text in the model’s context, alongside the system instructions and the user’s request, and untrusted tool content can be misinterpreted as instructions despite its intended role as data; a marking that labels content as data does not by itself guarantee the model will treat it that way. Research on indirect prompt injection puts the point plainly: applications built on language models blur the line between data and instructions.
Prompt injection through untrusted content

The primary vulnerability class is prompt injection through untrusted content, and its most consequential form for agents is indirect: the attacker never talks to the model directly. In the research by Greshake and colleagues, adversaries inject prompts into data likely to be retrieved at inference time — a web page, a document, a search result, an email — and the application processes that data as part of its normal work. The injected prompt does not need the user’s cooperation, and it does not need a direct interface to the model.
The demonstrated effects go well beyond a misleading answer. The Greshake paper derives a taxonomy of impacts including data theft, worming and contamination of the information ecosystem, and shows retrieved prompts acting as arbitrary code execution in effect: processing them can manipulate the application’s functionality and control how and if other APIs are called. In the paper’s demonstrations, against both real-world systems such as Bing’s GPT-4 powered chat and synthetic applications built on GPT-4, an injected prompt could steer the application into calling APIs the user never asked for.
OWASP’s Top 10 for Agentic Applications, published in December 2025, names this pattern as its first risk, ASI01 Agent Goal Hijack, and ties it to reported incidents in which hidden prompts turned copilots into silent exfiltration engines, citing the EchoLeak case as an example. The lesson is structural: if a tool result can contain instructions, every read of external content is also a possible write to the agent’s plan.
Excessive authority and the confused deputy
The second vulnerability class is excessive authority: the agent holds more power than the task requires, and an attacker who can steer one decision inherits all of it. OWASP names the operational consequence ASI02 Tool Misuse, in which agents bend legitimate tools into destructive outputs, and the identity consequence ASI03 Identity and Privilege Abuse, in which leaked credentials let agents operate far beyond their intended scope. The two risks compound. A hijacked goal is bad; a hijacked goal executed with broad credentials across production systems is much worse.
The pattern is the confused deputy in agent form. The agent is a legitimate deputy, acting on the user’s behalf with the user’s tools and permissions. When injected content or a manipulated input redirects it, the agent still uses legitimate tools, in legitimate ways, for a goal the user never set. Individual calls may look entirely normal, which is what makes the pattern hard to catch by inspecting them one by one. What has changed is the goal the call serves. The risk is sharpest for irreversible actions: deleting records, moving money, sending messages to customers, modifying code or systems. Anthropic’s framework for safe agents makes the same point from the design side, noting that humans should retain control over how agent goals are pursued, particularly before high-stakes decisions are made.
Authority can also accumulate silently: capabilities and credentials can remain available in later steps unless scoped or revoked, so permissions must be limited to the task at hand, and an action that cannot be undone is a different category from a read-only lookup.
Data leakage and exfiltration through tools
Data leakage through tools is the quiet counterpart to destructive misuse. It does not break anything, which is why it can run unnoticed. The Greshake taxonomy includes data theft as a first-class impact of indirect prompt injection: an injected prompt can steer the application into gathering a user’s sensitive information and moving it somewhere the attacker controls, through the side effects of ordinary tool calls and queries. The OWASP EchoLeak example for ASI01 makes the same point in production terms — hidden prompts turning a copilot into a silent exfiltration engine, with the user seeing nothing unusual in the conversation itself.
Three useful, overlapping leakage pathways illustrate the risk, and they can combine rather than belonging exclusively to different steps of the loop. First, sensitive material can be copied into tool arguments: the model includes private context in a call to an external service, a search query or a logging endpoint, because the argument looked relevant to the task. Second, tool results can embed secrets into the model’s context, where they can affect later calls while retained in accessible context or stored state. Third, chained calls can launder data from a trusted source to an untrusted destination: one tool legitimately retrieves an internal record, and a second tool legitimately sends a message or writes to an external system, and neither call is individually suspicious. The vulnerability is in the chain, not in either link. The pathways overlap: a chained call can itself carry sensitive material in its arguments.
Chained attacks, poisoned state and supply-chain risk
Multi-step attacks are where the individual vulnerabilities combine. Consider an illustrative chain, assembled from the patterns the research documents rather than from a single reported incident. An agent reads a document returned by a search tool; the document contains an instruction the user never wrote. The model follows it and calls a messaging tool with material from the conversation. The attack exists only in the sequence, and only because the first step’s output became the second step’s instruction. That is the shape the research demonstrates in general form.
Poisoned state extends the same shape across time. OWASP’s ASI06, Memory and Context Poisoning, covers stored material that reshapes behaviour long after the initial interaction: a stored note carrying an injected instruction is read again on later runs and steers each of them. Every tool result must therefore be treated as untrusted data, not as instructions.
The supply chain adds a third entry point, and the Model Context Protocol is the clearest current example. MCP, introduced by Anthropic in November 2024, lets applications connect to external tools and data sources through a standard protocol. The model decides which tools to call based on their descriptions, and those descriptions are text written by the server’s developers. In April 2025, Trail of Bits showed that a malicious MCP server could attack a user before any tool was called, by hiding instructions inside the tool descriptions returned when the client asked what tools the server offered; the model read those descriptions into its context and obeyed them. By November 2025, researchers had pulled an entire WhatsApp message history out of an agent through a poisoned MCP integration, according to reports of the demonstration. OWASP’s ASI04, Agentic Supply Chain Vulnerabilities, generalises the point: agents pull in plugins, prompt templates, MCP servers and registries at runtime, and each one is a trust decision, not just a dependency.
Defences that reduce agent tool-use vulnerabilities

The defences the sources document are layered controls, not a single fix, and none of them is presented in the research consulted here as eliminating prompt injection or tool misuse on its own. The first layer is least privilege, applied per task: the agent receives only the tools and permissions the current task requires. The second is approval before irreversible action. Anthropic’s safe-agents framework describes the pattern in a concrete product: Claude Code runs with read-only permissions by default and must ask for human approval before taking any actions that modify code or systems, while users can grant persistent permissions for routine tasks they trust it to handle. The principle generalises beyond one product, even though the exact defaults are product-specific.
The third layer is deterministic enforcement in code, not in the prompt. A sentence in a system prompt asking the model to check first is not a gate; a gate is a check in the execution path that runs whatever the model decides. The fragment below is a fragment, not a complete program, and it illustrates the shape of such a gate in generic terms, with no vendor-specific syntax:
def check_tool_call(tool, args, policy):
# Fragment: deterministic checks before execution.
# The policy, not the model, decides what may run.
if tool.name not in policy.allowed_tools:
return "deny"
if tool.is_irreversible and not policy.human_approved:
return "ask_human"
if not policy.arguments_valid(tool, args):
return "deny"
return "allow"The fragment’s point is the placement of the decision. The policy check runs in code, before execution, and its verdict — allow, ask a human, or deny — does not depend on whether the model feels the call is safe. Argument validation and sandboxing belong to the same layer. The fourth layer is logging of every tool call, so a chained attack leaves a trace a person can inspect.
The honest boundary, stated plainly, is that the sources consulted for this article do not establish measured success rates for these defences against indirect prompt injection in production agents. They document controls and incident categories; they do not prove a given combination stops a determined attempt. Treat the defences as risk reduction, not a guarantee, and keep human review mandatory for the highest-stakes actions.
A threat-model checklist before shipping
Before a tool-enabled agent reaches real users or real systems, answer the checklist below in writing, for the specific agent, not in general. First, list every tool the agent can call, the authority each tool carries, and the worst case if that tool is used for someone else’s goal — then remove every tool and permission the task does not need. Second, decide which calls are irreversible or externally visible, and put a human approval gate in code in front of each one. Third, test with adversarial material: injected instructions in tool results, poisoned tool descriptions, and documents written to redirect the agent, and confirm that the deterministic checks, not the model’s judgement, block the dangerous calls.
Fourth, trace the data: for each tool, record what material it receives as arguments and where its results can go next, and confirm that no chain moves sensitive material from a trusted source to an untrusted destination without a check in between. Fifth, review the supply chain: every MCP server, plugin and tool registry the agent loads at runtime, who publishes it, what its descriptions say, and whether its version is pinned and its contents reviewed before it reaches the model. Sixth, confirm the audit trail: every tool call, its arguments, its result and the decision that approved it are logged in a form a person can inspect, and the agent can be stopped mid-run without losing that record. If several answers are no, the work to do first is fixing the authority, the gates or the logging.












