Agent Supply Chains and Protocol Security › Dependency integrity: hashes, signatures, and attestations
Language AI HandbookAll chapters Once you choose a candidate, decide what bytes the approval is meant to cover. Use an expected digest from the approved release record for the equality comparison. Keep the representation consistent with that reference.
Hashing: the integrity baseline
For a locally installed connector, keep the expected artifact digest in an approved release record. Hash the bytes that the loader uses and compare the result with that record. Keep the bytes behind the same verified reference through activation. A digest comparison answers whether the bytes match the approved reference under the chosen hash assumption. The source of the expected digest determines whose approval the comparison represents.
Hash definitions must be interpreted at the same representation. A digest of a compressed package and a digest of an extracted tree are computed from different inputs. A release policy needs to pair its reference digest with the representation it verifies. If a project approves an archive, its verification receipt describes that archive. A separate check can cover the bytes loaded by the process when unpacking or deployment changes the representation. The encoding below is a deterministic JSON array of three fictional fields. It illustrates a digest over a manifest record in memory.
The cells record two different questions about the digests. First, compare exact digest values to see whether the fixture records differ. Then count the positions that changed when a small field changes. If two 64-digit digest strings were independent uniform hexadecimal strings, any one position would agree with probability 1/16. In that illustrative reference model the expected number of differences is therefore 64 × 15/16 = 60. The five adjacent fixture comparisons and the distance-from-base values are observations about these inputs.
PythonIn [3]Expand
import hashlib
import json
def content_digest(name: str, version: str, payload: str) -> str:
"""Deterministic digest over a canonical record (invented fields only)."""
canonical = json.dumps(
[name, version, payload], separators=(",", ":")
).encode("utf-8")
return hashlib.sha256(canonical).hexdigest()
# Two versions of an invented registry entry for a fictional tool.
entry_v1 = content_digest("inventory.peek", "1.2.0", "returns item count")
entry_v2 = content_digest("inventory.peek", "1.3.0", "returns item count")PythonIn [4]Expand
# Payload variants: one character added each step, everything else identical.
base_record_text = "returns item count"
record_text_variants = [base_record_text]
for i in range(1, 6):
record_text_variants.append(base_record_text + "!" * i)
# Deterministic digests, using the fixture manifest helper.
variant_digests = [
content_digest("inventory.peek", "1.2.0", p) for p in record_text_variants
]
# Per-step Hamming distance over hex digits (0-15) and total differing chars.
def hex_char_diffs(a: str, b: str) -> int:
return sum(1 for ca, cb in zip(a, b) if ca != cb)
step_diffs = [
hex_char_diffs(variant_digests[i], variant_digests[i + 1])
for i in range(len(variant_digests) - 1)
]
# Difference from the base digest for each variant (nibble-level distance).
base_distances = [
hex_char_diffs(variant_digests[0], d) for d in variant_digests
]
variant_labels = [f"v{i}" for i in range(len(record_text_variants))]
expected = 64 * (15 / 16)VisualizationOut [5]Expand

PythonIn [6]Expand
print("v1.2.0 digest:", entry_v1)
print("v1.3.0 digest:", entry_v2)
print("digests differ:", entry_v1 != entry_v2)ConsoleOut [6]Expand
v1.2.0 digest: e94acba681cf0e968b4b3fd65e40e5a022996c2fd4d0ab95173e5f2875dd2fb8 v1.3.0 digest: abe2411cce1488db014ba23e7888ffd9065a9251dbdf34759273b0ad2b89aa14 digests differ: True
In this run the neighboring digests differ at many positions. The reference line uses the expectation for independent uniform digits. It does not estimate collision resistance from just a handful of records. The decision gate uses equality over the complete digest, not a threshold on visual similarity. If a computed digest differs from a verified reference, the bytes hashed for that comparison differ. A match supports identity with the approved bytes under the security assumptions of the hash function and the integrity of the reference.
Artifact identity is also distinct from a manifest's declared version. The same record fields produce the same digest under the chosen encoding. In the fictional example, changing the version field alone changes the record digest even when the description stays fixed. A production release might instead store the artifact digest and record version as independent fields. That distinction allows an investigator to see when two metadata revisions still point to the same package, or when a stable metadata revision unexpectedly points elsewhere.
Signing: from integrity to authenticity
A signature binds the bytes covered by verification to a key identity under the verifier's assumptions. Compare that key with the approved role in your own trust configuration. A valid signature under an arbitrary key supplies no deployment approval. A signed manifest can carry the digest of a larger artifact. In this case the verifier checks both the signature on the manifest and the binding between its declared digest and the bytes to be used.
An independent verifier supplies the upstream checks in this example. The records below use an enum to represent its results. One metadata record matches the exact verifier-approved label, while the other has a different label. The fixture tests the application's consumption of an upstream result.
PythonIn [7]Expand
from enum import Enum
class IdentityCheck(Enum):
VERIFIED = "Verified identity"
UNVERIFIED = "Identity check absent"
fixture_identity = IdentityCheck.VERIFIED
fixture_label = "release-record-12"
other_label = "release-record-13"
def matches_verified_record(candidate_label, approved_label, verification):
return (
verification is IdentityCheck.VERIFIED
and candidate_label == approved_label
)
print(
"Approved record:",
matches_verified_record(fixture_label, fixture_label, fixture_identity),
)
print(
"Different record:",
matches_verified_record(other_label, fixture_label, fixture_identity),
)ConsoleOut [7]Expand
Approved record: True Different record: False
The mock reproduces the input binding a host needs from a real verifier. The approved label and status are bound to one upstream decision. Copying the decision to a new label does not carry the approval over. A runtime should also connect verification to an approved trust root and check its current validity under the release policy. The labels above perform no cryptographic operations. They let us test whether a later stage treats an upstream result as belonging to the relevant release.
Attestations and provenance
Build provenance describes how an artifact was produced. In the SLSA v1.2 build model the attestation identifies output artifacts as its subjects. SLSA's verification guidance calls for checking the envelope signature against configured roots of trust and comparing the statement's subject with the digest of the artifact under consideration. It also calls for checking the builder against configured expectations. Policy still needs to decide which builder and release it trusts for this particular service. SLSA Build Provenance · SLSA Build Verification
Review the direct connector and the dependencies that ship with it. A pinned outer artifact can identify a specific bundle, while a dependency inventory explains what it contains. For a remotely operated connector, a local client digest identifies the client. To reason about changes on the remote side, review the authenticated service identity, available deployment evidence, and the operations the host will permit at run time. Give those operations their own permissions so the host can stop relying on a service when its behavior changes.
The host should keep a list of protocol revisions it supports and check the revision in use against that list. In MCP revision 2026-07-28, requests carry protocol version and client capabilities in metadata. Protocol compatibility tells the peers how to interpret messages. An application separately determines the operations it will expose to the model and the data each operation can access. MCP revision 2026-07-28 changelog
MCP tool annotations can describe a tool's behavior. The Tools specification requires clients to treat annotations from untrusted servers as untrusted. Keep the approved scope in the host's policy and resolve it when a call is proposed. For the catalog assistant, admitting the lookup service should leave the catalog's write capability subject to separate approval. MCP Tools, revision 2026-07-28
The MCP HTTP authorization specification requires a protected server to validate that it is the intended audience for the access token. Audience validation concerns where the token can be used. The application must also enforce its operation-specific permissions at the point of execution. MCP Authorization, revision 2026-07-28
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!