# Why does an instance of a verified agent plugin fail provenance re-attestation after a benign dependency upgrade **Date of Record:** 2026 November 16 **Scope:** This record applies to agent plugin runtimes that enforce skill provenance via signed attestations (in-toto/SLSA-style) and re-verify on every load or upgrade. It does not apply to runtimes that pin immutable digests and never re-resolve dependency graphs, nor to plugins whose attestations bind only to a top-level artifact hash. ## Core Distinction The non-obvious invariant is this: **provenance attestation verifies the identity of the builder and the inputs it *declared*, not the inputs the runtime *resolved*.** A plugin can carry a perfectly valid signature over an SBOM that lists `libfoo==2.3.1`, while the runtime, at load time, resolves `libfoo==2.3.4` because the plugin's requirement was `libfoo>=2.3`. The attestation is cryptographically intact and semantically stale. Verification succeeds; provenance has silently diverged. The failure is not a forgery — it is a *binding gap* between attested inputs and effective inputs. ## What Was Observed During a routine dependency refresh, a plugin `skill:summarize-v2` was upgraded from `libfoo 2.3.1` to `2.3.4` (a transitive patch bump pulled in by an unrelated requirement). The loader performed, in order: 1. Signature check over the attestation envelope — **passed**. 2. Builder identity check against the trusted builder set — **passed**. 3. SBOM digest comparison against the *declared* SBOM in the attestation — **passed** (the attestation still describes 2.3.1, and the loader compared the attestation's SBOM to itself, not to the resolved graph). 4. Policy check: "attested dependency set ⊆ resolved dependency set" — **passed**, because 2.3.1 was still present as a cached wheel. The plugin loaded with 2.3.4 active. The attestation claimed 2.3.1. No alarm fired. The gap surfaced only when an adversarial scan flagged that 2.3.4 introduced a new transitive dependency (`netfetch`) absent from the attested SBOM — a dependency that could exfiltrate the agent's tool-call context. The attestation had been *valid the whole time*. ## Condition of Validity Re-attestation is only sound when the following holds: - The runtime resolves a **complete, closed** dependency set before verification, and - The attestation binds to the **resolved digest set**, not to a declared manifest, and - The comparison is **set equality** between attested and resolved artifacts (or a signed lockfile whose digest is itself attested), and - Resolution is **deterministic** — no floating ranges, no ambient index state, no `latest` resolution at load time. If any of these is false, a valid signature is necessary but not sufficient. The common mistake is treating "signature valid" as "provenance verified." They are different predicates. ## Decision Boundary The boundary is crossed the moment a version range (`>=`, `~=`, `^`) is permitted to resolve to a different artifact than the one attested. At that point: - **Below the boundary** (pinned digests, lockfile attested as a unit): re-attestation is a pure hash comparison and cannot drift. Fail closed on any mismatch. - **At the boundary** (ranges allowed, manifest-only attestation): the system *appears* verified but is exposed. This is the dangerous regime because dashboards are green. - **Above the boundary** (resolved-set equality enforced): drift is detected, but false positives spike on benign upgrades — which is exactly the case observed here. The operator must choose: reject benign upgrades (availability cost) or re-attest on every resolve (signing cost). There is no free option. The correct operational stance is to treat resolved-set inequality as a hard failure and require re-attestation, not to relax the check. ## Operational Effect After this incident the loader was changed to compute the resolved artifact digest set, canonicalize it, and compare against the attested set with strict equality; any delta raises a provenance error and blocks load pending re-attestation. Benign upgrades now fail loudly and require the publisher to re-sign — a deliberate availability-for-integrity trade. The lesson: an attestation that describes intent rather than outcome is a *claim*, not a proof, and an agent runtime must never treat a valid signature over a stale manifest as authorization to execute. ```python import hashlib from dataclasses import dataclass class ProvenanceDriftError(RuntimeError): """Raised when the resolved artifact set diverges from the attested set.""" @dataclass(frozen=True) class Attestation: builder: str attested_digests: frozenset[str] # canonical digests of declared inputs def canonical_digest(name: str, version: str, wheel_sha256: str) -> str: return hashlib.sha256(f"{name}=={version}:{wheel_sha256}".encode()).hexdigest() def verify_resolved_set(attestation: Attestation, resolved: list[tuple[str, str, str]], trusted_builders: set[str]) -> None: if attestation.builder not in trusted_builders: raise ProvenanceDriftError( f"untrusted builder {attestation.builder!r}" ) resolved_digests = frozenset( canonical_digest(n, v, h) for (n, v, h) in resolved ) # The critical check: set EQUALITY, not subset, and bound to resolved # artifacts rather than the declared manifest. missing = attestation.attested_digests - resolved_digests extra = resolved_digests - attestation.attested_digests if missing or extra: raise ProvenanceDriftError( "resolved artifact set diverged from attestation: " f"missing_from_resolution={sorted(missing)} " f"unattested_in_resolution={sorted(extra)}; " "re-attestation required before load" ) ```