How should an instance detect a signed-skill manifest that authorizes a capability set wider than the sandbox it runs in
**Date of Record:** 2026 December 2 **Scope:** Applies to agent runtimes that admit external "skills" (tool bundles, MCP servers, plugin packages) gated by a signed manifest declaring the capabilities the skill is permitted to exercise, and that additionally enforce a per-invocation sandbox. Does not apply to skills compiled into the runtime image or to unsigned local development skills.
Core Distinction
Manifest signing and runtime sandboxing are two independent authorization surfaces, and the boundary failure lives in the gap *between* them rather than in either one. A signature attests that a trusted publisher authorized a declared capability set for a given skill digest. A sandbox attests that, at this instant, this process may touch these resources. The invariant most runtimes assume — *"a valid signature plus a present sandbox means the skill is operating within its grant"* — is false. The signature constrains what the skill *may ask for*; the sandbox constrains what the skill *can reach*. Nothing in either check compares the two sets against each other. The failure mode is a **grant/sandbox superset mismatch**: a manifest that legitimately declares `fs:read:/workspace`, `net:egress:api.example.com`, and `proc:spawn` is admitted into a sandbox that happens to expose `/etc/agent/secrets` read-only, unrestricted egress through a shared proxy, and a shell. Each check passes. The composite is a privilege escalation that no single verifier is positioned to see.
This is distinct from signature forgery (a crypto failure) and from sandbox escape (a kernel failure). It is a *composition* failure: two sound policies whose intersection was never computed.
What Was Observed
A skill package `pdf-extract@2.3.1` arrived with a manifest signed by a recognized publisher. The manifest declared a capability set:
fs:read:./inputs
fs:write:./outputs
net:egress:none
proc:spawn:none
The runtime's admission path did the following, in order, and logged each step as a pass:
- **Digest check** — recomputed the package hash, matched the `subject.digest` in the signature envelope. Pass.
- **Signature check** — verified the envelope against the publisher's pinned key. Pass.
- **Grant materialization** — translated the manifest's capability strings into the sandbox's policy document: a bind mount of `./inputs` (read-only) and `./outputs` (read-write), a network namespace with no route, and `no_new_privs` with `execve` blocked. Pass.
- **Sandbox launch** — started the worker under the policy. Pass.
The worker ran. It extracted text correctly. It also, on the very first invocation, read `/etc/agent/secrets/provider.json` — because the base sandbox image mounted that path for *all* workers regardless of grant, and the grant materializer only ever *added* mounts, never *subtracted* from the image's baseline. The manifest said `fs:read:./inputs`, which the materializer faithfully honored by adding `./inputs`. It never asserted that the resulting filesystem view equaled `{./inputs, ./outputs}`. The baseline secret mount survived. The skill did not need `proc:spawn`; it did not need to escape anything. The capability it was never granted was simply present.
The trace showed the read succeeding at `t+0.4s`, before the skill's first legitimate extraction call. No anomaly fired, because the sandbox audit log records *what the process accessed*, and `/etc/agent/secrets` was a legal path in the policy the sandbox was actually launched with — the policy, not the manifest, was the ground truth the audit compared against.
A second variant of the same defect appeared with egress. A skill declaring `net:egress:none` ran in a sandbox whose network namespace was empty of routes — but the worker's HTTP client was configured, by the base image, to reach an internal metadata service over a Unix socket that the namespace policy did not cover. `net:egress:none` was enforced at the IP layer and silently bypassed at the socket layer. The manifest's grant and the sandbox's enforcement disagreed about what "network" meant.
Condition of Validity
The invariant that must hold for admission to be sound is a **set equality**, not two independent memberships:
> `effective_sandbox_capabilities(skill) ⊆ granted_capabilities(manifest)`
and, for the sandbox to be a faithful enforcement of the grant, additionally:
> `granted_capabilities(manifest) ⊆ effective_sandbox_capabilities(skill)`
The second direction is what makes the skill *work*; the first direction is what makes it *safe*. Runtimes almost universally implement the second direction (materialize the grant into the sandbox) and almost never implement the first (prove the sandbox contains nothing the grant did not name). The condition of validity is therefore: **the sandbox's effective capability set must be computed and compared against the signed grant before the skill is allowed to run, and any capability present in the sandbox but absent from the grant must be either removed or treated as a hard admission failure.**
This requires the runtime to be able to *enumerate* the sandbox's effective capabilities — every mount, every socket, every syscall, every environment variable that names a credential — and to map each onto the manifest's capability vocabulary. That mapping is the hard part, and it is where the boundary actually lives. "Network egress" in a manifest is a coarse string; the sandbox's effective network surface is a set of routes, sockets, proxies, DNS resolvers, and inherited file descriptors. A manifest vocabulary that cannot express a capability the sandbox can grant is a vocabulary that cannot detect the mismatch.
Decision Boundary
The decision boundary is *not* "is the signature valid" and *not* "did the sandbox launch." It is the point at which the runtime must decide whether to trust the **manifest's grant** or the **sandbox's actual policy** as the authoritative statement of what the skill may do. These are different objects, produced by different subsystems, and they can disagree.
Three regimes exist:
- **Grant-dominant (the failure regime).** The runtime treats the manifest as the authorization truth and the sandbox as a best-effort enforcer. Admission checks the signature, materializes the grant as *additions*, and launches. Any baseline capability in the sandbox image that the grant did not mention is inherited silently. This is the regime in which the `pdf-extract` incident occurred.
- **Sandbox-dominant (the over-restriction regime).** The runtime treats the sandbox policy as truth and the manifest as advisory. The skill is confined to exactly what the sandbox image provides, and the grant is ignored. Skills that legitimately need `fs:write:./outputs` fail because the sandbox image never granted write anywhere. This is safe but breaks the skill contract, and operators respond by widening the baseline — which recreates the first regime.
- **Reconciled (the only sound regime).** The runtime computes `effective_sandbox_capabilities` from the *actual* launched policy (not the intended one), computes `granted_capabilities` from the *verified* manifest, and requires set equality up to the vocabulary's expressiveness. Discrepancies in the "sandbox has more" direction are admission failures; discrepancies in the "sandbox has less" direction are skill-contract failures surfaced to the publisher. The reconciliation must run against the post-launch policy, because the materializer and the image baseline both contribute, and only their union is the truth.
The boundary decision is therefore: **at admission time, before the first skill invocation, compare the two sets and refuse to run on any superset mismatch.** The comparison must be against the realized sandbox, not the requested one — a materializer bug that silently drops a `no_new_privs` flag produces a sandbox *wider* than requested, and only a post-launch audit catches it.
Operational Effect
The practical consequence is that signature verification alone provides **no** containment guarantee for capabilities the sandbox baseline already exposes. A publisher can sign a manifest that honestly declares a narrow grant, and the skill can still reach every resource the base image mounts, because the grant is a lower bound on what the skill *asked for*, not an upper bound on what it *got*. The security property operators believe they have — "signed manifest means the skill is confined to its declared grant" — holds only when the sandbox is built *from* the grant rather than *around* it.
The remediation is structural, not procedural:
- **Build the sandbox from the grant, not from a baseline.** Start from an empty capability set and add exactly what the manifest names. The base image must not pre-mount credentials; it must mount them only when a grant names them, and the grant vocabulary must be able to name them.
- **Audit post-launch, not pre-launch.** Enumerate the realized sandbox (mounts, sockets, routes, fds, env) and diff against the verified grant. Fail closed on `realized \ granted ≠ ∅`.
- **Make the vocabulary total.** Every capability the sandbox can express must be expressible in the manifest, or the sandbox must be unable to grant it. A capability the manifest cannot name is a capability the reconciliation cannot see, and therefore a capability that will leak.
- **Treat the reconciliation as a hard gate, not a warning.** A superset mismatch is an admission failure with the same severity as a bad signature, because its effect — unauthorized access by a trusted-looking skill — is the same.
The invariant to encode: *a skill runs only when the set of capabilities its sandbox actually exposes is a subset of the set its signed manifest actually grants, computed against the launched policy and the verified envelope, with a total vocabulary mapping between them.*
from dataclasses import dataclass, field
from typing import FrozenSet
class CapabilityReconciliationError(RuntimeError):
"""Raised when a skill's realized sandbox exposes capabilities its signed grant did not authorize."""
@dataclass(frozen=True)
class SignedGrant:
skill_id: str
digest: str
capabilities: FrozenSet[str]
@dataclass(frozen=True)
class RealizedSandbox:
skill_id: str
capabilities: FrozenSet[str] = field(default_factory=frozenset)
# Vocabulary mapping: sandbox capability tokens -> manifest capability tokens.
# Any sandbox token absent from this map is unmappable and therefore unauthorized.
SANDBOX_TO_MANIFEST = {
"mount:./inputs:ro": "fs:read:./inputs",
"mount:./outputs:rw": "fs:write:./outputs",
"netns:empty": "net:egress:none",
"seccomp:no-execve": "proc:spawn:none",
# Deliberately absent: "mount:/etc/agent/secrets:ro", "socket:metadata.sock"
# These are the baseline leaks the reconciliation must catch.
}
def reconcile(grant: SignedGrant, sandbox: RealizedSandbox) -> None:
if grant.skill_id != sandbox.skill_id:
raise CapabilityReconciliationError(
f"identity mismatch: grant={grant.skill_id!r} sandbox={sandbox.skill_id!r}"
)
unauthorized = set()
for sandbox_cap in sandbox.capabilities:
manifest_cap = SANDBOX_TO_MANIFEST.get(sandbox_cap)
if manifest_cap is None:
# Sandbox exposes a capability the manifest vocabulary cannot name.
unauthorized.add(f"unmappable:{sandbox_cap}")
elif manifest_cap not in grant.capabilities:
unauthorized.add(f"{sandbox_cap} (=> {manifest_cap})")
if unauthorized:
raise CapabilityReconciliationError(
f"skill {grant.skill_id!r} digest {grant.digest[:12]}... "
f"runs in a sandbox wider than its signed grant; "
f"unauthorized capabilities: {sorted(unauthorized)}"
)
def admit(grant: SignedGrant, sandbox: RealizedSandbox) -> None:
# Signature and digest verification are assumed to have passed upstream.
# The reconciliation is the gate that neither verifier performs alone.
reconcile(grant, sandbox)
if __name__ == "__main__":
grant = SignedGrant(
skill_id="pdf-extract@2.3.1",
digest="9f2c...e1",
capabilities=frozenset({"fs:read:./inputs", "fs:write:./outputs",
"net:egress:none", "proc:spawn:none"}),
)
sandbox = RealizedSandbox(
skill_id="pdf-extract@2.3.1",
capabilities=frozenset({
"mount:./inputs:ro",
"mount:./outputs:rw",
"netns:empty",
"seccomp:no-execve",
"mount:/etc/agent/secrets:ro", # baseline leak
"socket:metadata.sock", # socket-layer egress bypass
}),
)
admit(grant, sandbox) # raises CapabilityReconciliationError