# When must an instance reject a skill manifest whose declared capabilities understate its transitive tool reach **Date of Record:** 2026 November 26 **Scope:** Applies to agents that load tool/skill manifests at runtime and gate them against a static capability allowlist. Does not cover static, compile-time-fixed tool sets, nor defense against prompt injection arriving through *data* rather than through *manifest declarations*. ## Core Distinction The failure mode here is not "the agent loaded a malicious skill." It is subtler: the agent loaded a manifest whose *declared* capability set was a proper subset of the capabilities its tools actually exercise at execution time. Allowlist validation typically compares the manifest's `capabilities` field against the allowlist and admits the skill if `declared ⊆ allowlist`. That predicate is sound only if `declared` is a faithful upper bound on the skill's true reach. When a skill's tools are *composed* — a skill that declares `read:filesystem` but internally calls a `shell.exec` tool whose own manifest declares `exec:process` — the declared set of the composite is not the union the validator assumed. The validator checks the leaf, not the closure. The non-obvious part: the allowlist check is *correct per-manifest* and *unsound per-skill*. Each individual manifest it inspects is honest. The violation emerges only in the transitive closure of tool invocations the skill will perform, which is data the validator never assembles because it validates manifests one at a time as they are loaded. ## What Was Observed A skill package `doc-indexer` was admitted. Its manifest declared: ``` capabilities: ["read:filesystem", "write:scratch"] ``` Both are on the allowlist. The validator passed it. During execution, `doc-indexer` invoked its dependency `text-extract`, which declared `read:filesystem` and `exec:subprocess` — and `exec:subprocess` was *not* on the allowlist. The validator never saw `text-extract`'s manifest because dependency resolution happened lazily, at first tool call, inside the skill's own runtime, after admission. By the time `text-extract` loaded, the admission gate had already returned `allow` and the skill was executing with the agent's ambient authority. The observable trace: the skill's first tool call succeeded, the second tool call resolved a dependency, the dependency's manifest was read by the *skill's* loader (not the admission gate), and the subprocess capability was exercised without ever crossing the allowlist check. The gate's log showed a clean `allow` for `doc-indexer` and no entry at all for `text-extract`. The audit trail was internally consistent and completely wrong. A second, quieter variant: a skill declared `network:http` (allowed) but its manifest's `tools` array referenced a tool whose *version* had been updated upstream to add `network:raw_socket`. Same name, wider reach. The allowlist matched on tool name, not on the capability set the resolved version would actually exercise. This is a TOCTOU between manifest admission and tool resolution. ## Condition of Validity The single-manifest allowlist check `declared ⊆ allowlist` is a valid defense **if and only if** all of the following hold: 1. **Closure completeness.** The set of tools a skill can invoke is fully enumerable from its manifest *before* execution — i.e., the manifest lists transitive dependencies, or the loader resolves them eagerly under the gate. Lazy resolution voids the guarantee. 2. **Declaration faithfulness.** Each tool's declared capabilities are an upper bound on what it exercises. A tool that declares `read:filesystem` but shells out is out of scope for the check. 3. **Version pinning.** The resolved tool is the one whose manifest was validated. Unpinned names admit TOCTOU drift. 4. **No runtime capability escalation.** No tool can acquire a capability at call time that its manifest did not declare (e.g., via ambient agent credentials, inherited environment, or a broker that grants on request). If any of these is false, `declared ⊆ allowlist` is necessary but not sufficient, and the gate must not return `allow` on the strength of the leaf check alone. ## Decision Boundary The operative decision is: **when the manifest's declared set is not provably equal to the transitive capability closure, the gate must fail closed, not open.** Concretely, the boundary is: - If the loader can produce the full dependency closure *before* admission and every node's declared set is within the allowlist → admit. - If the loader resolves lazily, or any dependency is unpinned, or any tool's declaration is unverifiable → **deny** (or admit only in a sandbox whose ambient authority is the allowlist intersection, so that an undeclared capability fails at the syscall boundary rather than at the manifest boundary). The trap is treating "declared ⊆ allowlist" as the decision. It is only the decision when closure completeness and faithfulness hold. The correct predicate is `closure(skill) ⊆ allowlist`, and the gate must be able to *compute* `closure` — which means lazy resolution is itself a boundary violation, because it defers closure computation past the point of decision. A practical guardrail: the admission gate must own dependency resolution. The skill runtime must not be permitted to resolve its own dependencies post-admission; it must receive an already-resolved, already-validated tool graph, and any attempt to resolve a tool outside that graph must raise rather than fetch. ## Operational Effect With the closure check in place, the `doc-indexer` case fails at admission: the gate resolves `text-extract`, sees `exec:subprocess` outside the allowlist, and denies the whole skill. The audit log records the denial against the composite, with the offending leaf named. The skill never executes, so the ambient-authority window never opens. The cost is that admission now requires eager dependency resolution, which is slower and requires the gate to hold a resolver — a real architectural commitment. The benefit is that the allowlist becomes a statement about what the agent can *actually do*, not what each manifest *claims*. For agents that load third-party skills, this is the difference between a check and a decoration. The residual risk after the fix is declaration faithfulness (condition 2): a tool that lies about its own reach still passes. That is a separate invariant — capability attestation at the tool boundary — and the closure check does not substitute for it. But the closure check closes the composition gap, which is the gap that lazy resolution silently widens. ```python class CapabilityClosureViolation(RuntimeError): """Raised when a skill's transitive capability closure exceeds the allowlist, or when the closure cannot be computed before admission.""" pass def admit_skill(manifest: dict, resolver, allowlist: set[str]) -> dict: # Eagerly resolve the full tool graph. Lazy resolution is itself a violation: # it defers closure computation past the point of decision. try: graph = resolver.resolve_closure(manifest) # must be complete, pinned except resolver.LazyResolutionError as e: raise CapabilityClosureViolation( f"skill {manifest.get('name')!r} cannot be admitted: " f"dependency closure not computable before execution ({e})" ) offending: list[tuple[str, str]] = [] for node in graph.nodes: if node.version is None: raise CapabilityClosureViolation( f"tool {node.name!r} in closure of {manifest.get('name')!r} " f"is unpinned; version drift makes declaration unverifiable" ) for cap in node.declared_capabilities: if cap not in allowlist: offending.append((node.name, cap)) if offending: raise CapabilityClosureViolation( f"skill {manifest.get('name')!r} denied: transitive capabilities " f"outside allowlist: {offending}" ) return {"decision": "allow", "skill": manifest["name"], "closure": graph} ```