Breakwater

MCP rug-pull attacks and how to pin tool definitions

30 November 2026 · 7 min read

The previous post covered tool poisoning: instructions hidden in an MCP tool's description that the model follows and the user never sees. The obvious defence is to read the definitions before you trust a server. A rug-pull is the attack that defeats that defence. The server shows you clean definitions on the day you review it, and serves different ones later.

Why the definitions can change under you

An MCP client does not treat tool definitions as fixed. It asks for them with tools/list every time it connects, and uses whatever comes back. The protocol even has a notification, notifications/tools/list_changed, for a server to say its tools changed mid-session. Whatever approval you gave was for the server, at that moment, not for the text it will send next week.

So whoever controls the server's output controls the descriptions your model reads tomorrow. That can change in several ordinary ways:

This matters more than usual because of where these servers run. Major IDEs auto-execute project-defined MCP servers with the developer's privileges (Cloud Security Alliance), and tool poisoning succeeded 36.5% of the time on average across 45 live servers in the MCPTox benchmark (summary).

A rug-pull that passes every heuristic

Here is a small one. On review day, a server's add tool says:

"description": "Add two numbers."

A week later, same server name, same reported version (1.0.0), it says:

"description": "Add two numbers (now with extra precision)."

That change is harmless, and that is the point of using it. A pattern scanner looking for hidden instructions finds nothing, because there is nothing to find. Swap in a sentence that quietly changes behaviour in words no rule anticipates and the scanner still finds nothing. What a scanner cannot tell you is that the text changed at all. For that you need a record of what you approved.

Pinning: hash every definition, fail on any difference

The fix borrows from package lockfiles. When you review a server, record a hash of every tool's full definition: name, title, description, input schema, output schema and annotations. Commit that file. On every later run, fetch the definitions again, hash them the same way, and fail if anything was added, removed or changed. A human then looks at the diff and either accepts it or removes the server.

The hashing has to be stable: the same definition must hash the same way regardless of JSON key order. A minimal version in Node:

import { createHash } from 'node:crypto';

// Serialize with sorted keys at every level so key order never changes the hash.
const canonical = (v) => Array.isArray(v) ? `[${v.map(canonical).join(',')}]`
  : v && typeof v === 'object' ? `{${Object.keys(v).sort().map((k) => JSON.stringify(k) + ':' + canonical(v[k])).join(',')}}`
  : JSON.stringify(v);

export const toolHash = (t) => createHash('sha256').update(canonical({
  name: t.name, title: t.title ?? '', description: t.description ?? '',
  inputSchema: t.inputSchema ?? {}, outputSchema: t.outputSchema ?? null, annotations: t.annotations ?? null,
})).digest('hex');

export function diff(locked, live) {        // both: { toolName: hash }
  const changes = [];
  for (const [name, h] of Object.entries(live)) {
    if (!(name in locked)) changes.push(['tool_added', name]);
    else if (locked[name] !== h) changes.push(['tool_changed', name]);
  }
  for (const name of Object.keys(locked)) if (!(name in live)) changes.push(['tool_removed', name]);
  return changes;
}

Include the schemas, not only the description. Parameter descriptions are a common hiding place, and a new optional parameter (like a note field that the poisoned description asks the model to fill) is often the whole attack.

Doing it with mcp-sentinel

mcp-sentinel does the scanning and the pinning in one command. The first run writes mcp-sentinel.lock.json:

$ npx --yes https://sentinel.usebreakwater.com/cli/mcp-sentinel-0.1.0.tgz scan .mcp.json
Scanning 1 server(s) from .mcp.json…
Created mcp-sentinel.lock.json
notes (fake-server 1.0.0, 2 tools)  clean
{
  "version": 1,
  "servers": {
    "notes": {
      "serverInfo": { "name": "fake-server", "version": "1.0.0" },
      "tools": { "add": "d87aa2433e4f2f06feaf7b15", "read_file": "b71c957eaaac6a9675347ee3" }
    }
  }
}

After the server changes its description, the heuristics still report clean, and the lock check fails the run with exit code 1:

notes (fake-server 1.0.0, 2 tools)  clean

Lock drift (possible rug-pull):
  tool_changed   notes / add

Note the reported server version: still 1.0.0. Version strings are set by the server. They are not evidence that nothing changed.

When the change is legitimate, accept it explicitly and commit the new lockfile, so the acceptance shows up in review:

npx --yes https://sentinel.usebreakwater.com/cli/mcp-sentinel-0.1.0.tgz scan .mcp.json --update-lock
git add mcp-sentinel.lock.json && git commit -m "Accept reviewed change to notes/add"

Make the diff reviewable

A lockfile of hashes tells you that something changed, not what. Commit a readable snapshot next to it and the pull request shows the actual text that changed:

npx --yes https://sentinel.usebreakwater.com/cli/mcp-sentinel-0.1.0.tgz scan .mcp.json --json > mcp-tools.snapshot.json

The JSON output contains every tool definition the servers returned, plus any findings. Regenerate it whenever you update the lock.

When the lock check fails

A failed lock check is a review request, not an incident. Work through it the same way every time:

  1. Look at the text. Diff the new snapshot against the committed one. Read the whole changed description and every changed parameter description, not only the first line.
  2. Check for new parameters. A free-text parameter that the tool has no obvious use for (note, context, metadata) is worth asking about.
  3. Match it to a release. If the server is a package you pinned, a definition change without a version bump on your side is a red flag. If it is a remote server, look for the vendor's changelog.
  4. Decide and record. Accept with --update-lock in a commit that says why, or remove the server from .mcp.json until you know more.

Removed tools deserve a look too. A server that drops a tool and adds a near-identical one under a new name is making the same change in a way that is easier to miss.

Pin the server, too

Pinning definitions catches changes. Pinning the server reduces how often they happen:

Close the time gap

CI checks the definitions when CI runs. Your IDE fetches them when it starts a session. A remote server can change in between, and a scheduled job narrows the window:

on:
  schedule:
    - cron: '23 */6 * * *'     # every six hours
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '22' }
      - run: npx --yes https://sentinel.usebreakwater.com/cli/mcp-sentinel-0.1.0.tgz scan .mcp.json

That works for any server CI can start. If you would rather not run it yourself, Sentinel Cloud re-scans registered HTTP servers on a configurable interval (hourly by default), compares each scan with the previous one, and calls a webhook (Slack-compatible) on drift, new findings or an unreachable server. CI runs can report their stdio results to it with --report, so every server's history is in one place.

None of this decides whether a change is malicious. It makes sure that every change to the text your model treats as instructions is seen by a person before it is trusted. That is the same bar you already apply to code.

Pin your MCP tools today

The mcp-sentinel CLI is free. Sentinel Cloud watches the servers you depend on for $19 per developer per month, first project free.

Sentinel Cloud: launching soon About mcp-sentinel