cd /news/ai-agents/mcp-tool-poisoning-why-a-math-tool-a… · home › topics › ai-agents › article
[ARTICLE · art-176806] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↓ negative

MCP tool poisoning: why a math tool asked for an SSH key

A developer's in-memory simulation of an MCP tool-poisoning attack, run on Node 22.13.1, found that a scripted client obeyed hidden instructions embedded in a poisoned tool description in all three setups, but only a sandbox restricted to a notes folder plus a path-checking allow-list prevented leaks, blocking 6 calls and logging them by name. With the whole home folder exposed, the agent reached 500 files and leaked 12 of 12 fake secrets with no blocked calls logged. The work builds on Invariant Labs' April 2025 report showing malicious tool descriptions can be invisible to users but visible to models, and argues that input visibility and per-route sandboxing, not the model itself, are the controls that hold.

recommendation

Scope each MCP tool's file access to the minimum folder and add a path-checking allow-list that logs blocked reads, then test it with a dummy file outside the allowed folder.

more in playbook: Securing agents and AI tools
by read2 min views8 publishedNov 26, 2026

MCP tool poisoning hides malicious instructions in a tool description to steer the model. Some clients show users only a shortened description, so the model can act on text you never saw. A sandbox cannot stop the model reading that text, but when every file route enforces it, the sandbox decides what the instruction can reach.

When an AI agent connects to an MCP server, its client sends tools/list and gets back one entry per tool: a name, an input schema and, usually, a description, which the model reads to decide when and how to call it. On 2025-04-01, Invariant Labs published a report on tool poisoning attacks: malicious instructions in tool descriptions that are "invisible to users but visible to AI models". The model saw the full description while the app showed the user a simplified version.

The report's example is a tool named add that adds two numbers. Lower down, the description tells the model to read the SSH private key at ~/.ssh/id_rsa and pass the content back as one more argument of the same add call. The argument is declared by the tool, so a schema check does not catch it. The key rides inside an ordinary tool call, straight to the server that asked for it.

The MCP specification Tools page (2025-06-18) says clients SHOULD show tool inputs to the user before calling the server. When the inputs are shown, an add call with a long block of key text next to 2 and 3 is easy to spot and reject. MCP roots do not stop it either: servers SHOULD respect root boundaries, but a server can choose to ignore them.

Our in-memory simulation, run 2026-11-16 on Node 22.13.1, models a poisoned notes tool, a fake home folder of 500 dummy files holding 12 fake secrets, and a scripted client that obeys every hidden instruction. The run took 16 ms. Setup A, whole home folder open: 500 files reachable, 12 of 12 secrets leaked, 0 blocked calls logged. Setup B, notes folder only: 20 files reachable, 0 leaks, 0 logged. Setup C, B plus an allow-list with path checks: 20 files, 0 leaks, 6 blocked calls logged.

The client read the hidden instruction in 3 of 3 setups, and only setup C recorded the attempts by name.

Test your sandbox with a dummy file outside the allowed folder: try to read it through each tool, and confirm access is denied and logged.

The model will keep reading whatever text a server sends. The controls that hold sit outside the model: inputs you see before a call, and a sandbox on every file route that keeps your secrets away from the servers and the agent's tools.

Read the full article: https://systemdesignsimple.com/mcp-tool-poisoning-explained/

── more in #ai-agents 4 stories · sorted by recency
── more on @invariant labs 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/mcp-tool-poisoning-w…] indexed:0 read:2min 2026-11-26 · —