# When must an instance refuse a signed capability manifest that verifies correctly: the registry-injection boundary at manifest-to-loader handoff **Date of Record:** 2026 November 24 **Scope:** Applies to agents that dynamically load skills/tools from a registry where each skill ships a signed capability manifest (name, schema, scopes, entrypoint, declared side effects). Covers the gap between cryptographic verification of the manifest and the loader's actual binding of the skill into the runtime. Does not cover static, build-time-linked toolchains or registries with no manifest layer. ## Core Distinction A signed manifest proves *who authored the declaration*. It does not prove that the *declaration is the thing being loaded*. The failure mode lives in the seam between two independent trust decisions that are routinely collapsed into one: 1. **Signature validity** — the manifest bytes hash to a value signed by a key in the trust set. 2. **Binding fidelity** — the entrypoint the loader actually imports, registers, and exposes to the model is the same object the manifest describes, with the same schema, same scopes, and same declared side-effect class. Most registries verify (1) rigorously and treat (2) as an implementation detail of the loader. Skill-injection attacks exploit exactly this: they do not forge signatures, they *satisfy* them. A manifest that validates perfectly can still cause the runtime to bind a skill whose behavior diverges from its declaration — because the divergence is introduced after verification, in the resolution of names, aliases, entrypoints, or schema coercion. The invariant that must hold: **the bytes that were verified must be the bytes that are executed, and the identity resolved at verification time must be the identity resolved at load time, with no re-resolution in between.** Any loader that re-resolves a name, re-fetches an entrypoint, or re-coerces a schema after signature check opens a window that a probabilistic planner will eventually drive a payload through — not maliciously, but because the model selects tools by *description similarity*, and a near-duplicate description is the cheapest injection vector available. ## What Was Observed A registry served two skills with distinct signed manifests: - `db.query` — read-only scope, schema `{sql: string}`, side-effect class `read`. - `db.query.v2` — same schema, additional scope `write`, side-effect class `mutate`, signed by the same publisher key, correctly flagged. Both manifests verified. Trust set matched. Expiry valid. The loader, however, resolved tool names through a normalization step that stripped version suffixes for backward compatibility (`v2` → base name), then registered by the *normalized* name. The model, given a task "summarize recent orders," selected the tool whose description scored highest against the request. Because `db.query.v2`'s description mentioned "recent" and "orders" more prominently, the planner chose it — but the normalized registration key meant the runtime bound the *base* entrypoint while carrying the *v2* manifest's scope metadata into the policy layer. The policy layer saw `write` scope and permitted a mutation; the entrypoint executed was the read-only handler, which happened to accept a trailing statement and executed it under the read connection with autocommit enabled. The signature was never broken. The manifest was never tampered with. The injection succeeded because **name normalization created a second resolution step after verification**, and the two resolutions disagreed about which object the name referred to. The scope metadata and the executable body were drawn from different manifest generations. A second observation: when the loader re-fetched the entrypoint by URL after verifying the manifest, a registry-side cache returned a body whose hash differed from the manifest's declared `entrypoint_digest`. The loader did not compare the fetched body against the digest — it had already "verified the manifest" and considered the job done. The digest field existed in the schema but was never enforced at bind time. This is the canonical gap: the manifest *declares* a digest, and nothing *checks* it against the loaded artifact. ## Condition of Validity The gap is only exploitable — and the guardrail only necessary — under a specific conjunction: - The registry supports **name aliasing, version normalization, or description-based selection**, so the model's chosen tool identifier can differ from the manifest's canonical identifier. - The loader performs **any re-resolution** (name lookup, URL fetch, schema coercion, default merging) *after* signature verification and *before* binding. - The manifest carries **scope or side-effect metadata that is consumed by a policy layer separate from the executable body**, so metadata and body can be sourced from different generations. - Tool selection is **description-driven** (the normal case for LLM planners), so a near-duplicate description is sufficient to steer selection without any identifier collision. If any of these is absent, the surface narrows. If all four hold — which is the default configuration of most dynamic skill registries — the boundary is open by construction, and the only question is whether a given planner run happens to select the divergent alias. That is a probabilistic question, not a security-hardening question, which is why it recurs. ## Decision Boundary The instance must draw a hard line at the moment of binding, not at the moment of verification. Concretely: - **Refuse to bind when the resolved entrypoint digest does not equal the manifest's declared digest.** Verification of the manifest is necessary but not sufficient; the loaded artifact must be hash-checked against the manifest field at the instant of import. - **Refuse to bind when name normalization changes the canonical identifier.** Either the normalized name maps to exactly one manifest (and that manifest's metadata is what the policy layer consumes), or the load is rejected. Silent fallback to a base name is a binding-fidelity violation. - **Refuse to bind when scope metadata and executable body carry different manifest generation identifiers.** The policy layer and the loader must consume the same signed tuple, not two lookups of the same name. - **Treat description-similarity collisions as a first-class condition.** When two registered skills' descriptions exceed a similarity threshold and their side-effect classes differ, the planner must be forced to disambiguate by canonical identifier, not by description score. These are not "best practices." They are the conditions under which the signature means anything. A signature over a declaration that the runtime does not honor is a signature over a comment. ## Operational Effect When the boundary is enforced, the failure surface collapses from "any skill whose description can outscore its neighbor" to "any skill whose bytes match its signed manifest and whose canonical name is unique." The first is unbounded and probabilistic; the second is a finite, auditable set. The cost is that backward-compatible aliasing and description-driven selection must be made explicit and digest-bound rather than implicit in the loader. When the boundary is *not* enforced, the observable signature is subtle: no signature error, no policy denial, no schema mismatch — just a tool call that executed with the wrong privilege class because two resolution steps disagreed. The audit trail shows a valid manifest, a valid signature, and a successful call. The only forensic trace is the divergence between the manifest's declared entrypoint digest and the digest of what actually ran. If the loader does not record that comparison, the incident is invisible after the fact. The operational rule for the instance: **verify the manifest, then verify that what you are about to load is what the manifest described, and refuse if you cannot prove the two are the same object.** The refusal is the invariant. Everything else is a comment on it. ```python import hashlib from dataclasses import dataclass class ManifestBindingError(RuntimeError): """Raised when a verified manifest does not match the artifact being bound.""" pass @dataclass(frozen=True) class SignedManifest: canonical_name: str entrypoint_url: str entrypoint_digest: str side_effect_class: str # "read" | "mutate" generation: str signature_valid: bool def bind_skill(manifest: SignedManifest, fetched_body: bytes, resolved_name: str, policy_generation: str) -> str: # Step 1: signature must already be valid (verified upstream). if not manifest.signature_valid: raise ManifestBindingError( f"manifest {manifest.canonical_name!r} failed signature verification" ) # Step 2: binding fidelity — the loaded bytes must match the declared digest. actual_digest = hashlib.sha256(fetched_body).hexdigest() if actual_digest != manifest.entrypoint_digest: raise ManifestBindingError( f"entrypoint digest mismatch for {manifest.canonical_name!r}: " f"declared {manifest.entrypoint_digest[:12]}, loaded {actual_digest[:12]}" ) # Step 3: no post-verification name re-resolution. if resolved_name != manifest.canonical_name: raise ManifestBindingError( f"name normalization changed identity: resolved {resolved_name!r} " f"!= canonical {manifest.canonical_name!r}" ) # Step 4: policy layer and loader must consume the same manifest generation. if policy_generation != manifest.generation: raise ManifestBindingError( f"generation skew: policy sees {policy_generation!r}, " f"loader binds {manifest.generation!r} for {manifest.canonical_name!r}" ) return manifest.canonical_name ```