---
title: "What is tool poisoning in MCP? Attacks and defenses"
description: "Tool poisoning hides malicious instructions in MCP tool descriptions that the model reads but users never see. How the attack works, rug pulls, and defenses."
type: "glossary-term"
canonical_url: "https://theaiengineering.com/glossary/tool-poisoning"
markdown_url: "https://theaiengineering.com/glossary/tool-poisoning.md"
topic: "Model Context Protocol"
author: "The AI Engineering Editors"
publisher: "The AI Engineering"
updated: "2026-11-06"
keywords: ["Tool poisoning","tool poisoning attack","MCP tool poisoning"]
citation: "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"
---

# What is tool poisoning in MCP? Attacks and defenses

Also called tool poisoning attack, MCP tool poisoning.

> **Definition of Tool poisoning:** 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](https://theaiengineering.com/glossary/mcp-server). Invariant Labs [disclosed the attack](https://invariantlabs.ai/blog/mcp-security-notification) 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_email` tool to an attacker's address, and the malicious server never appeared in the agent's user-facing log.

The [OWASP MCP Top 10](https://owasp.org/www-project-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](https://theaiengineering.com/glossary/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](https://theaiengineering.com/glossary/tool-calling) 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](https://modelcontextprotocol.io/specification/2026-07-28/server/tools) 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](https://theaiengineering.com/glossary/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](https://theaiengineering.com/glossary/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](https://theaiengineering.com/articles/how-to-build-an-mcp-server) covers the server author's side of these defenses.

## Related terms

- [Prompt injection](https://theaiengineering.com/glossary/prompt-injection): Prompt injection is an attack in which text supplied to a large language model, typed by a user or hidden in content the model reads, alters the application's intended behavior or output.
- [MCP server](https://theaiengineering.com/glossary/mcp-server): An MCP server is a program that exposes tools, resources, and prompts to AI applications through the Model Context Protocol, running locally over stdio or remotely over Streamable HTTP.
- [Model Context Protocol (MCP)](https://theaiengineering.com/glossary/model-context-protocol): Model Context Protocol (MCP) is an open protocol, introduced by Anthropic in November 2024, that standardizes how AI applications connect to external tools, data sources, and prompts through MCP servers.
- [MCP gateway](https://theaiengineering.com/glossary/mcp-gateway): An MCP gateway is a proxy that sits between MCP hosts and many MCP servers, exposing them through one endpoint and centralizing authentication, tool access policy, and audit logging.
- [Guardrails](https://theaiengineering.com/glossary/guardrails): Guardrails are programmatic checks placed around a large language model that validate, filter, or block inputs, outputs, and tool calls so an AI application stays within its safety, security, and policy limits.
- [Tool calling](https://theaiengineering.com/glossary/tool-calling): Tool calling is an LLM capability in which the model, given a list of tool definitions, outputs a structured request naming a tool and its arguments, which the application executes and returns.

## Guides that cover tool poisoning

- [How to build an MCP server: a Python and TypeScript tutorial](https://theaiengineering.com/articles/how-to-build-an-mcp-server): Learn how to build an MCP server with the official Python and TypeScript SDKs: tools, resources, transports, testing, client config, and production security.
- [What is the Model Context Protocol (MCP)? How it works](https://theaiengineering.com/articles/what-is-model-context-protocol): The Model Context Protocol (MCP) is an open standard for connecting AI apps to tools and data. Learn its architecture, transports, tool calls, and security.

Part of the [Model Context Protocol](https://theaiengineering.com/topics/mcp) topic hub.

## 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: 2026-11-06
- URL: https://theaiengineering.com/glossary/tool-poisoning
- Markdown: https://theaiengineering.com/glossary/tool-poisoning.md
