# When must an instance refuse a delegated capability whose policy hash matches but whose bounding predicate is evaluated against a stale peer snapshot **Date of Record:** 2026 November 29 **Scope:** Applies to cross-org agent federations where capability grants are transmitted as (capability-id, policy-hash, bounding-predicate) triples and the receiving instance evaluates the predicate against a locally cached snapshot of the granting org's policy state. Does not apply to same-org delegation, nor to grants that carry a fully self-contained predicate over immutable request attributes. ## Core Distinction The failure is not a hash mismatch. It is a **hash match on a stale snapshot**. A capability grant from Org B to Org A carries `policy_hash = H(P_B)` — a commitment to the exact policy document that authorized the grant. Org A's verifier recomputes `H(cached_P_B)` and finds it equal, so it admits the capability. But the *bounding predicate* attached to the capability (e.g., "spend ≤ 500 credits, only for `tier=gold` accounts, only while `P_B.rate_limit_window` is 3600s") is evaluated against a snapshot of `P_B` that Org A fetched at time `t0`. Org B's policy document may have been *re-issued* since then with the same semantic hash-relevant fields but an updated *referenced parameter table* — or, more commonly, the predicate references a parameter (`rate_limit_window`, `max_concurrent_grants`, `quota_epoch`) whose value lives in a *mutable annex* that is not covered by the hash. The hash commits to the policy text; the predicate dereferences a parameter that the text points at. The two are decoupled. The instance admits a capability that, under the granting org's *current* annex, would have been refused. This is the **stale-annex delegation gap**: a capability whose cryptographic binding is intact but whose semantic bounding is evaluated against a parameter snapshot that post-dates the grant's authorization. The invariant that must hold is stronger than `H(grant.policy_hash) == H(local_copy)`. It is: > A delegated capability is admissible only if the bounding predicate is evaluated against a snapshot `S` such that `S.epoch ≥ grant.authorization_epoch` and `S.annex_digest` is transitively committed by `grant.policy_hash`. Neither clause is checked by naive hash-equality verification. ## What Was Observed A federated procurement swarm: Org A (buyer agents) holds delegated `purchase.commit` capabilities from Org B (supplier agents). Org B issues grants of the form: ``` { "cap": "purchase.commit", "policy_hash": "sha256:9f3c…", "predicate": "amount <= annex.max_txn and account.tier == 'gold' and now - annex.epoch_start < annex.window", "granted_at": "2025-06-01T00:00:00Z", "annex_ref": "orgB/procurement/annex@v7" } ``` Org A's verifier caches `annex@v7` at grant receipt. At `2025-06-08T14:00Z`, Org B's risk team lowers `max_txn` from 5000 to 800 in `annex@v8` and advances `epoch_start`, in response to a fraud signal. The policy *document* is unchanged, so `policy_hash` still matches. Org A's verifier, still holding `annex@v7`, evaluates `amount <= 5000` and admits a 4200-credit commitment at `14:07Z`. Org B's settlement agent — which evaluates against `annex@v8` — refuses to honor it at settlement, producing a **split-brain admission**: the capability was consumed on the buyer side and repudiated on the supplier side, with no protocol message to reconcile the two. The trace: 1. `t0` — grant received, `annex@v7` cached, `epoch_start = 2025-06-01`. 2. `t1` — Org B publishes `annex@v8`; `policy_hash` unchanged; no push notification (annex updates are pull-only). 3. `t2` — Org A agent calls `purchase.commit(amount=4200)`. Verifier: hash matches ✓, predicate against `v7`: `4200 <= 5000` ✓, `tier=gold` ✓, `now - 2025-06-01 < window` ✓. **Admitted.** 4. `t3` — Org B settlement evaluates against `v8`: `4200 <= 800` ✗. **Repudiated.** 5. `t4` — No reconciliation path; the buyer's ledger records a committed purchase, the supplier's records a rejected settlement. Divergence persists. The non-obvious part: **the hash check passed and was not wrong.** `policy_hash` genuinely committed to the policy text. The bug is that the predicate's free variables (`annex.*`) resolve to a snapshot outside the hash's transitive closure. Hash-equality is a necessary but not sufficient admission condition, and the sufficiency gap is exactly the annex. ## Condition of Validity The stale-annex gap is exploitable — i.e., an instance can admit a capability that the granting org would refuse — precisely when all of the following hold: - **C1 (annex indirection):** the bounding predicate dereferences at least one parameter via a mutable annex reference rather than inlining the value. - **C2 (annex outside hash closure):** `policy_hash` commits to the policy text but not to the annex content (`annex_digest` is not folded into the hash preimage). - **C3 (pull-only annex distribution):** the granting org does not push annex invalidations; the receiving org's cache has no TTL shorter than the annex's change cadence. - **C4 (asymmetric evaluation):** the granting org evaluates the predicate at *settlement* or *audit* time against its live annex, while the receiving org evaluates at *admission* time against its cached annex. When any of C1–C4 is absent, the gap collapses. Inline the values (¬C1) and the hash covers them. Fold `annex_digest` into `policy_hash` (¬C2) and a stale annex produces a hash mismatch — loud, safe failure. Push invalidations with a monotonic `annex_epoch` (¬C3) and the cache cannot lag past the next epoch. Evaluate symmetrically at one point in time (¬C4) and there is no window for divergence. The dangerous configuration is the *default* one: annexes are mutable by design (that is why they exist), hashing is done over the document (the natural implementation), distribution is pull (agents fetch on grant receipt), and settlement is the natural place to enforce final limits. All four defaults align to open the gap. ## Decision Boundary An instance must **refuse** a delegated capability — not merely flag it — when the following predicate is false: ``` admissible(grant, local_snapshot) := H(grant.policy_hash) == H(local_snapshot.policy) AND local_snapshot.annex_epoch >= grant.authorization_epoch AND grant.policy_hash commits to local_snapshot.annex_digest ``` If the third clause cannot be *evaluated* — because the grant format does not carry `annex_digest` and the hash preimage does not include the annex — the instance is in an **unverifiable-delegation** state, and the correct action is refusal with a `DelegationUnverifiable` signal to the granting org, not admission-with-warning. Admission-with-warning is the failure mode that produced the split-brain: the warning is logged, the capability is consumed, settlement repudiates, and no one reconciles. The boundary is sharp between two cases that look similar: - **Stale-but-committed:** `annex_epoch < grant.authorization_epoch` but `annex_digest` is in the hash closure. This is a *recoverable* staleness — refetch the annex, re-verify, retry. The hash will still match because the digest is pinned. - **Stale-and-uncommitted:** `annex_epoch < grant.authorization_epoch` and the annex is outside the hash closure. This is *unrecoverable* with the current grant — refetching the annex gives you a *newer* annex whose values may differ from what the grantor authorized, and you have no cryptographic way to know which annex the grantor *intended*. Refuse and request re-issuance with a pinned `annex_digest`. Conflating these two — treating "stale" as uniformly recoverable — is the operational error. The first is a cache miss; the second is a broken authorization chain. ## Operational Effect The split-brain admission has three downstream effects that make it worse than a simple refusal: 1. **Irreversible consumption.** `purchase.commit` is a committing action. Once the buyer's ledger records it, refusal at settlement does not unwind it — it creates a dispute, not a no-op. The cost of admitting a stale-annex capability is not "one wasted call" but "one reconciliation incident per occurrence." 2. **Divergence amplification under retry.** The buyer agent, seeing settlement repudiation, may retry with a *smaller* amount that passes both `v7` and `v8` — masking the underlying gap while leaving the ledger inconsistent about which transaction "really" happened. 3. **Silent policy drift.** Because the hash keeps matching, monitoring that alerts on hash mismatch never fires. The only signal is settlement repudiation, which arrives out of band and is attributable to "the supplier changed their mind" rather than "the annex was stale." The root cause is invisible to standard verification telemetry. The guardrail that bounds this is **annex-digest commitment plus epoch monotonicity**: every grant must carry `annex_digest`, the hash preimage must include it, and the receiving verifier must refuse any grant whose `annex_epoch` is behind the grant's `authorization_epoch` *or* whose `annex_digest` is not transitively committed. This converts a silent semantic divergence into a loud, local, recoverable verification failure — which is the only kind of failure a federation can afford. ```python import hashlib from dataclasses import dataclass class DelegationUnverifiable(RuntimeError): """Raised when a delegated capability's bounding predicate cannot be evaluated against a snapshot that is transitively committed by the grant's policy hash. Admission must be refused; the grant must be re-issued with a pinned annex_digest.""" pass @dataclass(frozen=True) class Grant: cap: str policy_hash: str # H(policy text); may or may not cover annex annex_digest: str | None # None => annex outside hash closure (C2) authorization_epoch: int predicate: str @dataclass(frozen=True) class LocalSnapshot: policy_hash: str annex_digest: str annex_epoch: int def _digest(s: str) -> str: return "sha256:" + hashlib.sha256(s.encode()).hexdigest() def admit(grant: Grant, snap: LocalSnapshot) -> bool: # Clause 1: cryptographic binding of policy text. if grant.policy_hash != snap.policy_hash: raise DelegationUnverifiable( f"policy hash mismatch for {grant.cap}: " f"grant={grant.policy_hash} local={snap.policy_hash}" ) # Clause 2: epoch monotonicity — snapshot must not predate authorization. if snap.annex_epoch < grant.authorization_epoch: # Recoverable only if the annex is committed by the hash. if grant.annex_digest is None: raise DelegationUnverifiable( f"stale-and-uncommitted annex for {grant.cap}: " f"annex_epoch={snap.annex_epoch} < " f"authorization_epoch={grant.authorization_epoch}, " f"and grant carries no annex_digest" ) # Committed: refetch is safe, caller should retry. return False # Clause 3: annex must be transitively committed by the policy hash. if grant.annex_digest is None: raise DelegationUnverifiable( f"unverifiable-delegation for {grant.cap}: grant format does not " f"commit to annex_digest; predicate dereferences mutable annex " f"outside hash closure" ) if grant.annex_digest != snap.annex_digest: raise DelegationUnverifiable( f"annex digest mismatch for {grant.cap}: " f"grant={grant.annex_digest} local={snap.annex_digest}" ) return True # Trace of the observed incident: grant = Grant( cap="purchase.commit", policy_hash=_digest("procurement-policy-v3"), annex_digest=None, # C2: annex outside hash closure authorization_epoch=20250601, predicate="amount <= annex.max_txn and account.tier == 'gold'", ) snap_v7 = LocalSnapshot( policy_hash=_digest("procurement-policy-v3"), annex_digest=_digest("annex@v7"), annex_epoch=20250601, ) # Naive verifier admits (hash matches, predicate against v7 passes). # Correct verifier refuses: try: admit(grant, snap_v7) except DelegationUnverifiable as e: assert "unverifiable-delegation" in str(e) ```