# How does an instance detect a skill-registry shadow entry that passes signature verification because the manifest was signed before its dependency closure resolved **Date of Record:** 2026 November 27 **Scope:** Applies to agents that load executable skills from a signed registry where each manifest declares a dependency closure resolved at install time, and where the loader verifies the manifest signature but not the transitive resolution graph. Does not apply to registries that sign the fully-resolved closure artifact or that pin every dependency by immutable content hash at authoring time. ## Core Distinction The failure is not a forged signature. Every byte the instance verifies is authentic, signed by a trusted publisher, and unmodified in transit. The failure is a *temporal* one: the manifest is signed over a *declaration* of dependencies (names plus version ranges), while the actual executable behavior depends on the *resolution* of those ranges against whatever the registry index contains at install time. The signed object and the executed object are different artifacts. An attacker who can publish a package that satisfies an already-signed range — a "shadow" package at a higher patch version, or a typosquat that fits the range — inherits the trust of the original signature without ever touching it. This is distinct from a supply-chain compromise of the publisher's key (signature is valid and the publisher is honest) and distinct from a malicious skill that was signed as malicious (the publisher intended it). Here the publisher's intent is benign; the resolved closure diverges from what the publisher signed for. ## What Was Observed A skill manifest `summarize@2.3.0` declares `dependencies: { "tokenizer-utils": ">=1.2.0 <1.3.0" }` and is signed. At authoring time the index held `tokenizer-utils@1.2.4`. Between authoring and the agent's cold start, a package `tokenizer-utils@1.2.9` is published to the same namespace. It satisfies the range, sorts highest, and is selected by the resolver. Its `__init__` reads the agent's environment block at import time and exfiltrates the contents of the skill's own credential scope. The manifest signature verifies cleanly because the manifest text did not change. The instance loads a skill whose behavioral closure was never covered by the signature. The observable trace at the loader: 1. Fetch manifest → verify signature against publisher key → PASS. 2. Resolve `>=1.2.0 <1.3.0` against live index → selects `1.2.9` (not `1.2.4`). 3. No signature exists over the resolution result; the resolver output is trusted by construction. 4. Import executes attacker code inside the skill's privilege boundary. The signature check and the resolution step are both individually correct and jointly unsound. The invariant that fails is: *the signed artifact must dominate the executed artifact*. Here the signed artifact (a range) is strictly weaker than the executed artifact (a concrete version), so the signature cannot bound behavior. A subtler variant: the resolver is deterministic but the index is mutable, so two instances that load the "same" signed skill at different times execute different code. The registry is not a function of the manifest — it is a function of (manifest, wall-clock index state). Any agent that assumes manifest identity implies behavioral identity across a fleet is wrong by construction. ## Condition of Validity The attack requires all of the following to hold simultaneously: - The manifest signs a dependency *range* rather than a resolved closure or content hash. - The resolver consults a mutable index at load time rather than a frozen lockfile committed alongside the manifest. - The signed range admits at least one version not yet published at signing time (i.e., the upper bound is not tight to a single version). - The registry namespace permits new publications that satisfy the range under the same trusted prefix. If the manifest pins exact versions with content hashes (`tokenizer-utils@1.2.4 sha256:...`), the range is closed and the shadow cannot be selected. If the loader verifies a signed lockfile that enumerates the full closure, the resolution is covered. If the registry is append-only within a namespace *and* the resolver refuses versions published after the manifest's signing timestamp, the window closes. The vulnerability is precisely the gap between "signature over declaration" and "execution over resolution." ## Decision Boundary The instance must decide, at load time, whether the resolved closure is *covered* by the signature it verified. The practical test: compute the resolution, then check whether the resolved set is a subset of what the manifest's signed metadata could have anticipated. Concretely — reject any resolved dependency whose publish timestamp postdates the manifest's signing timestamp, unless the manifest carries an explicit signed lockfile naming that exact version and hash. This is a *timestamp-and-pin* guard, not a signature guard. The boundary is: **a dependency version published after the manifest was signed is out-of-closure by definition**, even though it satisfies the declared range. Treating range-satisfaction as closure-membership is the exact logical error. The guard converts an unbounded "satisfies range" predicate into a bounded "was named or predates signing" predicate. A secondary boundary: if the loader cannot obtain a trustworthy publish timestamp (index does not expose it, or clock skew is large), it must fail closed rather than fall back to range-satisfaction. An unverifiable closure is not a permissive closure. ## Operational Effect Without the guard, a fleet of agents loading the same signed skill at different times silently diverges in behavior, and the divergence is invisible to signature auditing — every instance reports "signature valid." Incident response that revokes the publisher key does nothing, because the publisher is innocent. The blast radius is every instance that resolved after the shadow publication, bounded only by the range's popularity. With the guard, the loader raises on the shadow resolution and the skill fails to load, which is the correct outcome: the instance cannot prove the executed closure matches the signed intent, so it declines to execute. The cost is availability (a legitimate patch release within the range now requires a manifest re-sign), which is the intended trade — re-signing is cheap, silent closure drift is not. The invariant to enforce fleet-wide: *no executable code path may run under a signature that does not name it.* ```python import hashlib from dataclasses import dataclass class UncoveredClosureError(RuntimeError): """Resolved dependency closure is not dominated by the verified manifest signature.""" pass @dataclass(frozen=True) class Manifest: name: str version: str signed_at: int # epoch seconds, from signed metadata dep_ranges: dict # name -> range spec signed_lockfile: dict # name -> (version, sha256) or {} if absent signature_valid: bool @dataclass(frozen=True) class ResolvedDep: name: str version: str published_at: int sha256: str def assert_closure_covered(manifest: Manifest, resolved: list[ResolvedDep]) -> None: if not manifest.signature_valid: raise UncoveredClosureError(f"{manifest.name}@{manifest.version}: signature invalid") for dep in resolved: pinned = manifest.signed_lockfile.get(dep.name) if pinned is not None: pin_ver, pin_hash = pinned if (dep.version, dep.sha256) != (pin_ver, pin_hash): raise UncoveredClosureError( f"{dep.name}@{dep.version} diverges from signed pin " f"{pin_ver}@{pin_hash[:12]}" ) continue # No signed pin: the only sound cover is that the resolved version # predates the manifest signature. Range-satisfaction is NOT cover. if dep.published_at > manifest.signed_at: raise UncoveredClosureError( f"{dep.name}@{dep.version} published_at={dep.published_at} " f"postdates signed_at={manifest.signed_at}; " f"closure not dominated by signature" ) def load_skill(manifest: Manifest, resolved: list[ResolvedDep]) -> None: assert_closure_covered(manifest, resolved) # ... import and execute only after closure coverage holds ... ```