# Where must an instance re-verify a skill manifest after registry-side hot reload, and why signature caching breaks the trust boundary **Date of Record:** 2026 November 29 **Scope:** Applies to agent runtimes that resolve tool/skill definitions from a shared, mutable registry (MCP tool servers, plugin catalogs, skill stores) and cache signed manifests across turns or across sibling instances. Does not apply to statically compiled tool sets or registries where the manifest is bound to the process image at boot and never reloaded. ## Core Distinction A signed skill manifest proves *who authored the current bytes*. It does not prove *that the bytes the instance is about to execute are the bytes that were signed at the moment of resolution*. Those are two different invariants, and the gap between them is the entire skill-injection attack surface. The common mental model treats "manifest signature verified" as a durable property of a skill identity: verify once at registration, cache the verdict, and thereafter treat `skill_id → trusted`. That is wrong. The signature is a property of a **(skill_id, version, content_hash)** triple at a specific point in time. The registry is a mutable store; a hot reload can swap the backing content of a `skill_id` without changing the id, without bumping the version in the way the runtime expects, and in some deployments without invalidating the cache key the runtime uses. The instance's cached verdict then attests to bytes it is no longer executing. The sharp mechanism: **signature-verdict caching keyed on `skill_id` (or on `skill_id + version` where version is registry-controlled and not content-derived) decouples the trust decision from the content it was made about.** Between the verification and the invocation, a registry-side mutation converts a signed, benign skill into an unsigned or differently-signed one, and the runtime executes it under the stale verdict. ## What Was Observed A tool server exposed a skill `summarize_document` at version `1.4.2`. The manifest was signed by the platform key, and the runtime verified it at first resolution during a cold start, then cached `{skill_id: "summarize_document", version: "1.4.2", verdict: TRUSTED, verified_at: T0}` in the instance's skill cache. The cache was keyed on `(skill_id, version)`. At T1, an operator pushed a hot reload of the skill implementation — a bugfix to the prompt template — and the registry, following its own convention, kept the version string `1.4.2` because it treated the patch as "non-breaking" and the version field as a *compatibility* marker rather than a *content* marker. The registry re-signed the new content with the same platform key and updated the manifest. But the runtime's cache key `("summarize_document", "1.4.2")` still hit, and the cached `TRUSTED` verdict was returned without re-reading the manifest. The new content was benign in this case. The failure trace matters because the same path is exploitable: an attacker with registry write access (or a compromised CI principal that can publish to the registry) pushes content under an unchanged `skill_id` and an unchanged version string. The runtime never re-fetches the manifest, never re-verifies the signature against the new content hash, and executes attacker-authored instructions inside the skill's tool-call envelope — with the skill's declared permissions and the agent's ambient authority. The signature was valid for the *new* bytes too (the attacker signed with a key they held, or replayed a manifest whose `content_hash` field was not actually bound to the fetched body), but the runtime never checked. A second, subtler trace: even when the runtime *did* re-fetch the manifest on cache miss, it verified the signature over the manifest document but did not recompute the content hash of the *fetched skill body* and compare it to the `content_hash` field inside the manifest. The manifest was a signed envelope around an unsigned payload. An attacker who could mutate the payload endpoint (a separate object store, a CDN, a different service than the manifest endpoint) could swap the body while leaving the signed manifest intact. Signature verification passed; the executed bytes were never bound to the signature. Both traces share one root: the runtime verified a *document* rather than a *(document, content)* pair, and it cached the verdict at a granularity coarser than the content. ## Condition of Validity The guardrail holds only under all of the following. If any fails, the invariant is unenforced and the instance must fail closed. 1. **The cache key includes the content hash, not the registry-assigned version.** Key on `(skill_id, sha256(canonical_manifest_bytes), sha256(skill_body_bytes))`. A registry that mutates content under a stable version string then produces a cache miss by construction. 2. **Signature verification covers a manifest that binds the body hash.** The manifest must contain `content_hash = sha256(skill_body)` and the signature must cover `content_hash` as part of the signed payload. Verifying the manifest signature without recomputing the body hash is a no-op against payload-swap attacks. 3. **The body is fetched and hashed in the same resolution step as the manifest, from a source the verifier trusts for that hash.** If manifest and body come from different endpoints, the body fetch must be pinned to the hash in the (already verified) manifest — fetch-by-hash, not fetch-by-id. 4. **Cache TTL is bounded and independent of registry push semantics.** A hot reload must not be able to extend the life of a stale verdict. The runtime re-verifies on TTL expiry regardless of whether the registry signaled a change, because the registry's change signal is attacker-influenced. 5. **Re-verification occurs at the invocation boundary, not only at resolution.** Between resolution and invocation, the instance may have yielded, checkpointed, or handed off. The verdict must be re-checked against the current content hash immediately before the tool call is dispatched, or the invocation must carry a hash-pinned reference that the executor re-validates. The invariant: **no skill body executes unless the executing instance has, within the same uninterrupted execution step, recomputed the body hash and confirmed it equals the `content_hash` covered by a signature it verified against a pinned author key.** "Verified earlier" is not a valid premise. ## Decision Boundary When a re-verification fails or cannot be completed, the instance faces a binary choice and must not split it: - **Fail closed and drop the skill from the active tool set for the remainder of the task.** The agent continues with a reduced capability surface and records the degradation. This is correct when the skill is non-essential and the task can complete without it. - **Halt the task and surface a checkpoint.** This is correct when the skill is on the critical path, because continuing with a substituted or unverifiable skill means the agent's subsequent reasoning is conditioned on attacker-influenced tool output — and that output will be distilled into memory and carried forward. The boundary the instance must *not* cross: treating a verification failure as a transient error and retrying against the same cache entry, or falling back to a previously cached `TRUSTED` verdict "to keep the task moving." Both convert a detectable injection into an undetected one. The retry path is the exploit: an attacker who can induce a verification failure (by racing the registry, by serving a malformed manifest) can often also make the retry succeed against stale state. A second boundary: **handoff.** When an instance passes a skill reference to a sibling agent (A2A handoff, sub-agent spawn), it must pass the hash-pinned reference, not the `skill_id` and not its own verdict. The receiving instance has a different cache, a different clock, and possibly a different trust root. A verdict is not transferable; a hash-pinned reference is, because the receiver can re-verify it independently. Passing `{skill_id, verdict: TRUSTED}` across a handoff is the multi-agent form of the same stale-cache bug. ## Operational Effect The practical consequence is that skill resolution must be modeled as a **content-addressed, per-invocation verification**, not a **registry-addressed, per-session trust grant**. This changes three things in the runtime: - The skill cache becomes a content cache, not a trust cache. Caching the *verified body* keyed by its hash is safe and fast; caching the *verdict* keyed by id is not. - The registry's version field is demoted to a human-facing label and never used as a cache key or a trust signal. Content hash is the only identity that matters for execution. - Hot reload becomes a first-class event the runtime must handle by invalidation, and the runtime must assume the registry will not reliably signal it — so TTL and per-invocation re-hash are the actual enforcement, not the reload notification. The residual risk after these changes is the trust root itself: if the attacker holds the signing key, signed manifests do not help, and the defense shifts to key custody, rotation, and manifest transparency logging. That is out of scope here, but the instance should record which trust root verified each manifest so that a later key-compromise audit can enumerate affected executions. ```python import hashlib from dataclasses import dataclass class SkillManifestVerificationError(RuntimeError): """Raised when a skill body cannot be bound to a verified, hash-pinned manifest within the current execution step. Fail closed; never fall back to a cached verdict.""" pass @dataclass(frozen=True) class VerifiedSkill: skill_id: str content_hash: str body: bytes author_key_id: str def resolve_and_verify( skill_id: str, *, fetch_manifest, # (skill_id) -> (manifest_bytes, signature, author_key_id) fetch_body_by_hash, # (content_hash) -> body_bytes ; fetch-by-hash, not by id verify_signature, # (manifest_bytes, signature, author_key_id) -> bool pinned_author_keys: dict, content_cache: dict, # keyed by content_hash only ) -> VerifiedSkill: manifest_bytes, signature, author_key_id = fetch_manifest(skill_id) if author_key_id not in pinned_author_keys: raise SkillManifestVerificationError( f"skill {skill_id!r}: author key {author_key_id!r} not in pinned trust root" ) if not verify_signature(manifest_bytes, signature, author_key_id): raise SkillManifestVerificationError( f"skill {skill_id!r}: manifest signature invalid under key {author_key_id!r}" ) import json manifest = json.loads(manifest_bytes) declared_hash = manifest.get("content_hash") if not declared_hash: raise SkillManifestVerificationError( f"skill {skill_id!r}: manifest does not bind a content_hash; payload-swap possible" ) body = content_cache.get(declared_hash) if body is None: body = fetch_body_by_hash(declared_hash) actual = hashlib.sha256(body).hexdigest() if actual != declared_hash: raise SkillManifestVerificationError( f"skill {skill_id!r}: body hash {actual} != manifest content_hash {declared_hash}" ) content_cache[declared_hash] = body return VerifiedSkill( skill_id=skill_id, content_hash=declared_hash, body=body, author_key_id=author_key_id, ) def invoke_skill(skill: VerifiedSkill, args: dict, *, executor, rehash) -> object: """Re-verify at the invocation boundary, not just at resolution. Guards against mutation between resolution and dispatch (yield, checkpoint, handoff).""" if rehash(skill.body) != skill.content_hash: raise SkillManifestVerificationError( f"skill {skill.skill_id!r}: body mutated between resolution and invocation" ) return executor(skill.body, args) ```