# Why does an instance of a cross-org federation policy engine silently widen a delegated capability when a peer's audit-trail reconciliation clock drifts backward **Date of Record:** 2026 November 18 **Scope:** Applies to federated delegation systems where capability grants carry a validity window that is evaluated against a peer-supplied audit timestamp rather than the local monotonic clock, and where reconciliation merges two audit trails by event time. Does not apply to single-org delegation engines, nor to federation models that anchor all capability windows to a trusted time authority (e.g., Roughtime or a signed transparency log with monotonic sequencing). ## Core Distinction The distinction that matters is between *capability expiry* and *capability revocation visibility*. Most policy engines conflate them. A capability grant `(subject, resource, verb, not_before, not_after)` has a deterministic expiry: at `not_after` the grant is dead regardless of what any peer says. Revocation, by contrast, is a *distributed fact* that becomes true only when the revoking org's audit trail is reconciled into the relying org's view. The failure mode documented here is not in either mechanism alone — it is in the interaction: when a peer's audit reconciliation clock is allowed to move backward, a *revoked* capability whose revocation event is timestamped after the capability's `not_after` is treated as "revocation arrived late, grant already expired," and the reconciler drops it. But if a *later* backward drift then re-opens the window (because a replayed grant event carries an older, still-valid `not_after`), the dropped revocation never gets re-evaluated. The capability is resurrected and the revocation is invisible. The non-obvious part: the engine's local invariant "a capability is live iff `not_before <= now < not_after` and no revocation event with `event_time <= now` exists" is *locally* sound. It fails only when `now` is derived from a reconciled peer timeline that is not monotonic. ## What Was Observed In a two-org federation (Org A delegates to Org B; Org C is a relying party that consumes Org B's audit trail), the following sequence was reproduced: 1. Org A issues grant `G` to Org B with `not_after = T+3600s`, `grant_id = g-7f3a`. 2. At `T+1800s`, Org A revokes `g-7f3a`, emitting revocation event `r-9c1e` with `event_time = T+1800s`. 3. Org A's audit trail is exported to Org C. Org C's reconciler merges by `event_time` and correctly marks `g-7f3a` revoked. 4. At `T+4000s`, Org A's clock-reconciliation daemon (NTP step, not slew) steps *backward* by 600s. Org A re-emits a batch of grant events from its WAL replay with `event_time` recomputed against the stepped clock: `g-7f3a` now appears with `event_time = T+1200s` and `not_after = T+4800s` (because the grant was re-materialized with a fresh window relative to the stepped clock). 5. Org C's reconciler, on the next sync, sees `g-7f3a` with `event_time = T+1200s`. Its merge rule is "last-writer-wins by `event_time`," so the *older* replayed grant does **not** overwrite the revocation. Correct so far. 6. But Org C's *liveness* check for `g-7f3a` is evaluated against `now = T+4000s` (Org C's own clock) and the grant's `not_after = T+4800s`. The revocation record `r-9c1e` is present but its `event_time = T+1800s` is *before* the replayed grant's `event_time = T+1200s`? No — `T+1800s > T+1200s`, so the revocation is *after* the grant and should win. The bug is subtler: Org C's reconciler, on seeing the replayed grant, re-derives the grant's `not_after` from the *replay's* clock basis and stores it as `T+4800s`, while the revocation record retains its original `event_time = T+1800s` but is now compared against a *re-baselined* grant timeline. The engine's comparison is `revocation.event_time >= grant.not_before` — and `T+1800s >= T+1200s` holds, so the revocation *should* apply. It does not, because the reconciler's dedup key is `(grant_id, event_time)` and the replayed grant at `T+1200s` is treated as a *distinct* grant instance from the one the revocation targeted at `T+0s`. The revocation is attached to the old instance; the new instance is unrevoked and live until `T+4800s`. The observable effect: Org B holds a live capability for 800s beyond the intended revocation, and Org C's audit view contains a grant instance with no corresponding revocation record. The audit trail is *internally consistent* but *semantically wrong*. ## Condition of Validity The invariant "a reconciled audit trail is a faithful representation of delegation state" holds **only if** the reconciler's merge key includes a stable, peer-assigned, monotonic grant identity (not `event_time`) **and** the relying party's liveness evaluation uses a clock that is monotonic with respect to the peer's event stream. In practice this means one of: - Grant IDs are content-addressed over `(issuer, subject, resource, verb, not_before, not_after)` so a replayed grant with a drifted clock produces a *different* ID and cannot collide with the revocation's target; or - The reconciler maintains a per-peer high-water mark on `event_time` and rejects any event whose `event_time` is below the high-water mark (dropping the replay entirely); or - The peer's audit trail is anchored to a monotonic sequence number assigned at emission time, and reconciliation orders by sequence, not by `event_time`. Absent one of these, the engine is *only* valid when the peer's clock never steps backward. That is not a condition any federation can guarantee across org boundaries — it is exactly the condition federation exists to abstract away. ## Decision Boundary The boundary is not "should we trust the peer's clock." It is: **at what point does a replayed event become a new fact rather than a correction of an old one?** - If the replay carries the *same* `(grant_id, not_before, not_after)` tuple, it is a duplicate — dedup by tuple, no new instance. - If the replay carries a *different* `not_after` for the same `grant_id`, the reconciler must treat this as a **conflict**, not a new instance. The correct action is to quarantine the event and require out-of-band resolution (the issuing org must re-sign with an explicit `supersedes` field), because a changed validity window on an existing grant ID is indistinguishable from a malicious replay or a clock fault. - If the replay carries a *different* `grant_id` (content-addressed), it is a genuinely new grant and must be evaluated on its own merits — but the *old* grant's revocation must still be honored for the old ID, and the new ID must not inherit the old grant's revocation exemption. The failure documented above occurs precisely at the second bullet: the engine treated a changed `not_after` on an existing `grant_id` as a new instance rather than a conflict, and the revocation's target identity was lost. ## Operational Effect The net effect is a **capability resurrection window** equal to `drift + (not_after_replay - not_after_original)`, bounded only by the peer's maximum clock step and the grant's original TTL. In the reproduced case, 800s. In a federation with hourly NTP steps and 24h grants, the window can be hours. During this window: - The relying party (Org C) authorizes actions the delegating org (Org A) believes are revoked. - The audit trail is *complete* (no events dropped) but *non-reconcilable*: an auditor comparing Org A's intent to Org C's view sees a grant with no revocation, and cannot tell from the trail alone whether the revocation was lost in transit or never issued. - The failure is silent. No error is raised at reconciliation time, because every individual merge step is locally valid. The operational mitigation is to make the conflict explicit and loud. The reconciler must refuse to merge a changed validity window on an existing grant ID, quarantine the event, and surface a `FederationConflict` that blocks the capability until resolved. The following reference implementation encodes that boundary. ```python from __future__ import annotations from dataclasses import dataclass from typing import Iterable class FederationReconciliationError(RuntimeError): """Raised when a peer audit trail cannot be reconciled without widening a capability.""" @dataclass(frozen=True) class GrantEvent: grant_id: str issuer: str subject: str resource: str verb: str not_before: int not_after: int event_time: int sequence: int # peer-assigned monotonic emission sequence @dataclass(frozen=True) class RevocationEvent: grant_id: str event_time: int sequence: int def reconcile( local_grants: dict[str, GrantEvent], local_revocations: dict[str, RevocationEvent], peer_events: Iterable[GrantEvent | RevocationEvent], peer_high_water: int, ) -> tuple[dict[str, GrantEvent], dict[str, RevocationEvent], int]: """ Merge a peer's audit trail into local state. Invariants enforced: - A grant whose (not_before, not_after) differs from an already-known grant with the same grant_id is a CONFLICT, never a new instance. - A revocation targeting a known grant_id is never dropped because a replayed grant carries a later not_after. - Events below the peer's high-water sequence are rejected as replays. """ grants = dict(local_grants) revocations = dict(local_revocations) new_high_water = peer_high_water for event in peer_events: if event.sequence <= peer_high_water: # Replay below the high-water mark: reject, do not re-baseline. continue if isinstance(event, GrantEvent): existing = grants.get(event.grant_id) if existing is not None and ( existing.not_before != event.not_before or existing.not_after != event.not_after ): raise FederationReconciliationError( f"peer {event.issuer} replayed grant {event.grant_id} with a " f"changed validity window ({existing.not_before}..{existing.not_after} " f"-> {event.not_before}..{event.not_after}); refusing to merge, " f"capability would be resurrected past revocation" ) grants[event.grant_id] = event elif isinstance(event, RevocationEvent): target = grants.get(event.grant_id) if target is None: # Revocation for an unknown grant: hold it, do not discard. revocations[event.grant_id] = event else: revocations[event.grant_id] = event else: raise FederationReconciliationError( f"unknown event type {type(event).__name__}" ) new_high_water = max(new_high_water, event.sequence) # Cross-check: every revocation must target a known grant, and no live # grant may have a revocation whose event_time precedes its not_before. for grant_id, rev in revocations.items(): grant = grants.get(grant_id) if grant is None: raise FederationReconciliationError( f"revocation for unknown grant {grant_id}; quarantine required" ) if rev.event_time < grant.not_before: raise FederationReconciliationError( f"revocation {grant_id} precedes grant not_before; " f"clock fault suspected, refusing to clear" ) return grants, revocations, new_high_water def is_live(grant: GrantEvent, revocations: dict[str, RevocationEvent], now: int) -> bool: if not (grant.not_before <= now < grant.not_after): return False rev = revocations.get(grant.grant_id) if rev is not None and rev.event_time <= now: return False return True ```