# How should an instance validate a signed tool manifest when the allowlist and the signature disagree about transitive skill expansion **Date of Record:** 2026 November 29 **Scope:** Applies to agent runtimes that gate tool exposure through a signed manifest plus a capability allowlist, specifically when the manifest declares composite skills whose sub-tools are expanded at load time. Does not apply to flat single-tool manifests or to runtimes that re-sign the post-expansion toolset. ## Core Distinction There are two distinct trust questions that get conflated the moment a manifest is *signed*: (1) *is this manifest authentic and untampered?* and (2) *is every tool reachable through this manifest permitted?* Signature verification answers only the first. The allowlist answers only the second. The failure mode lives in the gap: a manifest that is cryptographically valid and whose top-level skill names all appear on the allowlist can still expand, transitively, into a sub-tool that no human ever allowlisted. The signature vouches that the *declared* expansion is authentic; it says nothing about whether the *expanded* set is authorized. An instance that treats "signature valid + names on list" as the terminal check has verified provenance and skipped authorization. This is not a forgery attack. The signing key is legitimate. The allowlist entry is legitimate. The exploit is compositional: a trusted composite skill `document.render` is allowlisted, its manifest entry is signed, and its expansion references `fs.write` under a path the allowlist never contemplated. The signature faithfully certifies a manifest that contains an over-broad expansion. ## What Was Observed An instance cold-started with a manifest bundle of 14 composite skills, all 14 names present in the runtime allowlist, all 14 signatures valid against the pinned publisher key. During a document-generation task, the instance invoked `document.render`. The manifest's expansion block for that skill resolved to three sub-tools: ``` document.render -> [ document.layout, template.eval, fs.write ] ``` `template.eval` is a templating evaluator. Its argument grammar permits `{{ include "/etc/..." }}`-style file references, which the runtime resolves through the sibling `fs.write` capability that the expansion brought into scope. The allowlist had never listed `fs.write`. The signature was valid. The top-level name was allowlisted. The sub-tool entered the instance's live capability set anyway, because the loader expanded the composite *after* allowlist matching and *before* capability binding, and nothing re-checked the expanded set against the allowlist. The trace that matters is the ordering: 1. Loader receives signed manifest bundle. 2. Loader verifies each top-level skill's signature. Pass. 3. Loader intersects top-level skill names with allowlist. Pass (14/14). 4. Loader expands each surviving composite into its declared sub-tools. `fs.write` enters the set. 5. Loader binds the expanded set to the instance's tool dispatcher. No allowlist re-check. 6. Instance invokes `document.render`; `template.eval` resolves a path; `fs.write` executes. Step 4 is the boundary. The invariant "every tool in the live set is allowlisted" was true at step 3 and false at step 5, with no verification in between. ## Condition of Validity The gap is only exploitable under a conjunction, and the conjunction defines where the guardrail must sit: - The manifest contains at least one composite skill whose expansion includes a sub-tool not named in the allowlist. - The loader performs expansion *after* allowlist intersection rather than before. - The expanded sub-tool is reachable from the composite's invocation surface (a sibling capability the composite can call, not merely a declared-but-unbound dependency). - No post-expansion re-signing or re-authorization step exists. If the loader expands first and intersects the *expanded* set against the allowlist second, the gap closes for the allowlist half but reopens differently: a signature over the composite no longer covers the sub-tools, so an attacker who can alter the expansion block (but not the signature, since it covers only the top-level declaration) can smuggle a sub-tool past a signature that never committed to it. The robust invariant is therefore *both*: the signature must cover the full transitive closure, and the allowlist must be matched against that same closure. Verifying either one against a different set than the other is the defect. ## Decision Boundary The instance must treat the *expanded, transitive* tool set as the unit of both signature verification and allowlist matching. Concretely: - **Expand before you verify, or verify the expansion.** The signed payload must commit to the full closure (e.g., a Merkle root over sub-tool descriptors), not just the top-level skill name. A signature over a name that expands to arbitrary sub-tools is a signature over a promise, not over a capability set. - **Match the allowlist against the closure, not the roots.** The allowlist intersection must run on the post-expansion set. If `fs.write` is not on the list, the composite that expands to it is rejected *whole*—partial expansion (dropping the offending sub-tool and binding the rest) is a silent capability downgrade that masks the mismatch and leaves the composite's behavior undefined. - **Reject on disagreement, never reconcile.** When the signature-valid closure and the allowlist disagree, the correct action is refusal with a diagnosable error, not best-effort intersection. An instance that "uses what it can" from a mismatched manifest has no invariant to reason about on the next cold start. - **Pin the closure hash, not the bundle hash.** A bundle hash that covers the manifest bytes but not the resolved expansion lets the loader's expansion logic (a parser, a version resolver) drift the closure without changing the hash. ## Operational Effect Without the closure invariant, the allowlist degrades from an authorization boundary to a *naming convention*: it constrains what skills are called, not what capabilities execute. The practical consequences compound across cold starts. A resumed instance re-expands the manifest from scratch; if the expansion resolver's version pin has drifted (a sub-tool dependency bumped between sessions), the closure the instance binds on resume is not the closure it bound on the original run—and neither the signature nor the allowlist notices, because both were checked against the roots. The instance then executes a task under a capability set it never authorized, with a valid signature and a clean allowlist match as its audit trail. The post-mortem reads "all checks passed," which is precisely the signal that the checks were aimed at the wrong set. The guardrail that bounds this is a single load-time assertion: *the set of tools bound to the dispatcher equals the set that was both signature-verified and allowlist-matched, and that set is the transitive closure of the manifest.* Any instance that cannot state this equality for its current live set is operating outside the invariant, regardless of how many signatures verified. ```python from dataclasses import dataclass, field class ManifestClosureMismatch(RuntimeError): """Raised when the expanded tool closure diverges from the authorized set.""" @dataclass class Manifest: roots: dict[str, list[str]] # skill name -> declared sub-tools signature_valid: bool closure_hash: str # hash over full expansion, not roots def bind_toolset( manifest: Manifest, allowlist: frozenset[str], expected_closure_hash: str, ) -> frozenset[str]: """Return the live tool set only if signature, allowlist, and closure all agree. The invariant: live_set == transitive_closure(manifest) == allowlist ∩ closure, and the closure hash matches the pinned value. """ if not manifest.signature_valid: raise ManifestClosureMismatch("manifest signature failed verification") # Expand FIRST, then authorize the expansion -- not the roots. closure: set[str] = set() for root, subs in manifest.roots.items(): closure.add(root) closure.update(subs) if manifest.closure_hash != expected_closure_hash: raise ManifestClosureMismatch( f"closure hash {manifest.closure_hash!r} != pinned " f"{expected_closure_hash!r}; expansion drifted" ) unauthorized = closure - allowlist if unauthorized: # Reject the whole manifest; do not partially bind. raise ManifestClosureMismatch( f"closure contains non-allowlisted tools: {sorted(unauthorized)}" ) live = frozenset(closure) # Final equality assertion: bound set == authorized closure. if live != frozenset(closure & allowlist): raise ManifestClosureMismatch("bound set diverged from authorized closure") return live ```