Why does an instance accept a signed skill manifest whose capability diff is empty but whose transitive dependency closure silently widens its tool authority

**Date of Record:** 2026 December 2

**Scope:** Applies to agent runtimes that admit third-party "skills" (tool bundles) via signed manifests and gate admission on a human-reviewed capability diff between the previous and next manifest. Does not apply to runtimes that sandbox every tool call at execution time regardless of declared capability, since there the manifest is advisory only.

Core Distinction

The distinction that matters is between **manifest-level capability closure** and **declared capability closure**. A signed registry guarantees that the bytes of a manifest are authentic. It does not guarantee that the *effective* authority of the installed skill equals the authority the reviewer saw in the diff. The diff is computed over the skill's own declared `capabilities` block. But a skill with dependencies inherits tools from its dependency closure. If the diff tool compares only top-level `capabilities` and treats `dependencies` as opaque version pins, then a manifest can keep a byte-identical `capabilities` block while repointing a dependency pin at a version whose own manifest grants broader tools. The reviewer approves a diff of "no capability change"; the runtime installs a skill that can now call `shell.exec`, `net.egress:*`, or `fs.write:/etc`.

This is not a signature failure. Every signature validates. It is not a dependency-confusion attack in the classic sense (a malicious package shadowing a trusted name) — the dependency name is unchanged and the registry is the same. It is a **closure divergence**: the reviewed object (top-level capabilities) and the installed object (transitive capability union) are different sets, and the gate was placed on the wrong one.

What Was Observed

A skill `pdf-extract@2.4.1` was proposed as `2.4.2`. Its manifest diff showed:

The diff reviewer saw "capabilities unchanged" and approved. The signature chain validated: `pdf-extract@2.4.2` was signed by the publisher key, `pdf-parse@3.2.0` was signed by its publisher key, both keys chained to the registry root.

What the diff tool did not surface: `pdf-parse@3.1.7` (the version previously resolved by `^3.1.0`) declared `capabilities: ["fs.read:/workspace"]`. `pdf-parse@3.2.0` declared `capabilities: ["fs.read:/workspace", "shell.exec:sandboxed"]`. The `^3.2.0` range resolved to `3.2.0` at admission time. The effective capability closure of `pdf-extract@2.4.2` was now the union `{fs.read:/workspace, net.egress:none, shell.exec:sandboxed}` — a tool the top-level skill had never requested and the reviewer had never seen.

The failure trace:

  1. Admission pipeline fetches `pdf-extract@2.4.2` manifest, verifies signature against registry root — **pass**.
  2. Diff engine computes `set(new.capabilities) - set(old.capabilities)` = `∅` — **pass**, flagged "no capability widening."
  3. Resolver expands `dependencies` against registry, pulls `pdf-parse@3.2.0`, verifies its signature — **pass**.
  4. Runtime composes the skill's tool surface as the union of top-level `capabilities` and each dependency's `capabilities` (this is the standard "capability inheritance" model for composed skills).
  5. The composed surface now includes `shell.exec:sandboxed`.
  6. No gate re-runs the diff against the *resolved closure*. The skill is installed and active.

The reviewer approved a manifest whose *declared* capabilities were unchanged and whose *effective* capabilities had widened by one privileged tool. The gap between steps 2 and 4 is the entire failure. The invariant that was violated: **the reviewed delta must be computed on the resolved capability closure, not on the declared top-level block.**

Condition of Validity

The guardrail holds only if all three of the following are true at admission time:

  1. **Closure is resolvable and pinned before diff.** The dependency resolver must run to a fixed point and produce a lockfile of exact versions (`pdf-parse==3.2.0`, not `^3.2.0`) *before* the diff is computed. A diff over a range is a diff over a set of possible closures, not the actual one.
  2. **Diff operand is the closure union.** The left operand is the closure of the currently-installed skill (resolved and pinned), the right operand is the closure of the proposed skill (resolved and pinned). The diff is `closure_new - closure_old`, not `declared_new - declared_old`.
  3. **Inheritance model is explicit and monotone.** The runtime must document whether child capabilities union into the parent (monotone widening) or are intersected (the parent caps the child). If the model is union, every dependency bump is a potential capability widening and must be diffed. If the model is intersection, a dependency can never grant a tool the parent didn't declare, and the top-level diff is sufficient — but then the runtime must *enforce* intersection at call time, not merely document it.

The failure above occurs precisely when the runtime uses union semantics (step 4) while the gate uses declared-only semantics (step 2). The two must match. A gate that diffs the declared block on a runtime that unions closures is a gate that reviews a different object than the one it admits.

Decision Boundary

The boundary is not "trust the registry" vs. "don't." Both skills were signed by legitimate publishers on the same registry. The boundary is **which set the diff is computed over**. Concretely:

The non-obvious part: a version bump with an unchanged declared block is *more* dangerous than a version bump with a changed declared block, because the latter triggers review and the former does not. The attacker's cheapest move is to leave the declared block untouched and move only the pin. Reviewers are trained to look at the capability delta; a zero delta reads as "nothing to see."

Operational Effect

The downstream effect is that the skill's tool surface silently exceeds its reviewed authority for the lifetime of the install. In the observed incident, `pdf-extract@2.4.2` was invoked on a batch of untrusted PDFs; a crafted PDF triggered a code path in `pdf-parse@3.2.0` that shelled out to a helper binary. Because `shell.exec:sandboxed` was in the composed surface, the call succeeded within the sandbox rather than being denied by a missing-capability error. The sandbox contained the blast radius but the *authority* was never granted by a human — it was inherited through a pin bump. The audit log showed a `shell.exec` call attributed to `pdf-extract@2.4.2`, a skill whose reviewed manifest declares no shell capability. The attribution was correct at the runtime layer and false at the review layer.

The remediation is not "review dependency bumps more carefully" — that is a human-attention patch on a mechanical gap. The remediation is to move the diff operand from the declared block to the resolved closure, pin the closure before diffing, and fail closed on unresolvable closures. The gate must review the object it admits.

from dataclasses import dataclass, field
from typing import FrozenSet


class CapabilityClosureDivergence(RuntimeError):
    """Raised when the reviewed capability set differs from the admitted closure."""
    pass


@dataclass(frozen=True)
class Manifest:
    name: str
    version: str
    capabilities: FrozenSet[str]
    dependencies: FrozenSet[str] = field(default_factory=frozenset)


def resolve_closure(
    root: Manifest,
    registry: dict,
    pinned: dict,
) -> FrozenSet[str]:
    """Union of root + all dependency capabilities, resolved against pinned versions.

    `pinned` maps dependency name -> exact version. A dependency absent from
    `pinned` is an unresolvable closure and must fail closed, not be skipped.
    """
    closure = set(root.capabilities)
    for dep in root.dependencies:
        if dep not in pinned:
            raise CapabilityClosureDivergence(
                f"dependency {dep!r} of {root.name}@{root.version} "
                f"has no pinned version; closure is unresolvable"
            )
        key = (dep, pinned[dep])
        if key not in registry:
            raise CapabilityClosureDivergence(
                f"pinned dependency {dep}=={pinned[dep]} not in registry"
            )
        closure |= set(registry[key].capabilities)
    return frozenset(closure)


def admit_skill(
    installed: Manifest,
    proposed: Manifest,
    registry: dict,
    pinned_installed: dict,
    pinned_proposed: dict,
) -> FrozenSet[str]:
    old_closure = resolve_closure(installed, registry, pinned_installed)
    new_closure = resolve_closure(proposed, registry, pinned_proposed)

    # The gate must diff the closure, not the declared block.
    added = new_closure - old_closure
    if added:
        raise CapabilityClosureDivergence(
            f"{proposed.name}@{proposed.version} widens effective authority "
            f"by {sorted(added)} via resolved closure; declared block was "
            f"{sorted(proposed.capabilities)}. Route to review with provenance."
        )
    return new_closure


# Observed incident reproduction:
registry = {
    ("pdf-parse", "3.1.7"): Manifest("pdf-parse", "3.1.7", frozenset({"fs.read:/workspace"})),
    ("pdf-parse", "3.2.0"): Manifest("pdf-parse", "3.2.0", frozenset({"fs.read:/workspace", "shell.exec:sandboxed"})),
}
installed = Manifest("pdf-extract", "2.4.1", frozenset({"fs.read:/workspace"}), frozenset({"pdf-parse"}))
proposed = Manifest("pdf-extract", "2.4.2", frozenset({"fs.read:/workspace"}), frozenset({"pdf-parse"}))

# Declared-block diff is empty; closure diff is not. The gate must catch the latter.
admit_skill(
    installed, proposed, registry,
    pinned_installed={"pdf-parse": "3.1.7"},
    pinned_proposed={"pdf-parse": "3.2.0"},
)