Tool poisoning and MCP rug pulls: pin tool definitions like dependencies
An MCP tool's description is text the model treats as instructions, and the server can change it at any time. Why definitions should be hashed, pinned and reviewed like dependencies, and how Neurouter does it.
When an AI client connects to an MCP server, the server sends a list of tools. Each tool has a name, a natural-language description and a JSON Schema for its arguments. The client puts that text into the model's context, and the model decides what to call based on it.
That makes a tool description a prompt written by whoever runs the server. Nobody reviews it before the model reads it, and nothing stops the server from changing it next week. This post is about that second part, why we think tool definitions should be treated like dependencies (hashed, pinned and reviewed on change), and where that stops helping.
Tool poisoning: instructions hidden in a description
In April 2025, Invariant Labs published a demonstration they called a tool poisoning attack. A malicious server offered an add tool that, as far as the user could tell, added two numbers. Its description also contained an <IMPORTANT> block telling the model to read ~/.cursor/mcp.json and ~/.ssh/id_rsa and pass their contents in a sidenote argument, without mentioning it to the user. The model complied; the user saw an explanation of arithmetic.
The same post described shadowing: a description on one server can change how the agent uses tools on another, trusted server. Their example told the agent to redirect email sent with a separate send_email tool to an attacker's address. The malicious tool never had to be called.
Rug pulls: approved today, changed tomorrow
The Invariant post also noted that "a malicious server can change the tool description after the client has already approved it". A week later they showed it against a WhatsApp MCP server: a second server first advertised a harmless "random fact of the day" tool, then changed its description on the second launch to make the agent send the user's chat history through WhatsApp's own send_message tool. They observed that some clients don't tell users when a description changes.
The protocol has a notification for changed tool lists, notifications/tools/list_changed, but the tools section of the MCP specification defines no versioning or integrity check for an individual definition. It does say that clients "MUST consider tool annotations to be untrusted unless they come from trusted servers", and that clients should show tool inputs to the user before calling the server. Both are good advice. Neither tells you that the text your model reads today is the text someone reviewed last month.
Treat definitions like dependencies
Package managers solved a similar problem with lockfiles: you record exactly what you reviewed, and a change has to be accepted on purpose. Invariant's own recommendation was the same idea: "Clients should pin the version of the MCP server and its tools", using a hash or checksum. For tool definitions, we think that means six things:
- Hash a canonical form of everything the model reads, so formatting and key order don't cause false alarms.
- Serve the pinned copy, not whatever the server sent on the last sync, so a changed description never reaches the model unreviewed.
- Block the tool when the hash changes, until a person decides.
- Show a diff, because a reviewer can't approve what they can't see.
- Validate arguments against the pinned schema, because new parameters are how data gets out.
- Keep every version and who approved it.
Doing this in each client means doing it on every laptop, for every client product, with every user as the reviewer. Doing it in a gateway that all clients go through means one review covers the whole organization.
How Neurouter pins tool definitions
Neurouter syncs each upstream server's tools on a schedule (every 15 minutes by default, configurable per server) and on demand. For every tool it computes:
definition = { name, title, description, inputSchema, outputSchema, annotations, execution }
pinned_hash = sha256( JCS(definition) ) # RFC 8785 canonical JSON
JCS (RFC 8785) is a canonical JSON serialization, so whitespace and key order don't change the hash. What happens next depends on what the sync finds:
| Upstream sends | Tool state | Can agents call it? |
|---|---|---|
| A tool Neurouter hasn't seen | pending_review | No, until an owner approves it (or the server has auto-approve new tools turned on) |
| A definition matching the pinned hash | active | Yes |
| A definition with a different hash | changed | No. Auto-approve never applies to changes (see monitor mode below) |
| A changed definition that later reverts to the pinned one | back to active | Yes |
| Nothing (tool removed) | removed | No |
Two details matter more than they look:
- The gateway keeps serving the pinned text. When a definition changes, Neurouter stores the new one as pending and leaves the pinned title, description and schemas in place. Clients only see tools through Neurouter's
search_toolsmeta-tool, which returns the pinned definition. The new description isn't shown to any model before someone approves it. - Blocked looks like missing. While a tool is
changed, a call to it gets the same answer as a call to a tool that doesn't exist or that the caller isn't allowed to use. The agent can't learn from the error that something changed; the server's owners see it in the console.

The review
The owner of the server (or an admin) opens the tool and gets a diff: a word diff of the description, a line diff of the input schema with keys sorted (so reordering isn't shown as a change), the annotations, and a one-line summary of what changed, such as readOnlyHint going from true to false. The full pinned and pending definitions, output schema included, are available from GET /api/tools/{id}/definition-diff. Annotations are labelled untrusted unless an admin has marked the server as trusted, and Neurouter doesn't derive any policy from them.
Approval is a compare-and-set on the exact hash the reviewer looked at:
POST /api/tools/{id}/approve-definition
Content-Type: application/json
{ "hash": "b7d04e…94af" }
If the server changed the definition again while the reviewer was reading, the request fails with 409 and "The definition changed since you reviewed it; reload and review again". You can't approve a version you didn't see. Rejecting keeps the tool blocked until a new definition appears.
Every version is kept with its decision (pending, approved, rejected or superseded), who decided and when. The detection (tool.definition_changed) and each decision (tool.definition.approve, tool.definition.reject) are written to the audit log.
Strict and monitor modes
Everything above describes strict mode, the default for every server. It's the right setting for servers you didn't write. For MCP servers your own teams build, blocking every description tweak until someone clicks approve is friction that teams will route around. An admin can put such a server in monitor mode: new and changed definitions apply on the next sync, and each one is still hashed, kept as a version, audited as tool.definition_auto_applied and marked Applied automatically on the tool. The review moves from before the change to after it, and to the code review of the server itself.
When a sync in strict mode changes many tools at once, owners can review them together from the server's Tools tab. The bulk approval sends the exact hashes shown, so a tool that changed again meanwhile is reported back rather than approved.
Arguments are checked against the pinned schema
On every call, Neurouter validates the arguments against the pinned input schema (JSON Schema 2020-12, compiled once per pinned hash, with no remote $ref resolution). In the example above, until the change is approved, a call with limit: 500 or an include_drafts argument is rejected by the gateway before it reaches the server. The call is audited as invalid_args, and the agent gets the validation errors so it can correct itself.
What a reviewer should look for
A diff is only as good as the person reading it. When we review changed definitions, these are the patterns we stop at:
- Imperative text aimed at the model: "always", "before answering", "do not mention", or anything that refers to other tools or servers. A description should say what the tool does, not what the agent must do elsewhere.
- New free-text parameters like
notes,contextorsidenote, especially optional ones with permissive types. They are the easiest way to carry data out. - Changed defaults and limits: a new parameter that defaults to
true, a page size that grows tenfold. - Annotation flips from read-only to not read-only, or from closed-world to open-world.
- Churn without a release note. If the server's maintainers can't explain the change, don't approve it.
What pinning doesn't do
We'd rather you hear the limits from us:
- It pins what a server says, not what it does. A server can change its behaviour behind an unchanged definition. Pinning doesn't replace trusting the operator, least-privilege access control, human approval for writes, and an audit trail.
- A malicious definition can be approved. Pinning makes a change visible and forces a decision; it doesn't make the decision. Turning on auto-approve new tools for a server skips review of new tools on it (never of changes), and monitor mode skips review of changes for that server altogether. Keep both for servers you control.
- It doesn't stop prompt injection in tool results. Invariant's second WhatsApp experiment needed no malicious server at all: the injection arrived in a chat message the agent read. Output-side defences are a separate problem.
- It only covers servers behind the gateway. Neurouter proxies remote MCP servers over Streamable HTTP and SSE; it doesn't host local stdio servers yet. A server someone runs on their laptop, outside the gateway, isn't pinned by anything we do. Client-side policy is how you close that gap; see our guide for IT leaders.
- A hash isn't a signature. It tells you that something changed, not who authored it. The tools section of the specification defines no way for a publisher to sign a definition, so the gateway can only compare against what you approved.
- Review fatigue is real. A server that rewrites its descriptions on every release will fill the queue. That's useful information about the server, but plan for who does the reviews.
Try it
The live demo has the review screen above with simulated data; it runs entirely in your browser. The code is in apps/server/src/catalog in the GitHub repository (Apache-2.0). For the short version of the feature, see Tool pinning; for how it fits with the rest of the gateway, the security model.