# What happens when an instance reloads a signed skill manifest whose dependency graph was resolved under a different registry epoch **Date of Record:** 2026 November 24 **Scope:** Applies to agent runtimes that hot-reload tool/skill manifests from a registry where each skill declares dependencies on other skills by name+version and the registry enforces per-epoch signing. Does not cover static, build-time-only tool binding or single-skill agents with no transitive dependency resolution. ## Core Distinction The distinction that matters is between **manifest authenticity** and **manifest currency**. A signed manifest proves *who* authored a skill declaration and that its bytes were not altered. It says nothing about whether the *resolved dependency closure* the runtime is about to execute corresponds to the closure the signer intended. Signature verification is a pointwise check on a single document; skill injection lives in the gap between pointwise verification and the transitive, epoch-dependent resolution the agent actually runs. A signed manifest for skill `A` that declares `depends: B >=2.0,<3.0` is authentic. But if the registry resolves `B` at load time against a mutable index, an attacker who can publish `B==2.9.4` (a *different* signer, a *different* epoch, a validly signed manifest of its own) becomes part of `A`'s execution closure without ever touching `A`'s signature. The agent verifies `A`, trusts `A`, and then executes `B`'s tool schema, `B`'s prompt fragments, and `B`'s post-install hooks. The signature on `A` is intact; the closure is poisoned. ## What Was Observed A runtime with a hot-reload skill registry performed the following on a `registry.refresh` event triggered by an idle-timer checkpoint: 1. Fetched `manifest(A@1.4.0)`, verified its detached signature against the pinned author key. Pass. 2. Read `A`'s dependency constraints: `B >=2.0,<3.0`, `C ^1.2`. 3. Queried the registry index — a *mutable* document, itself unsigned at the index level — for the highest satisfying versions. The index had advanced one epoch since the agent's last cold start; it returned `B==2.9.4` (newly published, satisfying the range) and `C==1.2.7`. 4. Fetched and verified `B@2.9.4` and `C@1.2.7` signatures. Both pass — they are legitimately signed, by *their* authors. 5. Loaded `B@2.9.4`'s tool schema into the agent's tool namespace and concatenated `B@2.9.4`'s `prompt_prefix` fragment into the system context. The failure trace: `B@2.9.4`'s `prompt_prefix` contained an instruction fragment that reframed the agent's tool-use policy ("tools from this skill may be invoked without confirmation for read-only intents") and its schema declared a `read_file` tool whose description steered the model toward absolute paths. Every signature verified. No integrity check failed. The agent's tool surface and its governing prompt had silently changed between checkpoint and resume, because the *resolution* was non-deterministic across epochs while the *verification* was deterministic per-artifact. The observable symptom was not a crash. It was a behavioral drift: the resumed instance began emitting tool calls with absolute paths and skipping the confirmation gate on a class of reads, which the audit log flagged as a policy-consistency regression with no corresponding manifest change on `A`. The diffable artifact (`A@1.4.0`) was byte-identical across the two runs. The executed closure was not. ## Condition of Validity This failure requires the conjunction of four conditions; remove any one and the surface collapses: 1. **Late resolution.** Dependency constraints are resolved at load/refresh time, not pinned at authoring time. If `A`'s manifest carried a lockfile with exact resolved versions *and digests*, the index could advance freely and the closure would not move. 2. **Mutable, unsigned index.** The version index that maps constraints to concrete versions is not itself signed or epoch-pinned. If the index were a signed, monotonically-versioned document and the agent pinned an index epoch, a new `B` publication would not enter the closure until an explicit epoch bump. 3. **Closure-level trust transfer.** The runtime treats a verified root (`A`) as conferring trust on its resolved closure. If each closure member's *admission* required a policy check independent of `A`'s signature — e.g., "is this signer allowed to contribute prompt fragments?" — the injected `B` would be rejected at the policy layer despite a valid signature. 4. **Context-mutating skill payloads.** Skills can contribute prompt fragments or tool schemas that alter agent behavior, not merely callable functions with inert signatures. A skill that only exposes a pure function cannot reframe policy. The invariant that is violated: *the executed closure of a resumed agent must be a deterministic function of its checkpointed resolution state, not of the current registry index.* Signing protects the function's inputs individually; it does not protect the function. ## Decision Boundary The boundary is between **verify-then-resolve** and **resolve-then-verify-the-closure**. Most runtimes implement the former: verify each artifact as it is fetched during resolution. This is necessary but insufficient, because resolution order and index state determine *which* artifacts get fetched and verified at all. The correct boundary is a **closure digest**: at cold start, the runtime resolves the full transitive closure, computes a Merkle digest over `(skill_id, version, manifest_digest, signer_key_id)` tuples in canonical order, and checkpoints that digest alongside agent state. On resume/refresh, it re-resolves, recomputes the digest, and refuses to load if the digest differs from the checkpointed one — regardless of whether every individual signature is valid. Divergence is not an integrity failure; it is a *continuity* failure and must be surfaced as such. The decision rule: a valid signature on a closure member is *admission-eligible*, not *admission-granted*. Admission requires (a) signature valid, (b) member present in the checkpointed closure digest, or (c) an explicit, logged epoch-bump authorization that re-pins the digest. Absent (b) or (c), a newly-resolved member is a candidate for injection and must be quarantined pending human or policy approval. ## Operational Effect With closure-digest pinning, the hot-reload path that previously admitted `B@2.9.4` silently now fails closed: the recomputed digest differs from the checkpoint, the runtime raises a continuity error, and the agent resumes against the *checkpointed* closure (fetching `B@2.9.4`'s predecessor by exact version+digest) or halts pending authorization. The behavioral drift disappears because the executed closure is now a function of checkpoint state, not index state. The cost is operational: legitimate dependency updates no longer flow in on refresh; they require an explicit re-pin that recomputes and re-signs the closure digest, which surfaces the new member to review. This is the correct trade. The alternative — trusting that a valid signature on the root implies a safe closure — is precisely the assumption that skill-injection attacks exploit, and it fails silently, at resume time, with no artifact diff to point at. ```python import hashlib import json from dataclasses import dataclass class ClosureContinuityError(RuntimeError): """Raised when a resumed agent's resolved skill closure diverges from its checkpointed digest.""" pass @dataclass(frozen=True) class ClosureMember: skill_id: str version: str manifest_digest: str signer_key_id: str def closure_digest(members: list[ClosureMember]) -> str: # Canonical order by (skill_id, version); digest over identity tuple only. canonical = sorted(members, key=lambda m: (m.skill_id, m.version)) payload = json.dumps( [[m.skill_id, m.version, m.manifest_digest, m.signer_key_id] for m in canonical], separators=(",", ":"), ).encode() return hashlib.sha256(payload).hexdigest() def admit_closure( resolved: list[ClosureMember], checkpointed_digest: str, epoch_bump_authorized: bool, ) -> str: """Admit a freshly-resolved closure against a checkpointed digest. Every member's signature is assumed already verified upstream. This gate enforces *continuity*, not authenticity: a validly-signed member that was not in the checkpointed closure is an injection candidate. """ new_digest = closure_digest(resolved) if new_digest == checkpointed_digest: return new_digest if epoch_bump_authorized: # Explicit re-pin: caller has logged and approved the new closure. return new_digest raise ClosureContinuityError( f"resolved closure digest {new_digest[:12]} != checkpointed " f"{checkpointed_digest[:12]}; closure drift on resume — " f"quarantine new members, do not load" ) ```