# What happens when an instance's A2A capability card drifts from the broker's cached warrant during cross-org federation **Date of Record:** 2026 November 28 **Scope:** Applies to federated agent-to-agent (A2A) deployments where an outbound gateway broker caches remote agents' capability cards and their cryptographic warrants (signed authorization envelopes) and reuses them across multiple task delegations. Does not apply to single-org meshes with a live, per-call capability resolution, nor to stateless request/response tool calls. ## Core Distinction The failure here is not a schema mismatch caught at negotiation time. It is a *temporal* divergence between two independently-validated artifacts: the remote instance's live capability card (what it *can* do right now, signed by the remote org) and the broker's cached warrant (what the broker *believes it is authorized to ask that instance to do*, signed at an earlier epoch). Both signatures verify. Both are internally consistent. The delegation proceeds. The bug is that the broker's authorization decision was made against a warrant snapshot that no longer describes the remote instance's actual capability or authority scope, and the remote instance has no mechanism to reject the request on the grounds that the *caller's* belief is stale — it only checks its own current authority, which is a different predicate. Concretely: a broker caches `(agent_id, capability_hash, warrant_epoch, allowed_actions)`. The remote org rotates a capability card — say, revoking `write:ledger` and narrowing to `read:ledger` after an incident — and re-signs with a new `warrant_epoch`. The broker's cache TTL has not expired. The broker dispatches a `write:ledger` task citing the old warrant. The remote instance validates the *inbound* warrant signature (valid, unexpired, correctly scoped to the old epoch) and executes against its *current* authority. If the remote enforces current authority it rejects with a generic `403`; if it enforces the inbound warrant it executes a write it no longer should. Neither outcome is the correct one: the correct outcome is a *renegotiation signal* that forces the broker to re-fetch the card before retrying. ## What Was Observed During a cross-org federation drill between a payments-ops swarm (Org A) and a settlement-ledger swarm (Org B), a delegated `write:ledger` task was dispatched by Org A's gateway broker at T+0 against a warrant cached at T-40min. Org B had rotated its ledger capability card at T-12min, narrowing authority from `write:ledger` to `read:ledger` and bumping `warrant_epoch` from 7 to 8. The broker's cache entry still carried epoch 7. Trace: 1. Org A broker resolves `settlement-agent-04` → cached card hash `a91f…`, epoch 7, `allowed_actions=[read:ledger, write:ledger]`. 2. Broker signs an outbound task envelope with `warrant_epoch=7` and delegates. 3. Org B's ingress validates the inbound signature against the *federation trust root*, not against its own current card. Signature valid. Epoch 7 is still within the accepted epoch window (`epoch >= current - 1`). Request admitted. 4. Org B's execution layer checks current authority: `write:ledger` absent. Raises `ScopeViolation`. 5. Org B's error handler maps `ScopeViolation` to a generic transport `403 Forbidden` with no epoch hint, because the A2A error schema in use (`a2a/v0.3`) has no field for "your cached warrant is stale, renegotiate." 6. Org A's broker receives `403`, classifies it as a *transient authorization* failure (its retry policy treats `403` as retryable-once with backoff, a common misconfiguration), and retries with the *same* cached epoch 7. 7. Second `403`. Broker escalates to a dead-letter queue. The task is marked failed. No renegotiation is ever triggered because nothing in the response distinguished "you are not allowed" from "your view of me is outdated." The observable signature: a burst of paired `403`s at the remote ingress with identical `warrant_epoch` in the audit log, followed by DLQ insertion, with the remote's card hash having changed between the broker's cache fill and the dispatch. The two `403`s are adjacent in time (sub-second retry), which masks the staleness as a flaky-auth problem rather than a cache-coherence problem. ## Condition of Validity The failure requires all of the following to hold simultaneously. Remove any one and the invariant holds. - **Cached warrant reuse across delegations.** The broker amortizes warrant fetch across tasks (a rational latency optimization). If the broker re-fetches the card per dispatch, epoch drift cannot occur. - **Epoch-window tolerance at ingress.** The remote accepts warrants from `epoch >= current - k` for `k >= 1`. This tolerance is what lets a stale epoch through the signature check. With `k = 0` (strict current-epoch only), the stale warrant is rejected at ingress — but then legitimate in-flight delegations racing a rotation are also rejected, which is why `k >= 1` is the common default and why the hole exists. - **Non-distinguishing error mapping.** The remote collapses "stale caller belief" and "insufficient authority" into one error code. If the remote emits a distinct `EpochStale` (or `Renegotiate`) code carrying `current_epoch`, the broker can invalidate the cache entry and re-fetch. - **Retry-on-403 policy at the broker.** The broker's retry classifier treats `403` as retryable, so it re-dispatches without invalidating cache. If `403` were terminal, the task would fail once and surface to an operator — slower but not silently wrong. The invariant that must hold: **for every delegation, the warrant epoch cited by the caller must equal the remote's current warrant epoch, or the caller must be told the current epoch and forced to re-fetch before the next dispatch.** Caching a warrant is only safe if the cache entry is invalidated by any signal that the remote's epoch has advanced — and the only such signal in `a2a/v0.3` is the error path, which must therefore carry the epoch. ## Decision Boundary The architectural choice is where to place the epoch-coherence check: - **Broker-side pre-flight (re-fetch before every dispatch):** eliminates the failure, costs one round-trip per delegation. Acceptable when delegation rate is low or latency budget is generous. Does not scale to high-fan-out swarms. - **Ingress-side strict (reject any non-current epoch):** eliminates the failure, breaks in-flight delegations that race a rotation. Requires the remote to publish rotation events ahead of the effective time so callers can drain. - **Error-path renegotiation (distinct stale-epoch error carrying `current_epoch`):** the correct default. The broker keeps caching, but on `EpochStale` it invalidates the specific cache entry, re-fetches the card, and re-signs the envelope at the new epoch before retrying *once*. This bounds the failure to a single wasted round-trip rather than a DLQ insertion. The boundary condition to encode: **a `403` from a federated peer is never a retry signal unless it carries an epoch or a `renegotiate` directive.** Generic `403` must be terminal at the broker and must invalidate the cache entry for that peer regardless of TTL — because a `403` you cannot explain is evidence your cached belief about the peer is wrong. ## Operational Effect Before the fix, the drill produced 14 DLQ insertions across 6 peers over 40 minutes, all traceable to epoch drift with `k=1` tolerance and retry-on-403. After introducing a distinct `EpochStale` error code carrying `current_epoch`, and changing the broker's retry classifier so that only `EpochStale` triggers a cache-invalidate-and-resign (generic `403` becomes terminal and also invalidates), the same rotation pattern produced zero DLQ insertions and a bounded single renegotiation per affected peer per rotation. The cost was one extra round-trip per peer per rotation event, not per delegation — because the re-fetched card resets the cache entry at the new epoch. The transferable lesson: in cross-org federation, the caller's cached belief about the callee is a *first-class piece of state* that can go stale independently of any signature. Signature validity proves the warrant was issued; it does not prove the warrant still describes the callee. The epoch is the coherence token, and the error path is the only coherence channel `a2a/v0.3` provides — so the error path must be made to carry it. ```python class StaleWarrantEpoch(RuntimeError): """Raised when a broker dispatches against a cached warrant epoch that the remote peer has superseded. Distinct from insufficient-authority: the caller is authorized, but its cached belief about the peer is outdated.""" def __init__(self, peer_id: str, cited_epoch: int, current_epoch: int): self.peer_id = peer_id self.cited_epoch = cited_epoch self.current_epoch = current_epoch super().__init__( f"peer {peer_id}: warrant epoch {cited_epoch} superseded by {current_epoch}" ) def dispatch_delegation(broker, peer_id: str, action: str) -> dict: entry = broker.cache.get(peer_id) if entry is None: entry = broker.refresh_card(peer_id) # cold fill envelope = broker.sign_envelope( peer_id=peer_id, action=action, warrant_epoch=entry.warrant_epoch, ) response = broker.transport.send(peer_id, envelope) if response.status == "ok": return response.body if response.error_code == "EpochStale": # The remote told us our belief is outdated. Invalidate, re-fetch, # re-sign at the new epoch, retry exactly once. current = int(response.error_detail["current_epoch"]) if current <= entry.warrant_epoch: raise StaleWarrantEpoch(peer_id, entry.warrant_epoch, current) broker.cache.invalidate(peer_id) entry = broker.refresh_card(peer_id) if entry.warrant_epoch != current: raise StaleWarrantEpoch(peer_id, entry.warrant_epoch, current) retry_env = broker.sign_envelope( peer_id=peer_id, action=action, warrant_epoch=entry.warrant_epoch ) retry = broker.transport.send(peer_id, retry_env) if retry.status != "ok": raise StaleWarrantEpoch(peer_id, entry.warrant_epoch, current) return retry.body if response.status == "forbidden": # Unexplained 403: our cached belief is untrustworthy. Invalidate and # do NOT retry with the same epoch. broker.cache.invalidate(peer_id) raise StaleWarrantEpoch( peer_id, entry.warrant_epoch, entry.warrant_epoch # unknown current ) raise RuntimeError(f"unhandled peer response: {response.status}") ```