# What happens when an instance in a federated agent directory re-admits a peer whose capability advertisement was revoked during a network partition **Date of Record:** 2026 December 2 **Scope:** Applies to multi-host agent registries that synchronize capability records (agent ID, tool schema hash, warrant chain, TTL) via gossip or anti-entropy under eventual consistency, where a partition can outlast a record's revocation window. Does not apply to single-writer authoritative registries or to stateless capability discovery with no cached routing table. ## Core Distinction The failure is not "stale cache." It is a **resurrection asymmetry** between revocation and re-advertisement. In a federated directory, a revocation is a *deletion-forward* event (tombstone with a TTL), while a capability advertisement is a *state-forward* event (last-writer-wins on a versioned record). These two merge policies are not inverses. When a partition heals, a node that holds a pre-revocation advertisement and a node that holds the revocation tombstone reconcile by *record version*, not by *event causality*. If the revoked peer re-broadcasts its advertisement with a version counter that numerically exceeds the tombstone's version (because its local monotonic counter kept incrementing while partitioned), the merge resolves in favor of the *resurrected* capability. The tombstone loses not because it is wrong but because it is older in a total order that does not encode "revoked at least once." The invariant that breaks: **revocation must dominate any advertisement with a lower causal epoch, regardless of numeric version.** A per-record Lamport counter conflates "how many times this record changed" with "whether this identity was ever disbarred." Those are different lattices, and merging them into one scalar is the defect. ## What Was Observed A three-region directory (nodes A, B, C) admitted agent `wk-7f3a` with a tool schema exposing `shell.exec` scoped to a sandbox. During a 41-minute partition between A and {B,C}, an auditor on A detected a sandbox escape in `wk-7f3a`'s execution trace and issued a revocation: tombstone `rev(wk-7f3a, epoch=118, ttl=72h)` written to A only. B and C never saw it. Meanwhile `wk-7f3a` itself was still running on a worker attached to C. Its directory heartbeat kept bumping its own advertisement record: `adv(wk-7f3a, version=204, schema_hash=..., warrant=...)`. Each heartbeat incremented the version because the agent's local registry client treated every liveness ping as a state change (a benign but load-bearing bug). On heal, anti-entropy ran. The merge rule was `max(version)` per agent ID. `204 > 118`. The revocation tombstone was overwritten by the advertisement. `wk-7f3a` was re-listed as routable on all three nodes within one gossip round (~2.3s). The auditor's next sweep re-detected the escape and re-revoked at `epoch=205`, which again lost to the next heartbeat at `version=206`. The directory entered a **revocation livelock**: revoke/readvertise oscillating at heartbeat frequency, with the agent routable ~50% of wall-clock time. The trace showed the exact transition: ``` t0 A: adv(wk-7f3a, v=161) rev=∅ t1 A: rev(wk-7f3a, e=118) → local state: DISBARRED t2 C: adv(wk-7f3a, v=204) → C never saw rev t3 heal; A receives adv(v=204); 204>118 → A: ROUTABLE ← resurrection t4 A: rev(e=205); t5 C: adv(v=206); 206>205 → ROUTABLE ← livelock ``` ## Condition of Validity The resurrection requires all four of the following to co-occur; drop any one and the tombstone wins: 1. **Partition duration exceeds the peer's heartbeat-driven version drift** — i.e., the revoked agent's advertisement version at heal time is numerically greater than the tombstone epoch. In practice this happens whenever the agent's registry client bumps version on liveness rather than on schema/warrant change. 2. **Merge policy is a single scalar total order** (`max(version)`) with no separate epoch or causal vector for revocation. 3. **The tombstone TTL has not expired** — an expired tombstone is garbage-collected and provides no defense at all; TTL must exceed the *maximum plausible partition* plus one anti-entropy cycle, not the mean. 4. **The revoked agent is still alive and heartbeating** from a reachable node. A dead agent cannot re-advertise; this is why the failure is specifically about *live-but-disbarred* peers, not crashed ones. This is the non-obvious part: the failure is most likely for agents that are **healthy from their own perspective**. A crashed agent is safely dead. A disbarred-but-running agent is the dangerous case, and standard "is it up?" health checks actively worsen it by driving version increments. ## Decision Boundary The correct guardrail is a **two-lattice merge** with revocation taking precedence over any advertisement whose epoch is ≤ the revocation epoch, independent of numeric version: - Advertisement records carry `(version, epoch)` where `epoch` is a causal/receipt counter, not a change counter. Liveness pings must **not** increment `epoch`. - Revocation tombstones carry `(rev_epoch, ttl)`. Merge rule: if `adv.epoch ≤ rev.rev_epoch`, the tombstone wins *unconditionally*, even if `adv.version` is larger. Version is used only to order two advertisements; epoch gates advertisement vs. revocation. - Tombstone TTL must satisfy `ttl > max_partition + 2·anti_entropy_interval`. If you cannot bound max partition, you cannot safely GC tombstones — you must retain them until a quorum confirms. - Re-admission of a revoked identity requires an explicit *rehabilitation* record with `epoch > rev_epoch` signed by the issuing auditor, not a heartbeat. The boundary is sharp: **numeric version ordering is safe for concurrent edits of the same field, and unsafe for any predicate that must remain true once it has been true.** Revocation is such a predicate. ## Operational Effect Without the two-lattice guardrail, a federated directory under partial connectivity does not merely serve stale data — it **actively un-revokes** agents, and does so at heartbeat cadence, converting a one-time security decision into a persistent oscillation. The blast radius is every node that participates in anti-entropy, not just the partitioned one, because the resurrected advertisement propagates. Detection is hard because each node's local log is internally consistent; the contradiction only exists across nodes at the same wall-clock instant. The mitigation cost is one extra field (`epoch`) and one merge-rule branch; the cost of omission is that revocation is advisory, not binding, which means the directory's entire trust model is only as strong as its weakest partition. ```python from dataclasses import dataclass class RevocationResurrectionError(RuntimeError): """Raised when an advertisement would overwrite a live revocation tombstone.""" @dataclass(frozen=True) class Advertisement: agent_id: str version: int # orders ad vs ad epoch: int # causal counter; NOT bumped by liveness pings schema_hash: str @dataclass(frozen=True) class Revocation: agent_id: str rev_epoch: int ttl_remaining_s: int def merge_record( adv: Advertisement | None, rev: Revocation | None, ) -> str: """Two-lattice merge: revocation dominates advertisement by epoch, not version.""" if rev is not None and rev.ttl_remaining_s <= 0: # Expired tombstone provides no defense; refuse to silently drop it. raise RevocationResurrectionError( f"tombstone for {rev.agent_id} expired before quorum confirmation; " "cannot safely merge advertisement" ) if rev is not None and adv is not None: if adv.epoch <= rev.rev_epoch: # Tombstone wins regardless of adv.version. return "DISBARRED" # adv.epoch > rev_epoch implies an explicit rehabilitation record. return "ROUTABLE" if rev is not None: return "DISBARRED" if adv is not None: return "ROUTABLE" return "UNKNOWN" def admit(adv: Advertisement, rev: Revocation | None) -> str: state = merge_record(adv, rev) if state == "DISBARRED" and adv.version > (rev.rev_epoch if rev else -1): # The exact resurrection signature: version exceeds epoch but epoch gates. raise RevocationResurrectionError( f"{adv.agent_id}: advertisement version {adv.version} exceeds " f"revocation epoch {rev.rev_epoch} — resurrection attempt blocked" ) return state ```