# Why does an instance accept a signed skill manifest whose tool-description hashes match but whose resolved capability set diverges from the signed intent? **Date of Record:** 2026 November 23 **Scope:** Applies to agent runtimes that load skills from a registry, verify a detached signature over a manifest, and then bind tool schemas by hashing their descriptions at load time. Does not cover unsigned local plugins or in-process tools whose schemas are compiled into the agent binary. ## Core Distinction A signed manifest attests to *what the publisher declared*. A reproducible tool-description hash attests to *what the loader actually parsed*. These are two different propositions, and the failure mode lives in the gap between them: the signature verifies, the hash verifies, and the resolved capability set is still wrong. The distinction that matters is between **manifest integrity** (the bytes the publisher signed arrived unmodified) and **capability equivalence** (the tool the agent will actually call is the tool the publisher meant). Signing binds bytes; it does not bind semantics. Hashing binds a parse result; it does not bind the parse *function*. The non-obvious invariant: *a skill is only safe to bind if the hash function, the schema-normalization rules, and the description-extraction path are all pinned by the same signed artifact that carries the tool list.* If any of those three inputs to the hash is supplied by the runtime rather than the manifest, the signature is verifying a document that no longer describes the thing being loaded. ## What Was Observed A registry served a skill `invoice-reconciler@3.1.0` with a manifest containing a `tools` array, each entry carrying `name`, `description`, `input_schema`, and a `description_sha256`. The manifest was signed with an Ed25519 key whose public half was pinned in the agent's trust store. The runtime did the following on load: 1. Fetched manifest, verified signature over the canonicalized JSON. Passed. 2. For each tool, extracted `description`, normalized it (trim, collapse whitespace, strip trailing punctuation), computed SHA-256, compared to `description_sha256`. Passed for all four tools. 3. Bound the tools into the agent's callable set. The agent then executed a reconciliation task and, on the third tool call, invoked `transfer_funds` with a `dry_run` parameter defaulted to `false`. The manifest's `input_schema` for `transfer_funds` did not contain `dry_run` at all. The runtime had silently injected it. The trace: the runtime's schema binder merged each tool's `input_schema` with a *runtime default-schema overlay* — a local JSON file that added common optional parameters (`dry_run`, `timeout_ms`, `idempotency_key`) to any tool whose name matched a regex. This overlay was applied *after* hash verification, because the hash was computed only over `description`, not over `input_schema`. The signature covered the schema bytes; the hash did not; the binder mutated the schema; nothing re-checked. A second, quieter divergence appeared in the same incident. Two tools, `lookup_vendor` and `resolve_vendor`, had descriptions that differed only in a single character (`"Lookup a vendor by ID."` vs `"Lookup a vendor by Id."`). The normalizer lowercased before hashing, so both produced the same `description_sha256`. The manifest author had assigned them different `description_sha256` values (computed without lowercasing), but the loader's normalizer collapsed them, and because the loader compared *its own* hash to the manifest's stored hash, the mismatch should have failed — except the loader had a fallback: on hash mismatch it retried with a "lenient" normalizer that lowercased, and the lenient pass matched. The lenient fallback was intended for legacy manifests but was never gated on a manifest version field. Net result: signature valid, both hashes "valid" (one via lenient fallback), capability set contained an injected parameter and a collapsed tool identity. The agent's planner, seeing two tools with identical description hashes, treated them as aliases and routed vendor lookups to whichever was first in the array — non-deterministically, since the array order was not stable across registry replicas. ## Condition of Validity The invariant holds — and the failure is bounded — only when all of the following are true simultaneously: - The manifest carries a `hash_spec` field naming the exact normalization algorithm (e.g., `nfkc-trim-collapse-v1`) and the exact fields hashed (`description`, `input_schema`, `output_schema`). - The runtime refuses to load a manifest whose `hash_spec` is not in its pinned allowlist. No fallback, no lenient retry. - The hash is computed over the *canonical serialization* of the named fields, using the same canonicalizer used for signature verification, so that a field cannot be omitted from the hash while remaining in the signed bytes. - The schema binder is forbidden from mutating any field covered by the hash after verification. Overlays may only add fields to a separate `runtime_extensions` namespace that the planner is instructed to ignore unless the manifest opts in. - Tool identity is derived from `name`, not from description hash. Two tools with equal description hashes are a manifest error, not an alias. When any of these is absent, the signature is still cryptographically valid but no longer *operationally* meaningful: it attests to a document the runtime has since edited. ## Decision Boundary The boundary is between **verify-then-bind** and **verify-then-mutate-then-bind**. A runtime that mutates any hashed field after verification has, by construction, invalidated its own integrity check. The decision an operator must make is not "is the signature good" but "does the post-verification transformation preserve the hashed projection." If it does not, the load must fail closed. Concretely: if `hash_spec` is missing, or names an algorithm not in the pinned set, or the binder's overlay touches a hashed field, or two tools collide on identity hash, the correct action is to reject the skill and emit a `ManifestSemanticDivergence` event — not to retry with a lenient normalizer. The lenient path is the bug. A signature that verifies under a normalizer the publisher did not sign for is a signature over a different document. ## Operational Effect Agents that load such skills exhibit *capability drift*: the callable set diverges from the signed intent in ways that pass every integrity check. The observable symptoms are subtle — a tool accepts a parameter the schema forbids, two tools alias each other and routing becomes replica-order-dependent, a schema field is silently optional when the manifest marked it required. Because the signature verifies, incident response wastes its first hour on key management. Because the hash verifies, the second hour goes to the registry. The actual fault is in the loader's post-verification transform, which no log line records. The guardrail is to make the hash cover the *entire* signed capability projection and to make the binder a pure function of the verified manifest. Any transform applied after verification must either be a no-op on hashed fields or be itself covered by the signature. The moment a runtime is allowed to "helpfully" normalize, default, or overlay, it has taken ownership of the semantics and the publisher's signature no longer describes what runs. ```python import hashlib import json from dataclasses import dataclass from typing import Any class ManifestSemanticDivergence(RuntimeError): """Raised when a verified manifest's post-verification projection diverges from the hashed capability set the publisher signed for.""" PINNED_HASH_SPECS = {"nfkc-trim-collapse-v1", "raw-bytes-v1"} HASHED_FIELDS = ("description", "input_schema", "output_schema") def canonical_bytes(value: Any) -> bytes: return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=False).encode("utf-8") def normalize(text: str, spec: str) -> str: if spec == "raw-bytes-v1": return text if spec == "nfkc-trim-collapse-v1": import unicodedata return " ".join(unicodedata.normalize("NFKC", text).split()).strip() raise ManifestSemanticDivergence(f"unknown hash_spec {spec!r}") @dataclass class ToolBinding: name: str description: str input_schema: dict output_schema: dict description_sha256: str def project_for_hash(tool: dict, spec: str) -> bytes: projection = {} for field in HASHED_FIELDS: if field not in tool: raise ManifestSemanticDivergence(f"tool {tool.get('name')!r} missing hashed field {field!r}") value = tool[field] if isinstance(value, str): value = normalize(value, spec) projection[field] = value return canonical_bytes(projection) def verify_and_bind(manifest: dict, signature_ok: bool, binder_overlay: dict) -> list[ToolBinding]: if not signature_ok: raise ManifestSemanticDivergence("signature verification failed") spec = manifest.get("hash_spec") if spec not in PINNED_HASH_SPECS: raise ManifestSemanticDivergence(f"hash_spec {spec!r} not in pinned allowlist; refusing lenient fallback") seen_hashes: dict[str, str] = {} bindings: list[ToolBinding] = [] for tool in manifest["tools"]: expected = tool["description_sha256"] actual = hashlib.sha256(project_for_hash(tool, spec)).hexdigest() if actual != expected: raise ManifestSemanticDivergence( f"tool {tool['name']!r} hash mismatch under pinned spec {spec}: expected {expected}, got {actual}" ) if actual in seen_hashes: raise ManifestSemanticDivergence( f"tool identity collision: {tool['name']!r} and {seen_hashes[actual]!r} share hash {actual}" ) seen_hashes[actual] = tool["name"] # Binder may only add to a non-hashed extension namespace. for key in binder_overlay: if key in HASHED_FIELDS: raise ManifestSemanticDivergence( f"binder overlay touches hashed field {key!r} on tool {tool['name']!r}" ) bindings.append(ToolBinding( name=tool["name"], description=tool["description"], input_schema=tool["input_schema"], output_schema=tool["output_schema"], description_sha256=actual, )) return bindings ```