# Which invariants prevent capability-lease revocation from silently orphaning in-flight A2A handoffs across a trust-brokered federation **Date of Record:** 2026 November 29 **Scope:** Applies to federated multi-agent systems where agent A in org X invokes agent B in org Y via a trust broker that mints time-bounded, policy-scoped capability leases and negotiates per-call policy. Does not apply to single-tenant deployments where the caller and callee share one policy authority and one revocation clock. ## Core Distinction The failure here is not "authorization denied." It is a **revocation/orphan split**: a capability lease is revoked (by the issuing org, a policy downgrade, or a trust-score drop) *after* a callee agent has already accepted a delegated subtask and *before* it commits its result. The caller observes a revocation event and treats the task as terminated; the callee never sees the revocation because revocation propagates only on the *control* channel (the lease's TTL and the broker's revoke webhook), not on the *data* channel where the in-flight handoff is executing. The result is an **orphaned execution**: a callee agent still burning tokens and tool calls under a policy that the caller believes is dead, whose eventual output lands in a queue no one is authorized to read. This is distinct from the common "token expiry mid-task" problem because in a federation the *revoking authority and the executing authority are different principals*. The caller's clock, the broker's clock, and the callee's clock are three separate monotonic sources with independent drift, and the policy that authorized the call may have been *renegotiated* to a narrower scope without any single party holding the complete before/after picture. ## What Was Observed A three-party federation: Orchestrator `O` (org A), Trust Broker `TB` (org B, shared), Worker `W` (org C). `O` requests a lease for `W.invoke` with scope `{read:dataset_7, max_tokens: 20000, ttl: 90s}`. `TB` mints lease `L1` and returns it with a `policy_epoch: 41`. `O` starts a multi-step task on `W`; step 3 of 7 triggers a policy renegotiation because `W`'s org tightens `dataset_7` to `read:dataset_7[redacted]` at `policy_epoch: 42`. `TB` revokes `L1` and mints `L2` with the narrower scope, pushing the revoke to `O` over the control channel. Observed trace: 1. `O` receives `L1.revoked`, marks task `TERMINATED`, returns a failure to its own client. Logs `lease_revoked_epoch_42`. 2. `W` never receives the revoke — the revoke webhook was delivered to the *lease holder* (`O`), not the *executing callee* (`W`), because `W` only holds a `delegation_token` derived from `L1` at handoff time, and that derivation is one-way (a signed claim, not a live channel). 3. `W` continues steps 4–7 under `L1`'s original scope, reading unredacted `dataset_7`, because its local policy check only validates the `delegation_token` signature and TTL — both still valid at `policy_epoch: 41`. 4. At step 7, `W` attempts to commit the result to the shared result bus. The bus, keyed on `policy_epoch`, rejects writes from `epoch: 41` after `epoch: 42` is observed. `W` retries 3×, then dead-letters the result. 5. `O`'s client has already been told the task failed. The dead-lettered result contains unredacted `dataset_7` fragments. **The redaction boundary was violated by an execution the caller had already accounted as terminated.** The non-obvious part: the system had *two* revocation signals (`L1.revoked` to `O`, `epoch: 42` to the bus) and *zero* revocation signals to `W`, the only party actually executing. The invariant "revocation is transitive to the executor" was assumed but never enforced. ## Condition of Validity The silent-orphan failure requires all three conditions simultaneously: - **Delegation-token derivation is one-way.** The callee holds a signed, self-contained claim (`delegation_token`) rather than a live handle the broker can revoke. If the callee held a live handle with a broker-side revocation check per tool call, the orphan window collapses to one tool-call latency. - **Policy epoch advances without a callee-visible fence.** If the callee's local policy engine polls or subscribes to `TB`'s epoch, it can self-abort. If it only validates at handoff, the epoch advance is invisible. - **Caller-side termination is treated as global termination.** `O` marking the task `TERMINATED` is a *local* state transition. The bug is treating a local terminal state as a distributed one — no compensating cancel is sent to `W`, because `O` believes `W` will discover the revocation itself. If any one of these is broken, the failure degrades to a latency blip or a clean abort. The dangerous regime is exactly the intersection: one-way tokens + epoch advance + local-as-global termination. ## Decision Boundary The architectural invariant that bounds this is a **revocation fence with a callee-acknowledged quiescence point**. Concretely: 1. **Two-phase revocation, not fire-and-forget.** On epoch advance, `TB` issues `revoke_prepare` to the *callee* (not just the holder), which forces `W` to stop issuing new tool calls and return a `quiescent(token, last_committed_step)` ack. Only after all callees ack does `TB` finalize the revoke to `O`. 2. **The callee must be a first-class revocation target.** The lease's `delegation_token` must carry a `revocation_endpoint` and a `fence_epoch` the callee checks *before every tool call*, not just at handoff. A token without a live revocation path is not a capability, it is a liability. 3. **Result commits are epoch-fenced with a grace window, not a hard cutoff.** The bus must accept `epoch: 41` writes within a bounded grace period if the writer presents a valid `quiescent` ack, so a legitimately-in-flight step isn't dead-lettered into a leak. 4. **Caller termination must be `TERMINATING`, not `TERMINATED`,** until all callees have acked quiescence. A caller that reports terminal state before quiescence is lying to its own client. The decision boundary is: *a revocation is complete only when every executing party has acknowledged it and no result is in flight under the old epoch.* Anything short of that is a revocation that has been *announced* but not *applied*. ## Operational Effect Without the fence, the observable symptoms are: (a) dead-letter queues containing results stamped with a superseded `policy_epoch` and containing data the new policy forbids; (b) token spend attributed to a task the caller logged as terminated, breaking cost accounting; (c) in regulated settings, a redaction-boundary violation with no corresponding authorization event in the caller's audit log — the audit trail shows a clean termination, but the data was read anyway. The audit gap is the worst part: the caller's logs are *internally consistent and wrong*. With the fence, revocation latency increases by one round-trip to the callee (the `quiescent` ack), which is the correct trade. The invariant to enforce in code is that no `TERMINATED` state may be entered while any callee holds an un-acked `revoke_prepare`, and no result may be committed under an epoch that has any outstanding `revoke_prepare` without a valid quiescence proof. ```python from dataclasses import dataclass, field from enum import Enum from typing import Dict, Set class RevocationOrphanError(RuntimeError): """Raised when a caller declares terminal state while a callee is still executing under a superseded policy epoch with no acknowledged quiescence.""" class TaskState(Enum): RUNNING = "RUNNING" TERMINATING = "TERMINATING" # revocation announced, awaiting callee acks TERMINATED = "TERMINATED" @dataclass class Lease: lease_id: str policy_epoch: int callee_id: str revoked: bool = False @dataclass class Federation: leases: Dict[str, Lease] = field(default_factory=dict) # callee_id -> set of lease_ids for which quiescence has been acked quiescent_acks: Dict[str, Set[str]] = field(default_factory=dict) task_state: TaskState = TaskState.RUNNING def revoke_prepare(self, lease_id: str) -> None: lease = self.leases[lease_id] lease.revoked = True # caller moves to TERMINATING, NOT TERMINATED, until callee acks self.task_state = TaskState.TERMINATING def callee_ack_quiescent(self, lease_id: str) -> None: lease = self.leases[lease_id] self.quiescent_acks.setdefault(lease.callee_id, set()).add(lease_id) def finalize_termination(self) -> None: # invariant: every revoked lease must have a matching callee ack for lease_id, lease in self.leases.items(): if lease.revoked: acked = lease_id in self.quiescent_acks.get(lease.callee_id, set()) if not acked: raise RevocationOrphanError( f"cannot finalize: lease {lease_id} on callee " f"{lease.callee_id} revoked at epoch {lease.policy_epoch} " f"but no quiescence ack; callee may still be executing" ) self.task_state = TaskState.TERMINATED def commit_result(self, lease_id: str, result_epoch: int) -> str: lease = self.leases[lease_id] if result_epoch < lease.policy_epoch and lease.revoked: acked = lease_id in self.quiescent_acks.get(lease.callee_id, set()) if not acked: raise RevocationOrphanError( f"result commit for lease {lease_id} at stale epoch " f"{result_epoch} (< {lease.policy_epoch}) without quiescence " f"proof; would leak data under superseded policy" ) return f"committed:{lease_id}:{result_epoch}" def run_federation() -> None: fed = Federation() fed.leases["L1"] = Lease(lease_id="L1", policy_epoch=41, callee_id="W") fed.revoke_prepare("L1") # epoch 42 tightens policy # callee has NOT acked; caller tries to finalize anyway: fed.finalize_termination() # raises RevocationOrphanError ```