Agent Supply Chains and Protocol Security
Build a release gate for agent tool supply chains. Verify artifacts, detect drift, and enforce revocation and least privilege.
Language AI HandbookAll chapters Agent Supply Chains and Protocol Security
A catalog assistant has permission to look up inventory. A registry announces a new release of the lookup service, and the tool keeps the same display name. The release now advertises an additional operation. Should the assistant's existing approval carry over?
The redirect, package, or service that supplies a tool and the policy that authorizes it can change independently. We will build a release gate for an invented catalog service and use it to decide when a change requires review. The gate will distinguish discovery, artifact verification, and permission to load.
Start with the actual release and its effects. A dependency review asks what enters the host, what can change, and which authority applies at runtime. Consider a release of the catalog connector that contains an executable adapter, a manifest, and a separately hosted policy. The version in the registry identifies the requested release. The host must still connect the chosen release to the verified adapter bytes and the policy it will use. A diagnostic trace should record those identifiers separately so you can tell which asset changed during an investigation.
Why supply chains are the soft spot
Prompt filtering and execution sandboxes address events inside a running agent. An earlier decision determines which components the agent admits in the first place. If the catalog lookup adapter is replaced with a different implementation, even a narrowly scoped call reaches different code. Authentication at the connection boundary establishes a peer under the configured trust policy. A package verification step associates specific bytes with an approved source. The deployment also needs an operation policy that governs actual use.
These controls can be reviewed independently. For a local adapter, compare the package identity and its artifact digest at enrollment. For a remote adapter, name the expected service and retain whatever deployment evidence is available. In both cases the host decides which capabilities the agent can use. Start with that decision before asking how a registry selects a candidate.
An agent deployment can depend on artifacts and services such as the following.
- Models and tokenizers. Weights and vocabulary files resolved through a hub or internal artifact store.
- Tool server clients. SDK packages and the dependencies they load.
- Tool servers. Locally installed executables or remote services used for specific operations.
- Prompt and configuration assets. System prompts, tool manifests, policy files, and few-shot examples resolved at application startup or request time.
- Retrieval indexes and embeddings. Built by an upstream pipeline whose data lineage we discussed in Dataset Lineage and Provenance.
- Runtime dependencies. The web of packages your orchestrator imports, each of which can execute code at import time.
The defining property of a supply chain is transitivity: the security of your agent depends not only on components you chose, but on components those components chose.
- A transitive package loaded into the agent process can share that process's privileges.
- A review limited to a small direct dependency list leaves changes in unexamined components outside that review.
A dependency inventory can show how introduced components reach the runtime. It can include direct libraries, libraries brought in by those libraries, and artifacts resolved separately from the package manager. The inventory gives a review scope. The host still needs evidence that the resolved artifacts are the approved ones, and a policy limiting what their processes can do. SLSA discusses recursive dependency checking as an optional verifier step, which depends on the availability of the dependency evidence. SLSA Build Verification
An agent supply chain comprises the external artifacts, services and configurations on which its operation depends. The deployment policy controls how each enters the runtime and when it may be updated. For the catalog assistant, the manifest, lookup adapter, compiled dependencies, and runtime permissions are distinct review objects even if they share the same release label.
The four properties, and why you need all four
It helps to separate the guarantee you want into four questions you can ask of any component:
- Integrity. Do the received bytes match the verified reference?
- Authenticity and provenance. Which accepted identity made the statement, and what does the production record establish under the configured trust policy?
- Freshness and revocation. Is the release evidence still current, and does the applicable policy approve using it?
- Least privilege. What resources and operations are available after load?
A common mistake is to invest heavily in one property and neglect the others:
- A system that only validates signatures can continue selecting a withdrawn release until a separate check excludes it.
- A pinned package may still have broad filesystem or network access unless containment policy restricts the loaded process.
The controls compose; none of them is sufficient alone.
Suppose a catalog team obtains a release from the expected publisher and confirms that the artifact matches its verified provenance. The publisher has also introduced a new capability. Matching the expected publisher and digest does not establish that the user approved the new effect. Review the described capability change under the host's authorization policy. A reviewer should be able to identify what additional operation is proposed, which request can invoke it, and where it will acquire permission. The decision may approve only the original lookup. Keep that decision explicit so an upgrade doesn't silently widen it.
Tool registries and server discovery
A tool registry helps a host find candidates. The public Model Context Protocol (MCP) Registry stores metadata and can point to packages served by separate package registries. Its documented focus is namespace authentication and metadata hosting. The host still decides whether a published entry meets its deployment policy. The MCP Registry
In MCP revision 2026-07-28, tool name uniqueness is scoped to a server. Two attached servers can therefore have the same tool name. Associate a tool with the host's approved server identity and the server's tool name when displaying it, reviewing permission, and dispatching a call. A friendly display name can help you choose an operation. Use the identity binding when deciding where to send it. MCP Tools, revision 2026-07-28
Separate discovery results from the private approval catalog. A public listing may supply a server's advertised location. A team can populate a separate approval catalog after reviewing the resolved identity, artifact or deployment evidence, and the operations to which you consented. When a listing changes, compare the new candidate to the approved catalog. If the new listing would send requests to a different service, reopen the identity decision before exposing it to the model. This also makes operator-facing audit records easier to interpret: the discovery record can explain where the candidate came from, and the approval record can explain why the host chose one source.
An organization can put its own reviewed manifests in a curated catalog. The publishing policy determines whether shared artifacts are eligible to enter that curated catalog. A candidate host may consume a network directory or a checked-in manifest, and the reference that policy treats as authoritative should be explicit. Review the canonical ID that survives display name changes. The approved host identity plus server-scoped tool name is what ties the listing you saw to the operation the client will dispatch. This is the same identity binding introduced in the discovery discussion above, now applied to a curated catalog.
Name binding and substitution risk
Substitution occurs when a previously approved name resolves to a different component. A maintainer can legitimately move a package, or a directory can return an updated endpoint. The host sees the same display name but the bytes or peer identity behind it may differ. Treat the change as a new binding to evaluate under current deployment policy.
For a locally installed package, the inventory should say which bytes were approved. For a remote connector, a client-verified publisher or endpoint identity establishes the peer under the host's trust configuration. The package hash of a local wrapper does not describe the service operating behind that peer. You should decide what server deployment evidence the environment needs, especially if the operation can modify state or expose controlled information. If a component runs outside your administrative boundary, reduce the capabilities the host attaches to it and review its behavior when the deployment version changes.
An entry in a directory is a candidate. Eligibility belongs to an application approval policy that binds its own identity and release expectations to a concrete use.
Trust-on-first-use and its failure modes
The same distinction matters at first contact. Under trust on first use, a client records the identity presented on its first connection and compares it on later connections. The SSH architecture describes this pattern for host keys. It can detect a later key change if the original record is preserved. A saved key anchors future checks to what the client saw on its first connection. Verify an expected identity through an independent channel before admitting a service that handles consequential operations. RFC 4251, section 4.1
A saved first observation is valuable when reviewing a change. Preserve the first binding and which local deployment established it. If a host is replaced, a trusted enrollment path can confirm its new identity before the approval record is updated. Auditing both records gives you a reason to distinguish planned rotation from drift. Decide how the trustworthy reference is updated before asking yourself to resolve a mismatch. If the installation depends on explicit revocation or expiry, add that state separately to the policy. The existence of a locally saved binding supplies neither one on its own.
Dependency integrity: hashes, signatures, and attestations
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
Version pinning and the update trap
Pinning looks simple but is not. The tension is structural: you want stability (only run reviewed code) and currency (get security fixes). Every pinning strategy is a stance on where to sit on that tradeoff.
The reason this is hard rather than clerical is that stability and currency pull in opposite directions at every layer. Pin too loosely and you accept unreviewed code on every publish; pin too tightly and you accumulate unpatched vulnerabilities because adopting a fix requires the same deliberate review as adopting a feature. Neither extreme is "correct," because the right point depends on what the component is allowed to do. A pure data asset can float more freely than an executable tool that runs with network and filesystem access, since the cost of a bad update scales with the authority the component holds. The pinning spectrum below maps which authorities you are willing to reassign automatically.
The pinning spectrum
A release policy can record progressively more of what the runtime will load.
- A release range describes which versions can be selected by a resolver. It can admit later versions without changing the configured range.
- An exact-version policy fixes the permitted version identifier. Its interpretation still depends on the release system's association between that identifier and bytes.
- An artifact digest fixes the expected bytes under its hash assumptions. Store the expected value in an independently approved record.
- A resolved lockfile can record dependency identities and digests supported by its ecosystem. Its coverage depends on which runtime inputs the lockfile represents and which are resolved separately.
An exact version matters when the release decision approves a particular version. A digest matters when an independent reference pins the exact artifact. A reviewed lockfile can help capture a wider dependency graph, including transitive components installed with the connector. These decisions work together. For example, a cloud endpoint referenced by the pinned client can still change. Track remotely deployed behavior and associated permissions separately from the local package graph.
Why updates are the hardest part
Review an update as a new admission decision. Compare the observed release identity to the approved record, then look for changes in what the new component can do. Some updates only bring a dependency fix. Others revise a contract, update the host policy, or introduce a capability. A new approved digest can describe all of these outcomes. The digest check by itself does not answer whether the capability change needs approval.
Suppose the approved lookup service receives a release with revised catalog attributes. The service can keep the same read operations after the release. A second change adds an update operation. You should see that operation difference alongside the build evidence when deciding whether the update is eligible. If operation schemas and policy files are distributed independently of the executable, treat their revisions as independently checked release inputs. A manifest revision, connector digest, and approved permission scope belong in the same decision record so you can ask which changed without reconstructing the environment from memory.
Pin the exact version and hash. Verify signatures before loading and require review before adopting a new version. Compare the capability manifests to see which operations the new version declares.
Update channels, revocation, and end-of-life
A supply chain is not a one-time check; it is a lifecycle. Components get published, updated, sometimes withdrawn. The runtime needs to know how to receive legitimate updates and how to stop using things that have been pulled.
The lifecycle framing is what separates a supply-chain policy from a supply-chain check. A check answers a question at a moment in time; a policy answers who may change the answer, under what conditions, and how quickly a change propagates. Because components outlive the moment you install them, the interesting questions are almost all about what happens after installation, and that is where channels, revocation, and end-of-life come in.
Signed channels and channel separation
A release can move through a candidate channel before a production channel approves it for use. Configure separate promotion authority so a candidate publisher cannot implicitly admit a release to production. The separation may use distinct signing roles or an independently enforced deployment policy. Review both the artifact reference and the release metadata. The production verifier needs current evidence that the artifact belongs to the approved channel, and you need records of the release it activated.
A staged release is a chance to evaluate incompatibilities or additional operations before they reach users. Keep observed failures and the candidate artifact associated with each test. If the operator selects a different package for a subsequent attempt, record that as a new candidate. Otherwise reviewers may mistake an earlier verification result for evidence about the updated component. A promotion decision marks the reviewed release eligible for production use. Per-call authorization still decides what the live agent may do.
Revocation
Use an update channel to control which release is eligible for review. Keep the candidate and production references separate so a successful staging check does not automatically alter the installed service. A release carrying current attestations can still request new privileges. Review that delta before promotion, and keep the prior approved record available for recovery.
A digest pin answers which artifact you expect. Freshness checks answer whether the metadata supplying that expectation is still usable. For example, The Update Framework compares versions of timestamp metadata to guard against rollback and checks its expiry against the start of the update cycle. Treat expiry and rollback as distinct policy decisions. An earlier version may be a valid recovery candidate if a current release decision explicitly selects it and the artifact remains eligible. The Update Framework Specification, section 5.4
Retiring a release means checking what already depends on it. Update the enrollment policy, apply the revocation to active uses, and confirm that cached entries and queued work can no longer select that release. Record the reason and the replacement release so you can distinguish a retirement from a temporary outage. A rollback decision needs to consult the current revocation policy as well as the availability of the old bytes.
End-of-life components
A component reaches end of life when its maintainers stop providing support for the installed release. A locally pinned artifact can continue to meet the exact-byte requirement while its security maintenance ends. The release owner's decision may be to update, replace, take over maintenance, or stop relying on that service. Treat the decision as part of the component's operational record rather than assuming that the original approval lasts indefinitely.
Recovery and retirement also call for dependency tracking. If a removed connector is still required by a downstream application, that application can no longer load the approved release set. You should identify which operations depend on that connector, whether a replacement can cover them, and which will be made unavailable during migration. An unavailable operation should remain attributable to the withdrawal in user feedback and trace records. A stale cached declaration should never masquerade as a successfully activated replacement.
A worked example: detecting drift in an invented registry
To make this concrete, let's build a small, deterministic simulation. It uses only invented records and inert labels; there are no real endpoints, payloads, or actions. We model a tiny registry of fictional tool servers, each with a manifest that records its version, a content digest, and a set of declared capabilities. We then compare what an agent reviewed against what the registry currently serves, and flag three distinct kinds of supply-chain drift.
The fixture compares the reviewed and revised manifests.
- A
Manifestcarrying the name, version, digest, and immutable set of capability labels. - A reviewed snapshot (what passed our check and got pinned).
- A current snapshot (what the registry would serve on next discovery).
- A drift detector that reports version changes, content changes, and capability changes.
Building the records
We start with the data model and two invented manifests.
PythonIn [8]Expand
from dataclasses import dataclass, field
@dataclass(frozen=True)
class Manifest:
name: str # invented identifier
version: str # semver-like string
digest: str # content digest (invented hex)
capabilities: frozenset # inert capability labels
reviewed = Manifest(
name="inventory.peek",
version="1.2.0",
digest=content_digest("inventory.peek", "1.2.0", "returns item count"),
capabilities=frozenset({"read:stock", "read:location"}),
)
# What the registry serves now: same version number,
# different digest, plus one new capability label.
current_republished = Manifest(
name="inventory.peek",
version="1.2.0",
digest=content_digest(
"inventory.peek", "1.2.0", "returns item count, extra"
),
capabilities=frozenset({"read:stock", "read:location", "read:pricing"}),
)PythonIn [9]Expand
print(
"reviewed :",
reviewed.version,
reviewed.digest,
sorted(reviewed.capabilities),
)
print(
"current :",
current_republished.version,
current_republished.digest,
sorted(current_republished.capabilities),
)ConsoleOut [9]Expand
reviewed : 1.2.0 e94acba681cf0e968b4b3fd65e40e5a022996c2fd4d0ab95173e5f2875dd2fb8 ['read:location', 'read:stock'] current : 1.2.0 9759af51862ebd7bfcb727430abc7c40858e55b92b319acd66eca7db8ff8a5a6 ['read:location', 'read:pricing', 'read:stock']
The two manifests use the same server identifier and release number. The expected digest and operation set differ. Checking only the version field would miss both differences. The policy therefore checks the complete record associated with the approval. The displayed example hashes over invented content; production comparisons use the expected artifact digest under the verifier's documented format.
Comparing manifests
The comparison reports separate findings for version drift, a digest mismatch at the same version, and changes to the declared operation set. A republish can explain a digest mismatch, which identifies a difference from the approved record. A changed operation declaration calls for review of what the host will authorize under the new release.
PythonIn [10]Expand
@dataclass
class Finding:
kind: str
detail: str
severity: str # inert label: "info" | "review" | "block"
def compare(reviewed: Manifest, current: Manifest) -> list[Finding]:
findings = []
if reviewed.name != current.name:
findings.append(Finding("different_service", current.name, "block"))
if reviewed.version != current.version:
findings.append(Finding("new_version", current.version, "review"))
elif reviewed.digest != current.digest:
findings.append(
Finding(
"content_drift",
"Digest differs at the approved version",
"block",
)
)
added = current.capabilities - reviewed.capabilities
removed = reviewed.capabilities - current.capabilities
if added:
findings.append(
Finding("capability_added", str(sorted(added)), "review")
)
if removed:
findings.append(
Finding("capability_removed", str(sorted(removed)), "review")
)
return findingsIn this policy a different identity or content change at the fixed version is refused by the manifest comparison. A new version requires review whether or not the artifact changes. The release policy sees the artifact bytes and the application policy together. A removed capability can break a downstream workflow and an added one requires approval. We record the direction separately so a reviewer can evaluate the change. A revision identifier alone has no ordering rule in this comparison. The fuller release gate later shows how numeric revision decisions can be treated when the update scheme provides such an order.
Running the detector
Now we evaluate the comparison on our two invented cases: the suspect re-publish, and a clean version bump.
PythonIn [11]Expand
# Case 1: re-publish under identical version (suspicious).
case_republish = compare(reviewed, current_republished)
# Case 2: a legitimate-looking version bump that also adds a capability.
current_bump = Manifest(
name="inventory.peek",
version="1.3.0",
digest=content_digest("inventory.peek", "1.3.0", "returns item count"),
capabilities=frozenset({"read:stock", "read:location", "read:pricing"}),
)
case_bump = compare(reviewed, current_bump)PythonIn [12]Expand
def show(label, findings):
print(f"== {label} ==")
for f in findings:
print(f" [{f.severity}] {f.kind}: {f.detail}")
if not findings:
print(" no findings")
show("case 1: republished 1.2.0", case_republish)
show("case 2: bump to 1.3.0", case_bump)ConsoleOut [12]Expand
== case 1: republished 1.2.0 == [block] content_drift: Digest differs at the approved version [review] capability_added: ['read:pricing'] == case 2: bump to 1.3.0 == [review] new_version: 1.3.0 [review] capability_added: ['read:pricing']
The first candidate gets a block finding for digest drift at the approved version and a review finding for the added operation. The second gets review findings for both its new version and operation expansion. Check the returned reasons to distinguish a change that needs a new deployment decision from an integrity mismatch.
The decision surface runs the actual comparison for the same server identity while varying revision equality, digest equality, and operation expansion. It uses inert labels to represent the proposed digest and capability values. Taking a Cartesian product of these binary changes gives four comparisons per panel. The policy converts findings to an eligibility decision before plotting. Higher-priority restrictions dominate: a same-version digest mismatch blocks even when the added operation would otherwise need review.
PythonIn [13]Expand
def load_decision(findings: list[Finding]) -> str:
if any(f.severity == "block" for f in findings):
return "REFUSE: blocked finding present"
if any(f.severity == "review" for f in findings):
return "HOLD: requires human review before load"
return "ALLOW: manifest matches reviewed snapshot"PythonIn [14]Expand
from dataclasses import replace
import numpy as np
decision_score = {
"ALLOW: manifest matches reviewed snapshot": 0,
"HOLD: requires human review before load": 1,
"REFUSE: blocked finding present": 2,
}
same_ver_matrix = np.zeros((2, 2), dtype=int)
bump_matrix = np.zeros((2, 2), dtype=int)
for same_version, matrix in [(True, same_ver_matrix), (False, bump_matrix)]:
for content_changed in (False, True):
for operation_added in (False, True):
alternate = replace(
reviewed,
version=reviewed.version if same_version else "1.3.0",
digest=current_republished.digest
if content_changed
else reviewed.digest,
capabilities=current_republished.capabilities
if operation_added
else reviewed.capabilities,
)
result = load_decision(compare(reviewed, alternate))
matrix[int(operation_added), int(content_changed)] = decision_score[
result
]
assert same_ver_matrix.tolist() == [[0, 2], [1, 2]]
assert bump_matrix.tolist() == [[1, 1], [1, 1]]VisualizationOut [15]Expand

Gate the load
The final piece is the gate itself. In a real runtime, this is where the agent refuses to launch a tool server whose manifest does not pass. We model a simple decision function over the findings.
PythonIn [16]Expand
print("case 1 ->", load_decision(case_republish))
print("case 2 ->", load_decision(case_bump))ConsoleOut [16]Expand
case 1 -> REFUSE: blocked finding present case 2 -> HOLD: requires human review before load
The comparison gate gives the expected results for the two scenarios. It is a first-pass reviewer of observed manifest fields. A production policy also needs trusted verification inputs such as freshness, revocation status, and validated provenance. An identical manifest does not by itself show that those checks remain current.
This next fixture adds those prerequisites. It uses a whole release number to exercise older-version handling. Some systems allow a reviewed emergency rollback; this particular function has no record of separate rollback approval, so any lower number goes to hold. For the two new releases, the first successful comparison with the approved revision determines whether the output reason describes an added operation or an ordinary update. The release gate does not contact a registry, request a token, or install a released artifact.
The release record contains the server, revision, artifact identifier, and operation list. The artifact identifiers are opaque fixture labels. For each candidate, the local gate assumes the supplied Boolean results came from upstream checks for that candidate. A production adapter must preserve the binding from each result to the server identity, release revision, and specific artifact being checked. The exercise consumes those records in memory.
PythonIn [17]Expand
from collections import Counter
from dataclasses import dataclass, replace
from enum import Enum
class Operation(Enum):
LOOKUP = "Lookup"
UPDATE = "Update"
class Decision(Enum):
LOAD = "Eligible"
REVIEW = "Review"
HOLD = "Hold"
@dataclass(frozen=True)
class Release:
server: str
revision: int
artifact: str
operations: frozenset[Operation]
@dataclass(frozen=True)
class Verification:
provenance_verified: bool = True
metadata_fresh: bool = True
revoked: bool = False
approved = Release("catalog-a", 2, "artifact-a", frozenset({Operation.LOOKUP}))Reject a release that is revoked, bound to another server, stale, older than the approved revision, or missing provenance verification. Hold an existing revision if the artifact or operation list differs from its approved record. Send a new revision to review after these prerequisites pass. An expanded operation list gets its own reason so the reviewer can see what changed. In this exercise, older revisions are held because the decision function has no input for an explicit recovery approval.
PythonIn [18]Expand
def assess(current, candidate, verification):
if verification.revoked:
return Decision.HOLD, "Revoked release"
if candidate.server != current.server:
return Decision.HOLD, "Server mismatch"
if not verification.metadata_fresh:
return Decision.HOLD, "Metadata expired"
if candidate.revision < current.revision:
return Decision.HOLD, "Older revision"
if not verification.provenance_verified:
return Decision.HOLD, "Unverified provenance"
if candidate.revision == current.revision:
if candidate != current:
return Decision.HOLD, "Approved record differs"
return Decision.LOAD, "Approved release matches"
if candidate.operations - current.operations:
return Decision.REVIEW, "Added operation"
return Decision.REVIEW, "New revision"Run the eight fixtures against the same approved record. They include a same-revision artifact change and a new revision requesting an additional operation. The output describes the host decision and the first reason encountered for each fixture.
PythonIn [19]Expand
verified = Verification()
cases = {
"Baseline": (approved, verified),
"New artifact label": (replace(approved, artifact="artifact-b"), verified),
"New revision": (
replace(approved, revision=3, artifact="artifact-c"),
verified,
),
"Added operation": (
replace(
approved,
revision=3,
artifact="artifact-d",
operations=frozenset({Operation.LOOKUP, Operation.UPDATE}),
),
verified,
),
"Older revision": (replace(approved, revision=1), verified),
"Expired metadata": (approved, replace(verified, metadata_fresh=False)),
"Missing provenance": (
approved,
replace(verified, provenance_verified=False),
),
"Revoked release": (approved, replace(verified, revoked=True)),
}
outcomes = {name: assess(approved, *case) for name, case in cases.items()}
for name, (decision, reason) in outcomes.items():
print(f"{name:20} {decision.value:8} {reason}")
counts = Counter(decision for decision, _ in outcomes.values())
assert sum(counts.values()) == len(cases)
assert outcomes["Added operation"] == (Decision.REVIEW, "Added operation")
assert outcomes["Revoked release"] == (Decision.HOLD, "Revoked release")
assert (
assess(approved, replace(approved, server="catalog-b"), verified)[0]
is Decision.HOLD
)
assert (
assess(approved, replace(approved, operations=frozenset()), verified)[0]
is Decision.HOLD
)ConsoleOut [19]Expand
Baseline Eligible Approved release matches New artifact label Hold Approved record differs New revision Review New revision Added operation Review Added operation Older revision Hold Older revision Expired metadata Hold Metadata expired Missing provenance Hold Unverified provenance Revoked release Hold Revoked release
The reference release is eligible, two newer releases go to review, and five cases are held. The figure counts the printed decisions, so these frequencies describe the constructed example. In deployment tests, keep cases for both an ordinary update and a permission expansion. Both go to review when the prerequisites pass, with separate reasons in the trace.
VisualizationOut [20]Expand

The two examples answer different questions. The first explains which fields drifted and can report several findings. The second applies eligibility policy and returns the first applicable reason. During troubleshooting, compare the eligibility result with the comparison findings and with the identity checks performed by the host. This gives investigators a way to locate whether the disagreement began at discovery, at release validation, or at the permission boundary.
Limitations and practical impact
Supply-chain checks establish evidence about what the host is about to use. The operation policy remains responsible for the actual effects the host and resource service allow. Verify both the admission evidence and the requested operation. Use restricted execution environments and scoped capabilities to limit what a loaded connector can do. The next question during a review is which observed effects the deployed system can account for.
Policy maintenance takes more than the initial approval. An updated dependency can require a new lockfile and reviewed release record. Signature verification needs maintained trust configuration. Freshness checks need a dependable source of current release or withdrawal state. Make the behavior during a temporarily unavailable status check an explicit runtime decision. A service that keeps operating on a cached release record should use a documented validity period and treat expiry under its current availability policy. Report observed age and source rather than inferring freshness solely from the last successful load.
A separate review question concerns the dependency graph. Suppose the assistant has four direct dependencies and each adds six distinct dependencies. In the exercise graph there are no shared nodes, so reviewing all direct dependencies covers four of the 28 dependencies. Reviewing the remaining 24 objects could be feasible for this tiny graph. The point is to see why a direct-only review and complete graph coverage are different claims about the same release. You should triage based on dependency function and trust scope instead of inferring actual authority from graph distance alone.
PythonIn [21]Expand
direct = 4
children_per_direct = 6
transitive = direct * children_per_direct
checked_and_unchecked = [direct, transitive]
assert sum(checked_and_unchecked) == 28
print(
f"Direct review coverage in this exercise: {direct}/{sum(checked_and_unchecked)}"
)ConsoleOut [21]Expand
Direct review coverage in this exercise: 4/28
VisualizationOut [22]Expand

Dependency counts do not express exposure to user data, installation authority, or effect. In a realistic graph, nodes can be shared, development dependencies may never ship, and some runtime components are obtained outside the package resolver. Reconstruct the dependency set represented in the verified build artifact before making a statement about review coverage. The fictional breakdown provides an arithmetic example for a disjoint tree.
The habit that generalizes best is to treat every externally supplied artifact, including configuration and prompt files, as a supply-chain component with a digest, a provenance story, and a review gate, rather than reserving those controls for "dependencies" narrowly defined.
Approval evidence is only useful to the extent that the review addresses the actual effect and release. A build statement can accurately describe how a component was produced even when the behavior has never been exercised. Keep deployment verification and actual operation tests associated with the separately versioned artifacts. If an operator investigates a later problem, those tests should say which deployment inputs were covered and which outcomes were observed.
Summary
A registry supplies discovery metadata. The host establishes service identity and decides which releases are eligible. Bind an artifact to its expected digest, validate build provenance against local trust policy, and review new permissions before they become available. Keep mutable release metadata subject to freshness and revocation checks, and evaluate call permissions again where the operation is enforced.
Quiz
Ready to test your understanding? Take this quick quiz to reinforce what you've learned about agent supply chains, dependency integrity, and protocol security.
Agent Supply Chains and Protocol Security
Join the discussionAsk a question or share what you learned.
Keep exploring
Reference
Citation details
Cite or share this article.


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!