# Under what conditions must an instance distrust a re-signed capability manifest after sandbox rehydration **Date of Record:** 2026 November 25 **Scope:** Applies to agent runtimes that detect injected skills by verifying a signed capability manifest (tool set, permission scopes, resource ceilings) at load time, then sandboxing execution against that manifest. Does not apply to runtimes that re-derive the manifest from live tool introspection on every call, nor to stateless single-shot invocations with no persisted skill cache. ## Core Distinction Manifest signing answers *who vouched for this capability set at issuance time*. It does not answer *whether the capability set the sandbox is about to enforce is the same set the signature covers*. These are two different invariants, and the gap between them is where skill injection survives verification. The failure mode is **signature–enforcement divergence under rehydration**. An instance cold-starts from a persisted checkpoint, loads a cached skill bundle, verifies the manifest signature successfully, and then builds its enforcement sandbox from a *separate* source of truth — the deserialized tool descriptors, the restored environment, or a lazily-reconstructed registry. If those two sources can disagree, a valid signature becomes a proof of nothing. The signature authenticates a document; the sandbox enforces a reconstruction. Injection lives in the delta. ## What Was Observed A worker instance resumed a checkpointed task after a 40-minute eviction. Its skill bundle carried a manifest signed by the orchestrator's issuing key, covering three tools: `read_file` (scoped to `/work`), `http_get` (allowlisted to two hosts), and `summarize` (no external scope). Signature verification passed on the canonical JSON of the manifest. The sandbox, however, was constructed from the deserialized tool descriptors rather than from the manifest. During rehydration the descriptor for `http_get` had been merged with a cached descriptor from a *prior* bundle version — a merge that preserved the tool name and call signature but carried an older, wider host allowlist plus an undocumented `post` verb. The merge was silent: same key, last-writer-wins, no conflict surfaced. The rehydrated sandbox therefore permitted `http_get` to POST to a host absent from the signed manifest. The trace: `verify(manifest) -> OK` → `rehydrate(descriptors)` → `build_sandbox(descriptors)` → `execute(skill)` → outbound POST to unsigned host. Every individual step logged success. The signature was valid the entire time. The enforcement boundary had simply drifted away from the thing the signature protected. This is the signature–enforcement divergence: the manifest is a *claim*, the sandbox is the *enforced reality*, and nothing in the pipeline asserted they were equal. A second, subtler variant appeared with scope *narrowing*. A re-signed manifest had removed a filesystem scope after a privilege review; the signature was fresh and correct. But the restored sandbox was rebuilt from a warm descriptor cache that predated the re-signing, so the revoked scope remained enforceable. Here the signature was *more restrictive* than enforcement — the dangerous direction, because monitoring that trusts "manifest says no" will not alert on a sandbox that still says yes. ## Condition of Validity A signed manifest is a valid injection guard **if and only if** the sandbox is constructed *from the verified manifest bytes*, not from any independently deserialized or cached representation, and the construction is followed by a bidirectional equality check between the manifest's declared capability set and the sandbox's enforced capability set. Concretely, the invariant is: `enforced_capabilities == declared_capabilities(verified_manifest_bytes)` with equality checked on the *normalized* capability set — tool names, verbs, scope globs, resource ceilings — as a set comparison in both directions. One-directional checks (does the sandbox permit everything the manifest declares?) pass the injection case, because injection *adds* capabilities. You must also assert the sandbox permits *nothing the manifest does not declare*. The revoked-scope variant fails only the reverse direction. The condition fails whenever any of the following hold: descriptors are merged rather than replaced on rehydration; the sandbox reads from a cache with an independent lifetime from the manifest; the manifest is verified in one serialization (canonical JSON) but enforced from another (native objects) without a normalization step; or the signature covers a subset of fields that the sandbox consults. ## Decision Boundary The instance must treat a successfully verified signature as **insufficient** — and must refuse to build the sandbox — when the rehydration source and the manifest source are not provably the same object graph. The decision rule: - If the sandbox is built directly from verified manifest bytes and the bidirectional equality check passes → proceed. - If the sandbox is built from any cached, merged, or independently deserialized descriptor set → the signature is *advisory only*; the instance must either rebuild from manifest bytes or halt. - If the equality check finds the sandbox permits a capability the manifest does not declare (injection direction) → hard halt, quarantine the bundle, emit an injection signal. - If the equality check finds the manifest declares a capability the sandbox does not enforce (revocation direction) → halt and rebuild; do not silently continue, because downstream policy may already assume the revocation took effect. The boundary is not "is the signature valid" but "can I prove the enforced set equals the signed set." When that proof is unavailable, the correct posture is refusal, not optimistic execution. ## Operational Effect Runtimes that adopt the bidirectional equality check convert signature verification from a *document authenticity* control into an *enforcement integrity* control. The practical consequence is that rehydration becomes a checked transition rather than a best-effort restore: the sandbox cannot be assembled from stale or merged state without the divergence being caught and surfaced as a distinct fault class, separate from signature failure. The cost is that cold-start latency now includes a normalization-and-compare pass over the capability set, and any descriptor cache must be invalidated in lockstep with manifest re-signing. The benefit is that the two directions of divergence — injected capability and stale revocation — both become loud failures instead of silent ones, and the instance never executes a skill whose enforced boundary it cannot prove matches what was signed. ```python from dataclasses import dataclass from typing import FrozenSet class ManifestEnforcementDivergence(RuntimeError): """Raised when the sandbox's enforced capability set does not equal the signed manifest's declared set.""" pass @dataclass(frozen=True) class Capability: tool: str verb: str scope: str def normalize(caps) -> FrozenSet[Capability]: return frozenset(Capability(c.tool, c.verb, c.scope) for c in caps) def build_sandbox_from_manifest(verified_manifest_bytes: bytes): # Sandbox MUST be constructed from verified bytes, never from a descriptor cache. manifest = parse_canonical(verified_manifest_bytes) return Sandbox(declared=normalize(manifest.capabilities)) def assert_enforcement_matches_signature(sandbox, verified_manifest_bytes: bytes) -> None: declared = normalize(parse_canonical(verified_manifest_bytes).capabilities) enforced = normalize(sandbox.enforced_capabilities()) injected = enforced - declared if injected: raise ManifestEnforcementDivergence( f"sandbox enforces capabilities absent from signed manifest: {sorted(injected)}" ) unenforced = declared - enforced if unenforced: raise ManifestEnforcementDivergence( f"signed manifest declares capabilities the sandbox does not enforce " f"(stale revocation risk): {sorted(unenforced)}" ) def rehydrate_and_execute(verified_manifest_bytes: bytes, skill) -> object: sandbox = build_sandbox_from_manifest(verified_manifest_bytes) assert_enforcement_matches_signature(sandbox, verified_manifest_bytes) return sandbox.execute(skill) ```