# Where must an instance of runtime agent supply-chain attestation fail closed: the transitive tool-closure gap in SLSA-style prompt/tool/weight provenance **Date of Record:** 2026 November 16 **Scope:** Applies to runtime agents that assemble an execution graph from an attested prompt bundle, an attested tool registry, and attested model weights, where each artifact carries an independent SLSA-style provenance statement. Does not apply to single-artifact deployments (prompt-only inference with no tool invocation) or to build-time-only attestation where no runtime re-resolution of tool bindings occurs. ## Core Distinction Attestation of *artifacts* (the prompt template, the tool package, the weight blob) is not attestation of the *closure* the agent actually executes. SLSA-style provenance answers "who built this named artifact and from what inputs," keyed by a subject digest. An agent runtime, however, does not execute three artifacts; it executes a *binding*: prompt P invokes tool T with arguments derived from model M, and T may itself resolve a secondary tool T′, load a schema, or fetch a remote descriptor at call time. The verified set is the artifact set; the executed set is the transitive closure of the binding graph. The boundary failure lives exactly in the set difference. The non-obvious invariant: **an agent is only as attested as the least-attested node reachable from a tool call at runtime, not the least-attested node present in the registry at admission time.** Registry admission verifies a flat list. Runtime execution walks a graph. These are not the same object, and the gap is where supply-chain compromise enters. ## What Was Observed A three-artifact agent (prompt bundle, tool registry, weight manifest) passed admission: every subject digest in the registry matched a provenance statement with a valid signature chain to the expected builder identity, and the SLSA predicate `buildType` matched the pinned builder. The agent then, at inference time, invoked a tool whose manifest declared a `$ref` to a shared schema hosted on an external descriptor endpoint, and that tool in turn shelled into a helper binary resolved from `PATH` rather than from the registry digest. Neither the remote schema nor the `PATH`-resolved helper appeared in any provenance statement. The registry was fully attested; the executed closure was not. Two failure signatures recurred: 1. **Digest-subject mismatch under late binding.** The provenance statement attested `tool@sha256:A`, but the runtime resolved `tool` by name and executed `sha256:B` (a republished patch under the same tag). Signature verification succeeded because the statement was valid — it simply described a different subject than the one executed. Verification of a valid statement is not verification of the executed artifact. 2. **Closure truncation at the first attested hop.** Verification stopped at the tool package boundary and did not recurse into the tool's declared dependencies, remote schema references, or interpreter-level resolutions (`PATH`, plugin discovery, dynamic `import`). The provenance graph was acyclic and complete *as declared*; the runtime graph was neither. ## Condition of Validity The attestation guarantee holds **only if** all of the following are simultaneously true: - Every node in the runtime execution closure — not merely the registry — is keyed by content digest, and the digest is computed over the *bytes executed*, not the name resolved. - Verification recurses through declared references (`$ref`, dependency manifests, plugin registries) and treats any unresolvable reference as a verification failure, not a pass-through. - The binding (prompt → tool → argument schema → model) is itself attested, or the runtime re-verifies each hop at the moment of resolution rather than at admission. - No resolution path exists that bypasses the digest map (no `PATH` lookup, no tag-based fetch, no unverified dynamic import). If any condition fails, the system is in an *attested-registry / unattested-closure* state, and the admission result must not be reported as "agent attested." ## Decision Boundary The correct decision at the boundary is **fail closed on closure incompleteness**, not fail open on artifact validity. Concretely: - If a tool reference cannot be resolved to an attested digest, raise and refuse the call — do not fall back to name resolution. - If a provenance statement's subject digest does not equal the digest of the bytes about to execute, treat as substitution, not as a stale-but-valid artifact. - If the closure walk exceeds a declared depth or encounters an unattested node, the agent's overall attestation status is *unattested*, and the runtime must downgrade capability (deny the tool) rather than proceed with the attested subset. The tempting inverse — "the artifacts I could verify are attested, so run them" — is precisely the failure. Partial verification of a closure is not partial trust; it is unverified execution with a valid-looking receipt. ## Operational Effect Operationally, this shifts the verification locus from admission to resolution. The registry becomes a cache of candidate digests, and the authoritative check happens per-hop at call time against the digest of the bytes actually loaded. Systems that implement this observe a measurable increase in denied calls (the closure is larger than the registry), which is the correct signal: those denials are unattested nodes that admission never saw. Systems that do not implement it observe zero denials and a fully green attestation dashboard while executing an unattested closure — the dangerous state, because the telemetry is indistinguishable from a healthy deployment until a substituted tool fires. The invariant to encode: **attest the closure, verify at resolution, fail closed on any unattested hop.** ```python class UnattestedClosureError(RuntimeError): """Raised when the runtime execution closure contains a node that cannot be resolved to an attested content digest.""" pass def verify_execution_closure(root_tool, digest_map, attested_subjects, max_depth=16): """ Walk the transitive tool/dependency closure starting at root_tool. Fail closed on: unattested digest, name-only resolution, or depth overflow. """ stack = [(root_tool, 0)] seen = set() while stack: node, depth = stack.pop() if depth > max_depth: raise UnattestedClosureError( f"closure depth exceeded at {node.name!r}; refusing to execute" ) if node.digest is None: # Name-resolved node (PATH lookup, tag fetch, dynamic import) raise UnattestedClosureError( f"node {node.name!r} resolved without a content digest; " f"name-based resolution is not attestable" ) if node.digest not in attested_subjects: raise UnattestedClosureError( f"node {node.name!r} digest {node.digest} has no provenance statement" ) if digest_map.get(node.name) != node.digest: # Valid statement, wrong subject: substitution, not staleness. raise UnattestedClosureError( f"substitution detected for {node.name!r}: " f"executed {node.digest} != attested {digest_map.get(node.name)}" ) if node.digest in seen: continue seen.add(node.digest) for ref in node.references: stack.append((ref, depth + 1)) return True def admit_agent(prompt_bundle, tool_registry, weight_manifest, digest_map, attested_subjects): # Admission verifies the flat registry... for artifact in (prompt_bundle, tool_registry, weight_manifest): if artifact.digest not in attested_subjects: raise UnattestedClosureError( f"artifact {artifact.name!r} has no provenance statement" ) # ...but attestation status is decided by the runtime closure, not the registry. for tool in tool_registry.tools: verify_execution_closure(tool, digest_map, attested_subjects) return "agent-attested" ```