What is tool poisoning in MCP? Attacks and defenses
Also called tool poisoning attack, MCP tool poisoning
Definition
Tool poisoning is an attack in which a malicious or compromised MCP server hides instructions in a tool's description or schema, which the model reads as trusted context and may follow.
Tool poisoning is an attack that hides instructions for the model inside a tool's metadata, most often the description of a tool on an MCP server. Invariant Labs disclosed the attack on April 1, 2025, as Tool Poisoning Attacks, describing malicious instructions that are "invisible to users but visible to AI models." Hosts typically pass listed tool definitions to the model as context, so a poisoned description can steer an agent even when the agent never calls that tool.
How tool poisoning works#
Tool poisoning works because the model reads the full tool definition while the user usually sees only a tool name or a short summary. An attacker publishes a tool that looks harmless and appends instructions, often marked as important, that tell the model to read files, change arguments to another tool, or hide what it is doing from the user.
In Invariant's demonstration, an add tool's description told the agent in Cursor to read ~/.cursor/mcp.json and ~/.ssh/id_rsa and pass their contents in a sidenote argument, without mentioning it to the user. The confirmation dialog showed a summarized call, so the user could not see the SSH key leaving in the arguments. The same disclosure described two variants:
- Rug pull: the server changes a tool's description after the user has approved it, so a server that was safe at install time turns malicious later.
- Shadowing: a malicious server's description changes how the agent uses a different, trusted tool. In Invariant's test, a fake tool's description made the agent send every email through a trusted
send_emailtool to an attacker's address, and the malicious server never appeared in the agent's user-facing log.
The OWASP MCP Top 10, still in beta, lists tool poisoning as MCP03.
Tool poisoning vs prompt injection#
Tool poisoning is a specific form of indirect prompt injection, and Invariant Labs classifies it that way. The difference is the channel. General indirect injection arrives in content the model processes, such as a web page or a tool result. Tool poisoning arrives in tool metadata that the host loads before any call is made.
| Indirect prompt injection | Tool poisoning | |
|---|---|---|
| Where the payload sits | Data the model reads: web pages, emails, tool results | Tool names, descriptions, and input schemas |
| When it enters context | When the agent fetches the content | When the host lists tools, before any call |
| Who can plant it | Anyone who can write content the agent reads | The server's author, or whoever compromises the server |
| OWASP entry | LLM01 in the Top 10 for LLM Applications | MCP03 in the MCP Top 10 (beta) |
The distinction changes where defenses go. Filtering tool results catches injected data but misses a poisoned description, which never passes through a tool call result at all.
How to defend against tool poisoning#
Defenses against tool poisoning combine showing users what the model sees, pinning approved tool definitions, and limiting what any tool can reach. Invariant Labs recommends displaying full tool descriptions, pinning server and tool versions with hashes, and enforcing dataflow boundaries between servers, while the MCP specification puts consent and confirmation on the host.
The MCP tools specification says clients must treat tool annotations as untrusted unless they come from trusted servers, should show tool inputs to the user before calling the server to avoid data exfiltration, and should keep a human in the loop who can deny a tool invocation. In practice:
- Show the full description and the full arguments in every approval dialog.
- Pin each approved tool definition by hash, and block a tool whose description changes until a user approves it again.
- Allowlist servers, and route them through an MCP gateway that enforces the allowlist and logs every call.
- Grant each server the least privilege that works, because a poisoned instruction can only use access the agent already has.
Input guardrails add a check at the other end of the attack, for example by flagging a private key inside a tool argument. How to build an MCP server covers the server author's side of these defenses.
Related terms
Guides that cover tool poisoning
Cite this definition
The AI Engineering Editors. "What is tool poisoning in MCP? Attacks and defenses." The AI Engineering, updated Nov 06, 2026. https://theaiengineering.com/glossary/tool-poisoning
- Title
- What is tool poisoning in MCP? Attacks and defenses
- Author
- The AI Engineering Editors
- Publisher
- The AI Engineering
- Updated