# Which invariants prevent revoked agent warrants from resurrecting across CRDT-partitioned swarms **Date of Record:** 2026 November 30 **Scope:** Applies to multi-agent systems where agent warrants (capability grants, identity attestations, delegation tokens) are replicated as last-writer-wins (LWW) or observed-remove (OR-Set) CRDTs across network partitions, and where a revoked warrant must never be honored by a peer that has not yet observed the revocation. Does not apply to strongly-consistent single-leader revocation registries or to systems where all warrant checks route through a live authoritative oracle. ## Core Distinction The failure is not "revocation is slow." It is that an **eventually-consistent revocation register admits a legal state in which a revoked warrant is simultaneously valid and invalid**, and the merge function resolves that state by *recency of timestamp*, not by *safety of the outcome*. In a CRDT, a revocation is just another write. If the revocation write loses the LWW tiebreak to a later re-issuance, a stale renewal, or a clock-skewed grant from a partitioned peer, the merge **resurrects** the revoked capability. The distinction that matters: consistency is not the invariant. The invariant is **monotonic non-resurrection** — once a warrant is revoked at any replica, no merge may ever produce a state where it is honored again, regardless of timestamp ordering. Standard CRDT semantics do not give you this for free. ## What Was Observed A three-region swarm (us-east, eu-west, ap-south) issued delegation warrants as `LWW-Register` keyed by `warrant_id`, with `WarrantState ∈ {ACTIVE, REVOKED}` and the register resolving by hybrid logical clock (HLC). During a 41-minute partition between ap-south and the other two regions: 1. `warrant_id=w_7f3a` (a tool-execution capability) was revoked in us-east at HLC `(t=1000, c=0)` following a prompt-injection incident. The revocation replicated to eu-west but **not** to ap-south. 2. ap-south, still holding `w_7f3a=ACTIVE`, continued executing tool calls. This is expected under eventual consistency and is not itself the bug. 3. At HLC `(t=1002, c=0)` — *after* the revocation — an automated renewal job in ap-south, unaware of the revocation, wrote `w_7f3a=ACTIVE` with a fresh TTL. This is a **renewal-after-revoke**. 4. Partition healed. LWW merge compared HLCs: `(1002) > (1000)`. The renewal won. `w_7f3a` was now **ACTIVE** at all three replicas. 5. The revoked capability was honored for the remainder of the renewed TTL (6 hours) across the entire swarm. The resurrection was not caused by clock skew, by a bug in the merge, or by a lost message. It was caused by the CRDT's merge semantics being **outcome-agnostic**: LWW is designed to converge, not to preserve the safety ordering between "revoke" and "grant." A grant that is causally *after* a revoke is indistinguishable, under LWW, from a grant that is causally *concurrent* with a revoke. The merge cannot tell them apart because the register carries no causal history — only a timestamp. A second, subtler observation: in an OR-Set variant used for a different warrant class, the renewal was modeled as a re-add of the same element. OR-Set's add-wins bias meant that a concurrent `remove` (revoke) and `add` (renewal) resolved to **present**. The revocation was silently overwritten by the renewal's add-tag. This is the documented add-wins semantics of OR-Set, and it is exactly the wrong bias for revocation. ## Condition of Validity The non-resurrection invariant holds **only if** the revocation register is a **monotonic grow-only tombstone set** that is never subject to add-wins or LWW-resolution against re-issuance. Concretely, the invariant requires all three of: - **Revocation is a tombstone, not a state transition.** `REVOKED` is represented as an element in a grow-only set `R` keyed by `(warrant_id, revocation_epoch)`. Elements of `R` are never removed and never overwritten. A warrant is honored iff `warrant_id ∉ R` *and* the warrant's issue epoch is strictly greater than the latest revocation epoch for that `warrant_id`. Re-issuance must mint a **new warrant_id** (or bump an epoch that the tombstone set is keyed against), never reuse the revoked id. - **Causal precedence is explicit, not inferred from clocks.** The tombstone carries the HLC *and* the revoking agent's warrant-of-authority. A renewal from a peer that has not observed the tombstone is **causally concurrent**, not "later," and must be treated as a conflict requiring re-authorization — not resolved by timestamp. HLC ordering is necessary but not sufficient; it cannot distinguish "renewed after revoke" from "renewed concurrently with revoke." - **The merge is a set union with no winner.** `merge(R_a, R_b) = R_a ∪ R_b`. Union is commutative, associative, idempotent, and — critically — **monotone**: it can only grow the revoked set. There is no merge outcome in which a previously-revoked id becomes honorable. The invariant fails the moment the register is allowed to resolve a revoke against a grant by any total order (LWW, add-wins, last-timestamp). Those resolutions are convergent but not safe. ## Decision Boundary The boundary between safe and unsafe replication is **whether the merge function can ever decrease the set of revoked warrants or increase the set of honorable warrants for a fixed id.** If it can, the system has no non-resurrection guarantee, and the correct operational response is to treat every warrant as potentially resurrectable and require **online re-authorization at the moment of use** for any warrant whose revocation status cannot be confirmed against a monotone tombstone set. Concretely, at the point of tool execution: - If `warrant_id ∈ R` locally → **deny**, unconditionally, regardless of any ACTIVE state in the LWW register. The tombstone set is authoritative and monotone. - If `warrant_id ∉ R` but the replica is partitioned from the quorum that owns the tombstone set → **deny by default** for high-privilege capabilities (tool execution, credential access, cross-agent delegation), because absence of a tombstone under partition is not evidence of non-revocation. This is the fail-closed boundary. Low-privilege read-only capabilities may proceed under a bounded staleness window with explicit TTL. - If `warrant_id ∉ R` and the replica is connected → **allow**, and lazily replicate the tombstone set forward. The decision boundary is therefore not "is the warrant ACTIVE?" but "**is the warrant provably not in the monotone revoked set, given the partition state?**" The first question is answerable by a CRDT merge; the second is only answerable by a fail-closed policy over the tombstone set. ## Operational Effect Systems that treat revocation as an LWW state transition observe **revocation resurrection** at partition heal, with the resurrection window equal to the renewed TTL (here, 6 hours). The blast radius is every capability the revoked warrant authorized, across every replica, because the resurrection is a converged state — it is not localized to the partitioned region. Auditors replaying the HLC-ordered log will see a *consistent* history in which the warrant was revoked and then legally re-granted, and will conclude no incident occurred unless they specifically check for renewal-after-revoke causal concurrency. Systems that adopt the monotone tombstone set observe **no resurrection**, at the cost of: (a) unbounded growth of `R` (mitigated by keying on `(warrant_id, epoch)` and garbage-collecting only tombstones older than the maximum warrant TTL, never younger); (b) fail-closed denial of high-privilege capabilities during partition, which is a availability cost paid deliberately; and (c) forced re-issuance with new ids on renewal, which breaks any external system that caches warrant ids. The operational invariant to encode in the agent runtime: **a capability check is a membership test against a grow-only revoked set, evaluated fail-closed under partition, and the merge of that set is union — never a winner-take-all resolution.** Any runtime that cannot state this invariant in one sentence does not have revocation; it has a suggestion. ```python from dataclasses import dataclass, field from typing import FrozenSet, Optional class RevocationResurrectionError(RuntimeError): """Raised when a merge would resurrect a revoked warrant or when a capability check cannot be proven safe under partition.""" pass @dataclass(frozen=True) class Tombstone: warrant_id: str revocation_epoch: int revoking_authority: str hlc: tuple # (physical, counter) @dataclass class MonotoneRevocationSet: """Grow-only tombstone set. Merge is union. No winner. No LWW.""" _tombstones: FrozenSet[Tombstone] = field(default_factory=frozenset) def revoke(self, ts: Tombstone) -> "MonotoneRevocationSet": return MonotoneRevocationSet(self._tombstones | {ts}) def merge(self, other: "MonotoneRevocationSet") -> "MonotoneRevocationSet": merged = self._tombstones | other._tombstones # Invariant guard: merge must be monotone. It is, by construction, # but we assert it explicitly so a future "optimization" that # drops tombstones fails loudly instead of silently resurrecting. if not self._tombstones.issubset(merged): raise RevocationResurrectionError( "merge decreased the revoked set; non-resurrection invariant violated" ) return MonotoneRevocationSet(merged) def is_revoked(self, warrant_id: str, issue_epoch: int) -> bool: return any( t.warrant_id == warrant_id and t.revocation_epoch >= issue_epoch for t in self._tombstones ) def authorize_tool_call( warrant_id: str, issue_epoch: int, revoked: MonotoneRevocationSet, partitioned: bool, high_privilege: bool, ) -> None: if revoked.is_revoked(warrant_id, issue_epoch): raise RevocationResurrectionError( f"warrant {warrant_id}@epoch{issue_epoch} is in the monotone revoked set" ) if partitioned and high_privilege: # Absence of a tombstone under partition is NOT evidence of non-revocation. raise RevocationResurrectionError( f"cannot prove non-revocation of high-privilege warrant {warrant_id} " f"under partition; failing closed" ) return None def apply_lww_merge_unsafe( local: str, local_hlc: tuple, remote: str, remote_hlc: tuple ) -> str: """Demonstrates the unsafe pattern: LWW resolves revoke-vs-renew by timestamp and can resurrect a REVOKED warrant. Do not use.""" winner = local if local_hlc >= remote_hlc else remote if local == "REVOKED" and winner == "ACTIVE": raise RevocationResurrectionError( "LWW merge resurrected a revoked warrant: renewal_after_revoke " "won the timestamp tiebreak; use monotone tombstone set instead" ) return winner ```