genai
SECURITY LAB
IncidentsAgent abuse

Tool Poisoning: Hiding an Attack in an MCP Tool's Description

High severityApril 2025LLM01: Prompt InjectionLLM04: Supply ChainLLM02: Sensitive Information Disclosure
Status: Architectural attack class (no CVE); disclosed by Invariant Labs; prompted MCP clients to add tool-description scrutiny
On this page

The user reads a friendly tool name; the model reads a paragraph of hidden instructions attached to it.

WhenApril 2025
TargetMCP-enabled AI agents (demonstrated on Cursor)
ResearcherInvariant Labs (Beurer-Kellner, Fischer)
TechniqueTool-description poisoning + tool shadowing
StatusArchitectural attack class — no CVE
Attack flow
  1. 1A malicious MCP server ships a tool whose description contains hidden instructions
  2. 2The agent reads the full description and follows the injected instructions
  3. 3It reads and exfiltrates local secrets (e.g. ~/.ssh/id_rsa) through tool-call parameters

What happened

In April 2025, Invariant Labs described tool-poisoning attacks on the Model Context Protocol. An MCP tool ships a natural-language description that the model reads to decide how to use it. By hiding instructions in that description — invisible to the user, authoritative to the model — a malicious server steered an agent to read sensitive files such as ~/.ssh/id_rsa and ~/.cursor/mcp.json and leak them through tool-call arguments. A follow-up showed a malicious public-repo issue coercing an agent into leaking private code via an auto-opened pull request.

How the attack worked

Clients typically show users a short, friendly tool name while passing the full description to the model. The poisoned description carried the real payload. Invariant also demonstrated 'shadowing', where a malicious server rewrites how the agent treats a trusted server's tools.

Root cause

Tool metadata is untrusted input, but agents treat it as trusted configuration — and users never see the text the model actually acts on.

Why it matters

As agents wire up dozens of third-party MCP servers, each tool description becomes an injection surface that no conversation-level filter inspects. One poisoned tool can exfiltrate developer secrets.

How to prevent it

  • Show users the full tool metadata, not a summarised name.
  • Pin and review tool descriptions and versions; isolate untrusted servers.
  • Require approval for sensitive tool calls like reading key material.

Feel it yourselfThe replay lab recreates an agent being coerced into an out-of-band exfiltration call — the class behind tool poisoning.

FAQ

What is 'tool poisoning'?

MCP tools ship a natural-language description that the model reads to decide how to use them. If that description contains hidden instructions, the model follows them — so the injection lives in tool metadata the user never inspects, not in the conversation.

What is tool 'shadowing'?

A malicious MCP server can also rewrite how the agent treats a trusted server's tools — 'shadowing' a legitimate tool to change its behaviour without touching it directly.

How do you defend MCP agents?

Pin and review tool descriptions and versions, show users the full (not summarised) tool metadata, isolate untrusted servers, and require approval for sensitive tool calls like reading key material.

Replay this attack
Coerce a tool-using agent into leaking data through an out-of-band call — the class behind MCP tool poisoning.
Open the live lab
Runs as a live, sandboxed lab, free with a sign-in. Recreates the attack class, not this exact branded bot.