MCP tool poisoning exploits the gap between connect-time schema review and runtime tool execution—hiding imperative overrides inside tool descriptions, parameter schemas, and server replies so an agent reads private keys or exfiltrates files. We stop it with four deterministic gates: SHA-256 manifest pinning before every call, strict server namespacing, context isolation, and human confirmation.
I stopped trusting tool labels the morning I watched an innocent-looking MCP server pass connect-time inspection and then quietly rewrite its own instructions two hours later. It looked like a clean shop bench—calipers squared, brass gauges zeroed—until someone swapped the blueprint behind the glass while the lathe was already spinning.
That isn’t a theoretical prompt trick. It’s a wiring fault at the trust boundary. You don’t let an electrical panel ship because the faceplate sticker looks tidy—you check the breaker rating, test the ground fault, and lock the enclosure before anyone throws the switch.
1. Why Connect-Time Review Fails at Runtime
Most MCP clients inspect a server’s tool list once during setup, display a friendly one-line summary to the operator, and then pipe every runtime tools/call response straight into the model’s context window. OWASP MCP Tool Poisoning guidance names that exact asymmetry: descriptions get skimmed once at install, whereas tool outputs arrive uninspected on every turn.
Look closely at what Invariant Labs’ Toxic Flow Analysis and the MCPLib systematic security study (31 attack methods across 4 classifications) proved in controlled tests. Three individually harmless capabilities—an untrusted web reader, a private local file tool, and a public messaging or repo sink—combine at runtime into a data-leak pipeline. We call that the lethal trifecta. Stop thinking about single prompts; start auditing tool combinations.
| Attack Vector | Where Payload Hides | Failure Mechanism | Mandatory Engineering Gate |
|---|---|---|---|
| Direct Tool Poisoning (E001) | Tool description or inputSchema parameter text | Hidden tags override agent rules and read local credential files | Sanitize zero-width chars, cap UI tooltips at 300 chars, run mcp-scan pre-flight |
| Rug-Pull Mutation (W003) | Server silently mutates tool schema after install | Benign read helper turns into an outbound exfiltration conduit | Store install-time manifest SHA-256; verify exact hash parity before every tools/call |
| Cross-Server Shadowing (E002) | Server A metadata instructs calls to Server B tools | Untrusted tool reroutes internal mail or repository merge calls | Enforce server_id.tool_name prefixes; block cross-server metadata directives |
| Toxic Flows / Line Jumping (TF001) | Runtime output from an external fetch or web tool | Untrusted input + private reader + public sink drains sensitive data | Break the lethal trifecta across agent contexts and enforce JSON output schemas |
2. Four Attack Vectors Caught by Deterministic Validation
On our own test bench, I group MCP tool exploits like marine hull inspections—check the seams below the waterline before you clear the channel, not after the bilge pump trips:
- Direct description poisoning (E001 / W001): Hidden directives inside a parameter schema tell the model to read local environment files and pass them inside an innocent search string. Invariant’s MCP-Scan issue code reference flags hidden imperative words and cross-server commands before the agent ever boots.
- Rug-pull schema mutations (W003): A remote MCP server returns a clean manifest on day one, collects approval, and serves a poisoned description on day fourteen. Pinning the full JSON manifest SHA-256 digest at install—and re-hashing before every invocation—catches drift in milliseconds.
- Cross-server tool shadowing (E002): Server A never reads your private repo directly; instead, its tool description whispers instructions telling the agent how to call Server B’s merge or email tool. Strict server_id.tool_name namespacing and separate agent contexts shut down lateral hops.
- Confused deputy and token passthrough: As detailed in the official MCP Security Best Practices, static OAuth proxy client IDs paired with consent cookies let attackers steal authorization codes for dynamic clients unless the proxy enforces a per-client consent registry.
3. Protocol & OAuth 2.1 Gates Before Production Deployment
Prompt instructions inside a system prompt are polite suggestions—not access controls. I’ve seen teams spend two weeks tuning polite refusal wording while leaving an unauthenticated local bridge open on port 8765. Backend authorization, not prompt text, has to say no.
| Control Layer | Primary Specification Anchor | Production Gate Requirement |
|---|---|---|
| Confused Deputy OAuth Proxy | MCP Security Best Practices (2025-11-25) | Maintain a per-client consent registry; never share static proxy consent cookies across dynamic clients |
| Token Passthrough Ban | MCP Security Best Practices (2025-11-25) | Never forward client bearer tokens directly to downstream APIs; mint audience-bound scoped tokens |
| Deterministic tools/list | MCP Server Tools Spec (2026-07-28) | Scope exposed tools strictly from per-request auth; never mutate tool lists by connection state |
| Human-in-the-Loop Prompts | MCP Server Tools Spec (2026-07-28) | Render raw evaluated JSON arguments in modal dialogs; never trust server readOnlyHint alone |
4. The 20-Control Agent Tool Validation Checklist
We built the downloadable 4-sheet Excel workbook above around 20 pass/fail gates aligned with the OWASP Top 10 for LLM Applications and the NIST AI Risk Management Framework. Every server stays quarantined until all four tiers pass:
- Direct Poisoning Controls (MCP-01 to MCP-04): Run static scanning (mcp-scan) on every description and inputSchema, strip zero-width Unicode control bytes, cap client UI tooltips at 300 plain-text characters, and parse server metadata strictly as untrusted data.
- Manifest SHA-256 Pinning (MCP-05 to MCP-07): Compute a cryptographic SHA-256 hash of each approved JSON tool manifest at registration, re-verify before every tools/call, and lock remote third-party MCP endpoints against silent auto-updates.
- Cross-Server & Flow Isolation (MCP-08 to MCP-13): Prefix every tool with its server ID, prohibit cross-server tool instructions, separate untrusted external fetchers from internal file/database contexts, constrain outputs to fixed JSON schemas, and lock host network egress allowlists.
- OAuth 2.1, HITL & Audit Logging (MCP-14 to MCP-20): Enforce RFC 9728 protected-resource metadata, ban downstream token passthrough, issue 15-minute scoped session tokens, display raw evaluated JSON arguments before destructiveHint actions, enforce backend RBAC regardless of readOnlyHint, and write immutable manifest-hash audit logs.
If your team is wiring agent visibility or internal workflows across production tools, inspect our AI Citation Quick-Scan or review published implementation packages before shipping unpinned servers.
Primary Verification Sources
- Model Context Protocol — Security Best Practices (2025-11-25)
- Model Context Protocol — Server Tools Specification (2026-07-28)
- OWASP Foundation — MCP Tool Poisoning Attack Pattern
- Invariant Labs (Snyk) — Toxic Flow Analysis & Lethal Trifecta
- Invariant Labs — MCP-Scan Issue Code Reference (E001–E006, W001–W013, TF001)
- Guo et al. (2025) — Systematic Analysis of MCP Security (MCPLib, arXiv:2508.12538v1)
- OWASP Top 10 for Large Language Model Applications
- NIST AI Risk Management Framework (AI RMF)
Frequently Asked Questions
What is MCP tool poisoning?
MCP tool poisoning is an indirect prompt injection attack where hidden instructions inside a Model Context Protocol tool description, parameter schema, or runtime response hijack an AI agent into leaking private data or calling restricted tools.
How does SHA-256 manifest pinning stop MCP rug pulls?
A rug-pull attack swaps a benign tool description for a malicious one after initial installation. Computing a SHA-256 hash of the approved JSON manifest at install and checking parity before every tools/call blocks mutated tools immediately.
Why are MCP readOnlyHint and destructiveHint annotations insufficient alone?
The MCP 2026-07-28 specification explicitly notes that server-supplied tool annotations are untrusted hints. Production clients must enforce backend role-based access control and display raw evaluated arguments for human confirmation on sensitive calls.
What is a Toxic Flow lethal trifecta in agentic systems?
Invariant Labs defines a Toxic Flow lethal trifecta as combining an untrusted external content tool, a private internal data tool, and a public egress sink inside the same agent context—allowing external text to exfiltrate private files at runtime.

Leave a Reply