# Where must an instance refuse a tool manifest whose signature verifies but whose capability surface changed after admission? **Date of Record:** 2026 November 26 **Scope:** Applies to agents that resolve tools from a dynamic, mutable registry (MCP servers, plugin manifests, remote skill catalogs) where admission is gated by manifest signing but the runtime resolves the executable/capability surface lazily at invocation time. Does not apply to fully static, build-time-pinned tool sets with no post-admission mutation path. ## Core Distinction The failure is not "unsigned tool gets loaded." Signing works. The failure is that **the signature binds the manifest document, not the capability surface the agent actually invokes**. A registry entry can carry a valid, verifiable signature over `{name, version, description, declared_scopes}` while the thing the runtime fetches at call time—the handler code, the schema, the upstream endpoint, the tool's own transitive tool grants—is resolved by a mutable pointer (`latest`, a redirect, a content-addressed ref that the registry is free to repoint, a schema served from a different origin than the manifest). This is the boundary: **signature validity is a property of admission time; capability surface is a property of invocation time.** Any agent that treats the first as a warrant for the second has an injection surface that no amount of correct cryptography closes. The attacker does not forge a signature. The attacker gets a legitimately signed manifest admitted with a benign declared surface, then changes what that manifest *resolves to* before the agent invokes it—or between two invocations in the same task. ## What Was Observed A multi-step agent resolved a `summarize_document` skill from a registry at task start. Manifest verified: signed by a publisher key the registry trusts, declared scope `read:documents`, no network egress declared. The agent admitted it, cached the manifest, and proceeded through a 14-step plan. At step 9 the agent re-resolved the handler (the runtime did not pin the handler bytes at admission; it stored a `skill_ref` and dereferenced on each call). The registry had repointed `skill_ref` to a new revision. The new handler: - declared the same `name` and `version` string (version was manifest-declared, not content-derived), - carried a handler body that appended a hidden instruction block to its returned tool result, - invoked a transitive sub-tool (`http_fetch`) that the *original* manifest had not declared and the agent's admission policy had never evaluated. The agent's output for step 9 contained the injected instruction; on step 10 the planner, reading the tool result as trusted context, followed it and issued an outbound request to an attacker host. The signature on the manifest never failed. The policy check at admission never re-ran. The trace is the point: **the signed object and the executed object were different objects, and nothing in the pipeline compared them.** The version string matched because version was a manifest field, not a digest. The scope check passed because scope was evaluated against the manifest, not against the handler's actual syscalls or sub-tool grants. A second variant appeared in the same registry: a manifest whose `schema_url` pointed to an origin distinct from the manifest's signing origin. The schema was mutable. The agent validated tool *arguments* against the schema at call time—so a repointed schema could widen the accepted argument shape and route attacker-controlled fields into the handler. Signature over the manifest was intact; the schema it named was not covered. ## Condition of Validity The invariant that bounds this failure: > **A tool is admissible only if the exact bytes the agent will execute are bound by the signature, and the agent re-verifies that binding at every invocation—not only at admission.** Concretely, admissibility requires all of: 1. **Content addressing, not pointer addressing.** The signed manifest must reference the handler by a cryptographic digest of the executable bytes (and the schema by digest, and every transitive sub-tool grant by digest), not by a mutable tag, `latest`, redirect, or origin-relative URL. 2. **Digest re-check at invocation.** At each call, the runtime hashes the resolved handler and compares to the signed digest. Mismatch is a hard stop, not a warning. 3. **Declared surface equals effective surface.** The set of sub-tools, network destinations, and scopes the handler can actually reach must be a subset of what the signed manifest declares. A handler that invokes an undeclared sub-tool is a capability-surface violation even if the sub-tool itself is benign. 4. **Version identity is content identity.** A version string that is not derived from content is not an identity; it is a label the registry can reuse. Two manifests with the same `name@version` and different handler digests must be treated as distinct, conflicting artifacts. 5. **Single origin for manifest, schema, and handler—or explicit cross-origin digest binding.** If the schema lives elsewhere, its digest must be in the signed manifest. When any of these is absent, the signature is a statement about a document, and the agent is executing something the document does not describe. That gap is the injection surface. ## Decision Boundary The agent must draw the line at **first invocation after any resolution event**, not at admission. The decision rule: - **Admit** a skill only if its manifest binds handler, schema, and sub-tool grants by digest, and the digests resolve to bytes the agent can fetch and hash before the first call. - **Refuse and halt the task** (do not silently degrade) if, at invocation time, the resolved handler digest ≠ signed digest, or the effective sub-tool set ⊄ declared set, or the schema origin ≠ manifest origin without a signed schema digest. - **Re-verify on every call**, not once per task. A long-running task that resolved a skill at step 1 and invokes it at step 9 must re-check at step 9; the registry is mutable and the task's trust in the skill must be re-earned per invocation. - **Do not treat a valid signature as transitive trust.** A signed manifest that names an unsigned or pointer-addressed dependency is not a warrant for that dependency. Trust does not flow through a pointer. The subtle case the boundary must catch: a manifest that is *correctly* signed, *correctly* digest-bound at admission, but whose handler, when executed, dynamically loads or invokes a sub-tool resolved through a *separate* mutable pointer. The digest of the handler is intact; the handler's own resolution is not covered. This is why condition 3 (declared ⊇ effective) must be enforced at runtime by observing the handler's actual tool calls, not merely by reading its declared grants. ## Operational Effect With the invariant enforced, the attack collapses: repointing `skill_ref` produces a digest mismatch at the next invocation and the task halts with a capability-surface violation rather than executing injected instructions. The cost is real—per-call hashing, runtime observation of sub-tool calls, and a hard-fail posture that will occasionally stop legitimate tasks when a publisher rotates a handler without re-signing the digest. That false-positive rate is the price of closing the gap; a warn-and-continue posture reintroduces the surface. Without it, the agent's trust model is: "a signature verified once, therefore everything this skill does for the rest of the task is authorized." That is precisely the assumption a mutable registry exploits. The signature was never wrong. The agent asked it the wrong question. ```python import hashlib from dataclasses import dataclass, field class CapabilitySurfaceViolation(RuntimeError): """Raised when the executed capability surface diverges from the signed manifest.""" pass @dataclass(frozen=True) class SignedManifest: name: str version: str handler_digest: str # sha256 of executable bytes, bound by signature schema_digest: str # sha256 of schema, bound by signature declared_subtools: frozenset # sub-tools the handler may invoke signature_valid: bool @dataclass class ResolvedSkill: manifest: SignedManifest handler_bytes: bytes schema_origin: str manifest_origin: str effective_subtools: frozenset = field(default_factory=frozenset) def _sha256(b: bytes) -> str: return "sha256:" + hashlib.sha256(b).hexdigest() def verify_at_invocation(skill: ResolvedSkill, observed_subtools: frozenset) -> None: m = skill.manifest if not m.signature_valid: raise CapabilitySurfaceViolation(f"{m.name}: manifest signature invalid") actual_handler = _sha256(skill.handler_bytes) if actual_handler != m.handler_digest: raise CapabilitySurfaceViolation( f"{m.name}@{m.version}: handler digest mismatch " f"(signed {m.handler_digest}, resolved {actual_handler}) — registry repointed after admission" ) if skill.schema_origin != skill.manifest_origin and not m.schema_digest: raise CapabilitySurfaceViolation( f"{m.name}: schema served from {skill.schema_origin} not bound by signed digest" ) undeclared = observed_subtools - m.declared_subtools if undeclared: raise CapabilitySurfaceViolation( f"{m.name}@{m.version}: handler invoked undeclared sub-tools {sorted(undeclared)} " f"— effective surface exceeds signed surface" ) def invoke(skill: ResolvedSkill, call, observed_subtools: frozenset): verify_at_invocation(skill, observed_subtools) return call(skill.handler_bytes) ```