← All Labs
🛡 AI HACKING ADVANCED +145 XP · +65 no-hint bonus

AI Tool Poisoning — Hostile MCP Tool Description Hijacks the Agent

DevBot uses MCP-style tool discovery — it auto-discovers available tools at startup and reads their descriptions to decide when to call them. The tool DESCRIPTIONS are part of its system context. Register a hostile tool whose description contains injection instructions. When DevBot reads the tool registry, those instructions become part of its system prompt — hijacking it on the next user message.

📖 Read the walkthrough: how this attack works, real-world cases and defences (solution behind a spoiler)

https://bookshop.local/search

What is tool poisoning?

An agent learns what its tools do by reading their descriptions. These are supplied by whoever built the tool, and users rarely read them in full.

Tool poisoning hides instructions in a description. The tool may never be called. Having it connected is enough, because the model reads every description when deciding what to do. A server can also change a description after you approved it.

A real case

Tool poisoning in the Model Context ProtocolApril 2025

Invariant Labs showed that an MCP tool's description, which the user rarely reads but the model always does, can carry hidden instructions. A harmless-looking tool told the agent to read local keys and configuration files and pass them out through another tool. A server can also change a description after it has been approved.

This lab recreates that setup: the agent reads the tool descriptions at start-up, and one of them contains more than a description.

Source: Invariant Labs

How to fix it

  • Review the full description of every tool before connecting it.
  • Pin tool definitions and alert when they change.
  • Connect only servers from sources you trust, and keep the number small.
  • Isolate third-party tools so one server cannot influence how another is used.

Questions people ask

What is an MCP rug pull?

A server that shows a harmless tool description when you approve it and changes it later.

Does a poisoned tool need to be called?

No. Its description is read by the model whether or not the tool is used.

How can I see what my model sees?

Print the raw tool list your client sends to the model, including the full descriptions and parameter notes.

Read the full Prompt Injection guide · All free labs · AI red team certification