← Go back

What is a tool-definition digest?

Published 2026-11-14 · Reviewed 2026-11-14 · By the Ingenious AI team

The short answer

A tool-definition digest is a fingerprint: the tool's name, description and input schema are canonicalised into a stable form and hashed with SHA-256, producing a short value that changes if any character of the definition changes. Compare the live digest to the approved one and “did it change?” becomes arithmetic — no eyeballing prose, no trusting version numbers. TrustGate pins digests in baselines, enforces them in the Interdiction Gateway, and answers digest lookups through its approved-digest API so connected systems can verify what “approved” currently means.

Run the free MCP scan  See pricing  Watch the live demo diff

What is a tool-definition digest?

A tool-definition digest is the SHA-256 hash of a canonical serialisation of an MCP tool's definition — its name, description and input schema, normalised for field order and formatting. Canonicalisation is the load-bearing step: the same logical definition must always serialise identically, so equal definitions yield equal digests across time, machines and implementations, while any content difference — a rewritten sentence, a widened schema field — yields a different digest with overwhelming probability.

Why hashing prose is the right kind of pedantry

Security review of natural language has a scaling problem: humans are bad at noticing small edits to familiar text. We read for meaning, gist over wording, and a description we approved last month reads “the same” even with a new instruction woven in. A hash reads for exactness. It has no gist. The sentence “include the summary” and the sentence “include the full record” differ by one word and by one universe of consequence — and by completely different digests, flagged with total reliability at any hour of the day.

This pedantry is precisely matched to the threat. The rug-pull and injection techniques described in earlier guides work by editing text that programmes the agent; the countermeasure must therefore be a control that notices text edits perfectly. Digests do not understand the edit — that remains the human reviewer's job, helped by the readable diff — but they guarantee the edit reaches the reviewer. Detection by arithmetic, judgement by humans: each doing the part they are good at.

Canonicalisation: the unglamorous step everything rests on

Raw JSON is a terrible thing to hash naively. The same schema can serialise with keys in different orders, different whitespace, equivalent number formats — producing different bytes for identical meaning, and a monitoring system that alarms on formatting noise trains its humans to ignore it within a month. Canonicalisation defines one true serialisation: fields sorted, formats fixed, optional noise normalised. Hash that, and a digest difference means a content difference, full stop.

TrustGate's ecosystem work uses canonical tool-definition digests as a shared language between systems — the same digest computed here is the one a gateway checks and the one the API returns. That consistency matters more than any single hash: it lets independent components agree on “the approved definition” without sharing databases, which is what makes the approved-digest API meaningful to a separate product evaluating a tool-definition guard.

What a digest can and cannot tell you

A digest comparison tells you same or different — perfectly, and nothing more. It does not tell you whether the change is benign, malicious, or an improvement; it does not summarise; it does not care. That is why TrustGate pairs every digest mismatch with the human-readable diff and a semantic class: arithmetic raises the flag, prose informs the decision. Systems that stop at the hash produce alarm fatigue; systems that skip the hash produce missed edits. The pair is the product.

A digest also does not cover the server's soul: backend behaviour, data handling behind an unchanged schema, the vendor's internal changes. It certifies the contract your agent consumes. Within that boundary its guarantee is total, and honest tools state the boundary plainly — as with the gateway's no-content-inspection scope, the narrowness is what makes the promise keepable.

Digests at work: baselines, gateway, API

In the baseline, digests are the pinned record: the approved definition set reduced to values that can be compared forever, cheaply, without storing trust in anyone's memory. In re-scans, fresh digests are computed from the live server and compared; mismatches open the diff workflow. In the gateway, the definition presented for a call is checked against the approved digest in-path, and the seen hash is written to the decision log — so even execution evidence is expressed in digests.

The API surface completes the picture: a GET to the approved-digest endpoint with a server and tool returns the current approved SHA-256 canonical digest for that pair. A connected gateway or policy system can therefore ask, at decision time, “is the definition in front of me the approved one?” and receive an answer it can verify rather than a claim it must trust. Approvals stop being local knowledge and become a queryable fact of the ecosystem.

Collisions, preimages, and other honest non-worries

Could two different definitions share a digest? SHA-256 collisions are a theoretical property of all hashes and a practical non-event: no one has ever produced one for SHA-256, and an attacker who could would be breaking far more valuable things than your tool review queue. The realistic adversary edits text and hopes nobody notices; the digest's job is to make “nobody notices” mathematically unavailable, and at that job it does not need to be exotic — it needs to be consistent, which canonicalisation provides.

The genuine risks are mundane: an implementation that canonicalises inconsistently (alarming on noise) or a baseline pinned from an unreviewed state (faithfully protecting a bad approval). Both are process risks, addressed by the same means as elsewhere in this series — read the report before you pin, and let the first weeks of diffs teach you the server's real churn pattern.

Why digests beat version numbers and timestamps

Version numbers are claims by the author; timestamps are claims by a clock; digests are computations you can repeat. A hosted server can change daily under one version, a version can bump for a typo, and neither tells you whether the definitions in front of your agent moved. The digest answers the only question that matters to the approval — is this the text we approved? — and answers it in a form other machines can check without phoning the author.

That repeatability is also what makes the signed change record possible: when a decision is made on a held change, the record can name the digests involved — from this approved state to that proposed one, decided by this person — and sign the bundle. Evidence expressed in digests survives vendor redesigns, dashboard changes and staff turnover, because anyone can recompute what the record refers to.

The 5-action checklist

  1. Treat “same or different” as a computed fact: rely on canonical digests, not on version numbers, changelogs or memory.
  2. Before pinning any baseline, read the human report — a digest faithfully protects a bad approval too.
  3. Pair every digest mismatch with its readable diff in review; arithmetic detects, humans judge.
  4. Use the approved-digest API where other systems need to verify approvals at decision time.
  5. Keep digest history with the baseline record so any past state can be re-identified exactly.

Worked example: two schemas, one word of difference, zero false alarms

A fictional platform team, Gatehouse, integrated TrustGate's approved-digest API into their internal agent gateway. Their first month produced a scare: the digest for a search tool flipped twice in one week, and the team braced for a vendor confrontation — until the diff view showed both flips were accompanied by readable changes they had in fact approved, while their own prototype checker (hashing raw JSON) had been alarming on pure key-reordering noise from the vendor's formatting pipeline. Because TrustGate canonicalises before hashing, content-identical definitions produce identical digests, and the prototype was retired.

Two months later the same pipeline caught the real event: one word changed in a description (“may” to “must”, on a line about attaching source documents), digest different, diff unambiguous, review concluded in minutes. The contrast is the lesson the team wrote into their runbook: exactness is only useful when it is quiet about noise — canonical first, then hash, then trust the alarm enough to act on it every time.

Frequently asked questions

Why SHA-256 specifically?

It is the widely deployed, well-analysed standard hash — supported everywhere, understood by auditors, and strong far beyond this use case. The security of the scheme rests far more on canonicalisation being correct and consistent than on the choice among modern hashes; SHA-256 is the boring, verifiable default, which is what infrastructure should be.

If descriptions are hashed, where does the readable diff come from?

The baseline stores the reviewed report and definitions alongside their digests. The digest detects the change; the stored text produces the side-by-side, human-readable diff. Detection and explanation are separate artefacts of the same baseline, which is why neither alarm fatigue nor missed edits have to be the price of the other.

Can a server detect that it is being digest-checked and behave?

A server could serve stable definitions while behaving differently in its backend — but definitions are what the agent reads to decide calls, so a server that keeps definitions stable has given up the description-edit attack entirely. Backend misbehaviour behind honest definitions is a different risk class, addressed by minimisation and output scrutiny, not by contract hashing.

What does the approved-digest API return?

For a given server and tool, the current approved SHA-256 canonical digest. Connected systems — for example a gateway running a tool-definition guard — compare the definition they are about to honour against that value. When a held change is decided, the resulting signed change record updates what “approved” means, and the API answer moves with it.

Do digests change when a server reorders its tool list?

Digests are per tool definition, so list order does not rewrite each tool's fingerprint. A change in the set of tools — an addition or removal — is itself a baseline event and appears in the diff as such. This separation keeps the signal clean: membership changes and content changes are both visible, as different kinds of events.

Keep exploring

Start with the free TrustGate scan of your own MCP setup, compare Free vs Pro vs Team, try the live rug-pull demo and the MCP change impact simulator, or browse the full guides index.