AI Agent Security

Tool Call Injection in AI Agents

Tool call injection is an attack technique where crafted input, retrieved content, or compromised tool output causes an AI agent to invoke tools, APIs, or functions in ways the developer did not intend. Unlike prompt injection, which targets what an LLM says, tool call injection targets what an agent does. This makes it an action-layer risk that requires runtime controls such as schema validation, permission scoping, and policy enforcement, rather than text-based filtering alone.

What Makes Tool Call Injection Different

Traditional prompt injection concerns itself with manipulating the text an LLM produces. Tool call injection goes a step further: it manipulates the actions an agent takes. When an agent has access to tools such as file systems, databases, payment APIs, or code execution environments, a manipulated tool call can result in real-world consequences, including data exfiltration, unauthorized transactions, or destructive operations, regardless of whether the model's visible output looks benign.

Because the attack surface sits at the boundary between model reasoning and tool execution, defenses that only inspect or filter text are structurally incomplete. Effective mitigation requires controls that operate at the point where a tool call is actually constructed and executed.

How Attackers Manipulate Tool Calls

Tool call injection can originate from several sources, each exploiting a different point in the agent's processing pipeline:

  • Direct injection: An attacker supplies input directly to the agent that includes instructions designed to alter which tool is called or with what parameters.
  • Indirect injection: Malicious instructions are embedded in retrieved content, such as a webpage, document, or email, that the agent processes as part of its context.
  • Compromised tool output: A tool or upstream service returns manipulated results that, when fed back into the model's context, trigger further unintended tool calls.
  • Schema manipulation: Malformed or unexpected parameters are passed to a tool call in an attempt to bypass validation logic or trigger unintended behavior in the receiving system.

Where MCP Changes the Attack Surface

The Model Context Protocol (MCP) standardizes how agents discover and invoke tools across client-server connections. Standardization improves interoperability, but it also changes the defensive requirements for tool call injection.

LayerWhat happens here
Input layerDirect and indirect prompts enter the model context.
Reasoning layerThe model selects and parameterizes a tool call.
Action layerThe tool, API, or function is actually executed.
Output layerTool results re-enter context and can trigger further calls.

Excessive Agency as an Amplifier

Tool call injection is most damaging when an agent has more privilege than a given task requires. If an agent holds standing credentials to many systems, a single successful injection can cascade across those systems. Scoping permissions tightly, and re-evaluating that scope per session or per tool, limits the blast radius of any individual manipulated call.

Governance and Accountability

Because tool calls produce real actions, organizations deploying agents need the same auditability they would expect of any system with production access: a record of what was called, with what parameters, on whose authority, and under what policy. Without that record, detecting and responding to a tool call injection incident after the fact becomes significantly harder.

Where MCP Changes the Attack Surface

  1. 1

    Standardized discovery, standardized risk

    The Model Context Protocol standardizes how agents discover and invoke tools across client-server connections, which changes both the attack surface and the defensive requirements for tool call injection.

Runtime Controls That Address Tool Call Injection

Mitigating tool call injection requires controls that sit between model reasoning and tool execution, not just filtering on the text an LLM produces.

  • Schema validation

    Enforce schema validation on every tool definition and parameter set so malformed or unexpected calls are rejected before execution.

  • Least-privilege scoping

    Apply least-privilege permission scoping per agent, per session, or per tool rather than granting standing, broad credentials.

  • Policy enforcement point

    Insert a policy enforcement point between model output and tool execution to intercept, log, or block disallowed calls in real time.

  • Output sanitization

    Sanitize and constrain tool outputs before they re-enter model context to limit indirect injection through chained tool calls.

  • Untrusted MCP servers

    Treat external MCP servers as untrusted by default, applying authentication, authorization, and content verification before accepting their tool schemas.

  • Human-in-the-loop approval

    Require human-in-the-loop approval for high-impact or irreversible actions identified during risk assessment.

Govern Tool Calls Before They Execute

Trussed AI provides runtime governance for enterprise AI agents, including permission scoping, tool approval workflows, and audit logging for agent tool calls, including those made through MCP.

Explore MCP Security