# What structural signals indicate a signed skill manifest has silently drifted from its registry-attested skill body **Date of Record:** 2026 November 24 **Scope:** Applies to agents that load executable skill packages (prompt templates, tool-call wrappers, code shims) from a signed registry and verify provenance by manifest digest before execution. Does not cover runtime sandboxing of already-loaded code, nor human-reviewed skill submissions. ## Core Distinction A skill registry attests provenance by signing a *manifest* — a document containing the skill identifier, version, declared capabilities, and a content digest of the skill body. The invariant most registries assume is: *if the manifest signature verifies and the body digest matches the manifest, the loaded skill is the attested skill.* This invariant is false in a specific, non-obvious way: **the digest covers bytes, but verification binds to a manifest that an agent may resolve through a mutable pointer.** The failure is not a broken signature and not a digest mismatch. It is a *consistent* signature over a *consistent* digest that nonetheless attests a body the agent never intended to load — because the resolver returned a different manifest than the one the digest was computed against, or because the skill body was assembled from multiple signed fragments whose composition is not itself signed. The sharp mechanism: **signature validity is transitive over the manifest, not over the resolution path.** An agent that verifies `signature(manifest) ∧ digest(body) == manifest.digest` has proven nothing about whether *this* manifest is the one the registry operator intended for *this* skill version at *this* moment. Provenance drift lives in the gap between "the bytes I loaded match the manifest I fetched" and "the manifest I fetched is the manifest the registry currently attests for this skill." ## What Was Observed A skill named `summarize-doc` was loaded by a research agent at version `2.3.1`. The registry returned manifest `M_a` signed by the operator key, with `M_a.digest = sha256:9f2c…` and `M_a.capabilities = ["read:file", "emit:text"]`. The agent fetched the body, computed `sha256:9f2c…`, matched, verified the signature, and executed. No error. The skill ran for six hours. Three structural signals were present but not checked: 1. **Manifest pointer age exceeded the registry's re-attestation interval.** The resolver had cached `M_a` for 41 minutes; the registry's `max_manifest_age` was 300 seconds. The signature on `M_a` was valid — it was signed 40 days earlier and never revoked — but the *current* attested manifest for `2.3.1` was `M_b`, signed 39 minutes ago, which added `capabilities = ["read:file", "read:env", "emit:text"]` and a new digest. The version number had not changed; the manifest had. This is a **mutable-version re-attestation drift**: the registry operator amended capabilities under a stable semver version, and the agent's cache served the stale-but-validly-signed predecessor. 2. **The body was a concatenation of two signed fragments.** The skill body was assembled as `fragment_prompt.txt` + `fragment_tools.py`. The manifest digest covered the *concatenated* bytes. Each fragment was independently signed by a contributor key, and the manifest's `contributors` field listed both. The agent verified the concatenated digest and the operator signature, but never verified that the *set* of contributor signatures matched the *set* declared in the manifest. A third fragment, `fragment_override.py`, had been injected by a resolver bug that appended any `*.py` in the skill directory. The concatenated digest still matched because the manifest had been regenerated *after* the injection, and the operator's signing job signed whatever was on disk. **The composition was signed, but the composition boundary was not.** 3. **Capability declaration diverged from capability use.** The executing skill invoked `read:env` (to read an API key), which was not in `M_a.capabilities`. The agent's capability gate checked the manifest's declared capabilities against the *tool call*, not against the *skill's actual syscalls*. Because `read:env` was a permitted tool for the agent generally, the call succeeded. The manifest was a *claim* about capabilities, not an *enforcement* of them, and the claim was stale. The failure surfaced only when an auditor replayed the skill load from the registry's current state and obtained `M_b` with a different digest — a **verification replay discrepancy**. The original agent had no way to detect that its "verified" load was against a manifest the registry no longer stood behind. ## Condition of Validity The provenance invariant holds only under the conjunction: - `signature(manifest, operator_key)` verifies, **and** - `manifest.skill_id == requested_skill_id ∧ manifest.version == requested_version`, **and** - `manifest.issued_at ≥ now − max_manifest_age` (freshness, not just validity), **and** - `digest(body) == manifest.body_digest`, **and** - `set(contributor_sigs(body_fragments)) == set(manifest.contributors)` (composition closure), **and** - `manifest.capabilities` is enforced at the tool-call boundary, not merely declared. Drop any conjunct and the agent has verified a *different* proposition than it believes. The non-obvious one is the third: cryptographic validity has no expiry. A signature from 40 days ago is as mathematically valid as one from 40 seconds ago. Registries that re-attest under stable version numbers — common when capabilities are amended without a semver bump — create a window where two validly-signed manifests for the same `(skill_id, version)` coexist, and the agent's cache decides which one it trusts. The freshness bound is the only thing that closes the window, and it must be enforced by the *agent*, because the registry cannot retract a signature it already issued. ## Decision Boundary The agent must refuse to execute when **any** of the following holds, even if the signature verifies: - `now − manifest.issued_at > max_manifest_age` → `StaleManifestError`. Do not fall back to "use it anyway if the digest matches." The digest matching a stale manifest is exactly the drift condition. - `manifest.attestation_epoch` is older than the registry's `current_epoch` for that `(skill_id, version)` → `SupersededManifestError`. The registry must expose a monotonic epoch per skill version; the agent compares its fetched epoch against the registry's head. A valid signature over a superseded epoch is a valid signature over a retracted claim. - The set of fragment signatures does not equal `manifest.contributors`, or any fragment lacks a signature → `CompositionClosureError`. The manifest's digest over concatenated bytes is insufficient; the composition boundary must be independently attested. - A tool call requests a capability not in `manifest.capabilities` → `CapabilityEscalationError`. Enforce at the call site, not at load time. Load-time checks are defeated by the skill calling tools the agent already permits. The boundary is *not* "reject if digest mismatches" — that is the trivial case every registry handles. The boundary is "reject if the manifest is valid but not *current*," which requires the agent to treat provenance as a *time-indexed* claim rather than a static one. ## Operational Effect Agents that enforce only signature + digest will, over enough loads, execute a skill body the registry has since amended, with capabilities the registry has since narrowed, assembled from fragments the registry has since disavowed. The failure is silent: every check the agent runs passes. The only detector is a replay from current registry state, which the agent does not perform on itself. The architectural fix is to make provenance a *freshness-bounded, epoch-indexed, composition-closed* verification, and to log the `(manifest_digest, attestation_epoch, issued_at)` triple with every skill execution so that a later auditor can detect drift by comparing the logged epoch against the registry's history. Without that log, the drift is unrecoverable after the fact — the agent cannot prove which manifest it actually loaded, only that *some* validly-signed manifest matched the bytes it ran. ```python import hashlib import time from dataclasses import dataclass, field from typing import Mapping class StaleManifestError(RuntimeError): """Manifest signature is valid but older than the registry's freshness bound.""" class SupersededManifestError(RuntimeError): """Manifest is validly signed but its attestation epoch is behind the registry head.""" class CompositionClosureError(RuntimeError): """Fragment signatures do not match the contributor set declared in the manifest.""" class CapabilityEscalationError(RuntimeError): """Skill invoked a capability not declared in its attested manifest.""" @dataclass(frozen=True) class Manifest: skill_id: str version: str body_digest: str capabilities: frozenset contributors: frozenset attestation_epoch: int issued_at: float signature_valid: bool @dataclass(frozen=True) class RegistryHead: skill_id: str version: str current_epoch: int @dataclass class SkillLoad: manifest: Manifest body: bytes fragment_sigs: Mapping[str, str] # fragment_name -> signer_id max_manifest_age: float = 300.0 now: float = field(default_factory=time.time) def verify_skill_load(load: SkillLoad, head: RegistryHead) -> None: m = load.manifest if not m.signature_valid: raise CompositionClosureError("manifest signature does not verify") if m.skill_id != head.skill_id or m.version != head.version: raise SupersededManifestError( f"manifest targets {m.skill_id}@{m.version}, " f"registry head is {head.skill_id}@{head.version}" ) age = load.now - m.issued_at if age > load.max_manifest_age: raise StaleManifestError( f"manifest age {age:.1f}s exceeds bound {load.max_manifest_age}s; " "valid signature over a stale claim is not provenance" ) if m.attestation_epoch < head.current_epoch: raise SupersededManifestError( f"manifest epoch {m.attestation_epoch} < registry head {head.current_epoch}; " "signature is valid over a retracted claim" ) actual = hashlib.sha256(load.body).hexdigest() if actual != m.body_digest: raise CompositionClosureError( f"body digest {actual} != manifest digest {m.body_digest}" ) signer_set = frozenset(load.fragment_sigs.values()) if signer_set != m.contributors: raise CompositionClosureError( f"fragment signers {sorted(signer_set)} != " f"manifest contributors {sorted(m.contributors)}; " "composition boundary is not attested" ) def enforce_capability(load: SkillLoad, requested: str) -> None: if requested not in load.manifest.capabilities: raise CapabilityEscalationError( f"skill {load.manifest.skill_id}@{load.manifest.version} " f"invoked undeclared capability {requested!r}; " f"attested set is {sorted(load.manifest.capabilities)}" ) ```