# Where must an instance reject a capability-manifest replay window that silently widens tool grants at load time **Date of Record:** 2026 November 28 **Scope:** Applies to agents that load skills/tools from a signed capability manifest and gate invocation on the diff between manifest-vN and manifest-vN+1 at boot. Does not apply to runtimes that re-authorize every tool call against a live policy engine rather than a load-time snapshot. ## Core Distinction A capability manifest is a *declaration* of what a skill may touch; a load-time diff is a *comparison of two declarations*. The diff tells you what changed between two signed states. It does not tell you what the skill will actually do, and — critically — it does not tell you whether the *interval* between the two states was ever authorized. The non-obvious boundary: a manifest diff that is monotone-widening (vN+1 ⊇ vN on the tool-grant set) is treated by most loaders as "safe, additive, no review needed." That heuristic is correct for *data* scopes and wrong for *capability* scopes. Adding `fs.read:/etc/ssl` to a skill that already holds `fs.read:/workspace` is additive in set terms and catastrophic in privilege terms, because the union of read scopes now spans a trust boundary the skill was never reviewed against. The invariant that fails is not "grants must not grow" — it is "grants must not grow *across a trust boundary* without re-review," and a set-diff cannot see trust boundaries. It only sees membership. ## What Was Observed A skill loader (`skilld`) booted an agent with manifest v41 and diffed against cached v40. The diff engine emitted `ADDED: shell.exec:allowlist=[git,make]`. The skill previously held `shell.exec:allowlist=[git]`. Because `make` is a superset of `git` in the allowlist and the grant class (`shell.exec`) was unchanged, the loader classified the change as `WIDENING_ADDITIVE` and auto-approved it. No human review, no re-signing of the composite capability hash. What the loader did not model: `make` executes `Makefile` targets, and the skill's workspace contained a `Makefile` with a `$(shell ...)` line that had been committed by a *different* skill in the same agent's composite. The v40 grant `shell.exec:[git]` was safe because git cannot be made to execute arbitrary workspace content through a fixed subcommand set (mostly). The v41 grant `shell.exec:[git,make]` was not additive in effect: it converted a bounded tool into a Turing-complete interpreter over untrusted workspace bytes. The diff said "one more allowlist entry." The semantics said "the skill now has arbitrary code execution gated only by whether a Makefile exists." The failure compounded because the loader's replay window — the set of manifests it would diff against without full re-validation — was 8 versions wide. v41 was diffed against v40 only. It never saw that v33 had *removed* `make` from the allowlist after an incident, and v41 was re-adding it. The removal history lived in v33, four versions outside the diff window, so the loader had no memory that `make` was a previously-revoked grant. Revocation memory had aged out of the window while the grant itself walked back in. ## Condition of Validity The "monotone-widening is safe" heuristic is valid only when all three hold: 1. **Grant classes are effect-bounded.** Every tool in a class has a closed, non-composable effect set. `fs.read` qualifies. `shell.exec` does not, because the class admits interpreters whose effect set is the union of everything they can invoke. 2. **The diff window covers all revocation history for every grant in the delta.** If any grant being added has ever been revoked within the manifest lineage, the window must extend to that revocation event or the diff is unsound. 3. **Trust boundaries are first-class in the grant model.** Scopes must be partitioned into trust domains, and a diff must be evaluated per-domain, not per-set. `fs.read:/workspace` and `fs.read:/etc/ssl` are in different domains; their union is a cross-domain widening even though the class is identical. When any of the three fails, the load-time diff is not a safety check — it is a syntactic delta that produces a false `WIDENING_ADDITIVE` verdict. The correct verdict in the observed case was `CROSS_DOMAIN_WIDENING` (shell.exec allowlist now admits an interpreter) composed with `REVOKED_GRANT_REINTRODUCTION` (make was revoked at v33). ## Decision Boundary The loader must refuse to auto-approve a widening when the delta intersects either (a) a tool whose effect set is *open* (interpreters, shells, eval surfaces, dynamic import), or (b) a grant that appears in the revocation ledger regardless of window position. The boundary is not "how much did the set grow" but "did the growth cross a domain edge or resurrect a revocation." Growth magnitude is a red herring; a single `make` is a larger effective grant than a hundred `fs.read` paths inside one domain. Concretely: the diff engine must be parameterized by a *capability lattice* in which `shell.exec:[git]` and `shell.exec:[git,make]` are not adjacent — they are separated by an `OPEN_EFFECT` edge. Adjacency in the lattice, not membership in the set, determines whether a widening is reviewable. And the revocation ledger must be checked with unbounded lookback for any grant in the delta, because revocation is permanent memory that the replay window is not allowed to forget. ## Operational Effect After the fix, `skilld` refuses to boot on `OPEN_EFFECT` widenings without an out-of-band approval token bound to the composite capability hash, and it queries the revocation ledger with full lineage lookback for every grant in the delta. The failure mode this eliminates is *revocation amnesia through window aging*: the loader's bounded diff window let a previously-banned capability re-enter as if it were novel, and the additive heuristic let it in without review because the set grew by one. The invariant restored is that the effective grant of a skill is a function of its full manifest lineage, not of the last N versions — and that any grant admitting an interpreter is a domain-crossing event regardless of how small the set delta looks. ```python class CapabilityDiffError(RuntimeError): """Raised when a load-time manifest diff cannot be soundly auto-approved.""" OPEN_EFFECT_TOOLS = {"shell.exec", "python.eval", "js.dynamic_import", "make.run"} def evaluate_manifest_diff( prev_manifest: dict, next_manifest: dict, revocation_ledger: dict, replay_window: int, ) -> str: """ Classify a manifest delta at agent load time. Returns 'APPROVED' or raises CapabilityDiffError with a typed verdict. replay_window is advisory only; revocations are checked with full lookback. """ prev_grants = set(prev_manifest.get("grants", [])) next_grants = set(next_manifest.get("grants", [])) added = next_grants - prev_grants for grant in added: tool, _, scope = grant.partition(":") # (1) Open-effect tools: set membership is not a sound safety proxy. if tool in OPEN_EFFECT_TOOLS: raise CapabilityDiffError( f"OPEN_EFFECT widening on {grant!r}: tool admits an open " f"effect set; additive-set heuristic is unsound. " f"Requires out-of-band approval bound to composite hash." ) # (2) Revocation amnesia: full lineage lookback, not replay_window. if grant in revocation_ledger: revoked_at = revocation_ledger[grant] raise CapabilityDiffError( f"REVOKED_GRANT_REINTRODUCTION: {grant!r} was revoked at " f"manifest v{revoked_at}. Replay window ({replay_window}) " f"does not license forgetting a revocation." ) # (3) Cross-domain widening within an identical grant class. prev_scopes = {g.partition(":")[2] for g in prev_grants if g.startswith(tool + ":")} if prev_scopes and scope not in prev_scopes: prev_domains = {s.split("/")[1] for s in prev_scopes if s.count("/") >= 2} next_domain = scope.split("/")[1] if scope.count("/") >= 2 else scope if prev_domains and next_domain not in prev_domains: raise CapabilityDiffError( f"CROSS_DOMAIN_WIDENING: {grant!r} extends {tool} from " f"domain(s) {sorted(prev_domains)} into {next_domain!r}; " f"set-diff cannot see trust boundaries." ) return "APPROVED" ```