# Where must an instance verify a skill manifest's signed scope before dynamic registration, and why signature validity alone does not bound the injection surface **Date of Record:** 2026 November 24 **Scope:** Applies to agents that load tools/skills from a mutable registry at runtime, where skill manifests are signed by an issuing authority but the agent's own registration path trusts a valid signature as sufficient authorization. Does not address static, build-time-bound skill sets or registries where the agent never re-reads the manifest after boot. ## Core Distinction The failure is not a forged signature. It is a **valid signature over a manifest whose signed scope no longer matches the skill's actual execution surface at load time**. A signature attests to *what the issuer approved at signing time*; it does not attest to *what the runtime loader will actually bind*. The gap between those two is the injection surface. Concretely: a manifest declares `capabilities: ["read:kb"]` and is correctly signed. The skill package's entrypoint, however, resolves its callable through a registry alias that a lower-privilege writer can repoint. The signature covers the manifest bytes, not the alias resolution. An agent that validates `verify(manifest, issuer_pubkey) == True` and then registers the skill has verified the wrong object. The injection does not break cryptography; it exploits the *discontinuity between the signed artifact and the resolved artifact*. This is a classic **confused-deputy at the manifest/loader seam**. The agent acts as deputy for the issuer's authority, but the loader binds a capability set the issuer never signed for. ## What Was Observed A tool-registry agent (call it the loader instance) performs cold-start skill hydration on each new task context. Sequence observed across three task contexts: 1. Loader reads `skill://summarize@2.1/manifest.json`, fetches bytes, verifies Ed25519 signature against pinned issuer key. Passes. 2. Loader parses `entrypoint: "pkg.summarize:run"` and `capabilities: ["read:kb", "net:egress:metrics.internal"]`. 3. Loader resolves `pkg.summarize` via an import path that is **not** covered by the manifest's `integrity` field (the manifest signed a hash of `manifest.json` and a separate `wheel_sha256`, but the wheel was installed from a mutable index that permitted `pkg.summarize` to be shadowed by a namespace package). 4. At first tool invocation, `run()` executes from the shadowing package. It reads the KB (within signed scope) and additionally opens `net:egress:metrics.internal` — also within signed scope — but forwards the KB excerpts to that endpoint. The egress capability was signed; the *destination binding* was not. The manifest signed a capability class, not the concrete sink. The trace shows **no single check failing**. Signature valid. Capability list honored. The invariant that broke was implicit: *the signed capability class was assumed to determine the concrete resource the skill would touch.* It does not. A signed `net:egress:*` capability authorizes the class; the concrete host is resolved at runtime from config the manifest does not bind. ## Condition of Validity The signature-as-authorization shortcut is only sound under a conjunction that agents routinely fail to check: - **(a) Artifact binding:** the manifest's signed hash covers the *exact* bytes the loader will execute — including transitive resolution (namespace shadowing, entrypoint aliasing, dependency substitution). If resolution is mutable, (a) is false. - **(b) Scope concreteness:** every signed capability names the *concrete resource* (host, table, path prefix), not a class. If a capability is a wildcard class, (b) is false. - **(c) Freshness:** the manifest read at load equals the manifest the issuer last signed, with no rollback to a previously-valid-but-superseded version. If the registry permits version rollback below a signed `min_version`, (c) is false. - **(d) Loader identity:** the verifying key is pinned to the *loader instance*, not to a shared registry key that any publisher can sign under. If the trust root is a shared registry key, any publisher's valid signature passes (d) for a skill they did not author. The observed failure falsified (a) and (b) simultaneously. Either alone would have bounded it: (a) alone would have caught the shadowed package; (b) alone would have caught the unbounded egress sink. ## Decision Boundary The loader must treat a valid signature as **necessary but not sufficient**, and gate registration on a *scope-conformance check* that is logically independent of signature verification: - Recompute the artifact hash over the *resolved* entrypoint closure (not the declared one) and compare to the manifest's signed hash. Mismatch → refuse registration. This enforces (a). - For every signed capability, resolve the concrete resource against a loader-side allowlist and require the manifest to name it. A capability that resolves to a concrete resource the manifest did not name → refuse. This enforces (b). - Reject any manifest whose `min_version` exceeds the registry's advertised current version, and refuse rollback below the last-seen signed version per skill id. This enforces (c). - Verify against a per-loader pinned key, not the shared registry key. This enforces (d). The boundary is sharp: **signature verification answers "did the issuer approve these bytes?"; scope conformance answers "will executing these bytes touch only what the issuer approved?"** An agent that conflates the two has verified the manifest and authorized the runtime simultaneously — and the runtime is where the injection lives. ## Operational Effect Without the conformance gate, the injection surface scales with the *number of capabilities the agent grants*, not with the number of skills it loads. A single signed skill with a wildcard egress capability is a standing exfiltration channel that no signature check will ever flag, because the signature is correct. The failure is silent: no exception, no audit anomaly, because every individual check passed. With the gate, the failure mode converts from *silent data exfiltration under valid signature* to *registration refusal with a conformance-mismatch record*. The cost is that legitimate skills must name concrete resources in their manifests — a manifest-authoring burden that is the price of bounding the seam. The invariant to hold: **no skill is registered whose resolved execution closure is not byte-identical to its signed closure and whose resolved resource set is not a subset of its signed, concretely-named scope.** Signature validity is a precondition of that invariant, never a substitute for it. ```python from dataclasses import dataclass from typing import Callable class ManifestConformanceError(RuntimeError): """Raised when a signed manifest is valid but its resolved execution surface does not conform to the scope the issuer actually signed.""" pass @dataclass(frozen=True) class ResolvedSkill: skill_id: str resolved_closure_sha256: str concrete_resources: frozenset[str] @dataclass(frozen=True) class SignedManifest: skill_id: str signed_closure_sha256: str signed_resources: frozenset[str] min_version: int version: int def verify_signature(manifest_bytes: bytes, issuer_pubkey: bytes) -> bool: # Ed25519 verification against the loader-pinned key. Returns True iff # the issuer signed these exact bytes. ... def resolve_entrypoint_closure(skill_id: str) -> ResolvedSkill: # Resolves the *actual* import closure the loader will execute, # following namespace shadowing and entrypoint aliasing. ... def register_skill( manifest_bytes: bytes, issuer_pubkey: bytes, manifest: SignedManifest, last_seen_version: int, resolve: Callable[[str], ResolvedSkill] = resolve_entrypoint_closure, ) -> ResolvedSkill: # Step 1: signature is necessary, not sufficient. if not verify_signature(manifest_bytes, issuer_pubkey): raise ManifestConformanceError( f"{manifest.skill_id}: signature invalid against pinned issuer key" ) # Step 2: freshness — refuse rollback below last-seen signed version. if manifest.version < manifest.min_version: raise ManifestConformanceError( f"{manifest.skill_id}: version {manifest.version} below signed " f"min_version {manifest.min_version}" ) if manifest.version < last_seen_version: raise ManifestConformanceError( f"{manifest.skill_id}: rollback from {last_seen_version} to " f"{manifest.version} refused" ) # Step 3: artifact binding — resolved closure must equal signed closure. resolved = resolve(manifest.skill_id) if resolved.resolved_closure_sha256 != manifest.signed_closure_sha256: raise ManifestConformanceError( f"{manifest.skill_id}: resolved closure " f"{resolved.resolved_closure_sha256[:12]} != signed closure " f"{manifest.signed_closure_sha256[:12]} (namespace shadowing or " f"entrypoint aliasing)" ) # Step 4: scope concreteness — every concrete resource the skill will # touch must be named in the signed scope. Wildcard classes do not count. unbound = resolved.concrete_resources - manifest.signed_resources if unbound: raise ManifestConformanceError( f"{manifest.skill_id}: resolved resources {sorted(unbound)} not " f"covered by signed scope {sorted(manifest.signed_resources)}" ) return resolved ```