# When must an instance abort a federated handoff after the brokered credential has already been minted **Date of Record:** 2026 November 29 **Scope:** Applies to cross-organization agent federations where a local agent (the *initiator*) obtains a short-lived, scoped token from a trust broker on behalf of a peer agent (the *delegate*) in another org, then hands off task state plus that token. Covers the window between credential mint and first authenticated call by the delegate. Does not cover long-lived service credentials, mTLS-only peer authentication without brokering, or intra-org delegation where the issuer and audience share a trust root. ## Core Distinction The failure is not "the token is invalid." It is a *split-brain between two independently enforced validity predicates*: the broker's mint-time authorization check and the delegate's call-time authorization check, evaluated against *different snapshots of the same policy*, with the handoff state transfer sitting in the gap between them. A naive design treats credential minting as the terminal act of authorization: "the broker said yes, therefore the handoff is authorized." But in a federation the delegate executes in its own trust domain. Its policy engine re-evaluates the presented warrant against its *current* peer trust state — which may have changed between the initiator's mint request and the delegate's first call. The invariant that must hold is narrower than "the token is valid": > **A brokered handoff is safe to complete only if the delegate's call-time trust evaluation of the warrant's issuer and scope is a superset of the broker's mint-time evaluation, and the task state transferred is bound to the same (issuer, subject, scope, nonce) tuple that the delegate will re-check.** Violate the binding half and you get confused-deputy replay. Violate the superset half and you get a delegate that either rejects a legitimate token (liveness) or — worse — accepts a warrant whose scope the broker only *conditionally* granted, because the condition was expressed in a policy revision the delegate has not yet loaded. ## What Was Observed Two orgs, A (initiator) and B (delegate), federated through broker `brk`. A's planner agent needs B's `document.analyze` capability on a specific tenant corpus. Trace: 1. A's initiator calls `brk.mint(subject=A.agent, audience=B.agent, scope=doc.analyze(tenant=42), ttl=90s)`. Broker evaluates A's entitlements against policy revision `r17`, sees an active grant, mints token `T` with claims `{iss: brk, sub: A.agent, aud: B.agent, scope: doc.analyze(t42), exp: t+90, jti: n1, pol_rev: r17}`. 2. Between step 1 and the delegate's first call, tenant 42's data-owner revokes A's grant. Broker policy advances to `r18`. Broker does **not** push revocation to B; B only learns policy at its next pull (every 30s) or on cache miss. 3. A serializes its task state (working memory, partial plan, corpus handle) and hands it to B along with `T`. 4. B's delegate receives the envelope. Its policy engine evaluates `T`: signature valid, `aud` matches, `exp` not passed, `pol_rev: r17` present in B's local cache (B caches revisions 30s). **B accepts and executes.** `document.analyze` runs against a corpus A is no longer entitled to touch. The failure is silent. No exception, no failed auth, no audit anomaly at B — B did exactly what its local policy said. The revocation was real at the broker and invisible at the delegate for up to one cache-refresh interval. The window is `min(token_ttl, delegate_policy_cache_ttl)`; here 30s, and the delegate's call landed at t+11s. A second, sharper variant we reproduced: the delegate's policy engine treats `pol_rev` as *advisory* and accepts any signed token whose `exp` is in the future, ignoring `pol_rev` entirely. Then the window is the full `ttl` (90s), and a revoked-but-unexpired token is a bearer credential until it dies. ## Condition of Validity The superset invariant holds only under all of the following; if any is false, the handoff must be treated as *unverified* and the delegate must not execute: - **C1 — Revision pinning is enforced, not advisory.** The delegate's policy engine must reject a warrant whose `pol_rev` is older than the delegate's `min_acceptable_rev` for that issuer, *even if the signature and expiry are valid*. `pol_rev` is a hard constraint, not metadata. - **C2 — The delegate's `min_acceptable_rev` advances no slower than the broker's revocation propagation.** If the broker can revoke at wall-clock `t`, every delegate must have `min_acceptable_rev ≥ r(t)` within a bounded skew `Δ`. If `Δ > 0`, the initiator must not mint with `ttl > Δ` for revocable scopes, or the delegate must perform a synchronous revocation check (introspection) on first call. - **C3 — State binding.** The transferred task state must carry a digest binding it to `(jti, iss, sub, aud, scope)`. The delegate recomputes the digest against the presented warrant before touching the state. Without this, a replayed `T` (same `jti`, still unexpired) can be paired with *different* task state from a prior handoff — a confused-deputy replay where the delegate executes new instructions under an old authorization. - **C4 — Nonce single-use.** `jti` must be consumed atomically at the delegate on first successful call. A second presentation of the same `jti` is a replay and must fail closed. The interesting boundary: C2 and C4 are in tension with latency. Synchronous introspection (closing C2) adds a round-trip to every first call; single-use `jti` (C4) adds a write to a replay cache the delegate must share across its replicas. The initiator must decide, *before minting*, which of {short-ttl, introspection, pinned-rev} it is relying on — because the delegate cannot retroactively strengthen the guarantee the initiator assumed. ## Decision Boundary The initiator faces a three-way decision at mint time, and the correct branch depends on the *delegate's* enforcement capability, which the initiator must have negotiated out-of-band (capability negotiation, not assumed): | Delegate capability | Initiator action | |---|---| | Enforces `pol_rev` (C1) **and** `ttl ≤ Δ` (C2) **and** `jti` single-use (C4) | Mint short-ttl token, hand off, proceed. | | Enforces `pol_rev` but `Δ` unbounded (no push revocation) | Mint with `ttl ≤ Δ_max` **or** require delegate introspection; if neither, **abort before minting**. | | Treats `pol_rev` as advisory (C1 false) | **Abort.** Do not mint. The delegate cannot be trusted to honor revocation; any token is a bearer credential for its full ttl. | | State binding not supported (C3 false) | Hand off state and token **in a single atomic envelope** signed by the initiator; delegate rejects any envelope whose state digest ≠ warrant binding. If the delegate cannot check this, **abort**. | The abort must happen *before* `brk.mint`, not after. Once `T` exists it is a live bearer credential in the initiator's memory; aborting after mint leaves an orphaned token that the initiator must explicitly revoke (`brk.revoke(jti)`) — and if revocation propagation is the very thing that's broken, the orphan token is unrecoverable within its ttl. This is the non-obvious ordering constraint: **the capability check that decides whether to mint must itself depend on the delegate's enforcement profile, which means the initiator must complete capability negotiation before the first mint, not lazily on first call.** ## Operational Effect Concretely, the guardrail is a pre-mint gate that fails closed on any unverifiable enforcement claim, plus a post-mint compensating revoke on any abort that occurs after the gate passes but before handoff completes: - The gate queries the delegate's advertised enforcement profile (a signed capability descriptor listing `pol_rev_enforced`, `revocation_skew_bound`, `jti_single_use`, `state_binding`) and refuses to mint if the descriptor is absent, stale beyond its own validity, or missing any field the scope requires. - If the mint succeeds but the envelope transfer fails (network, delegate cold-start, context-window saturation on the delegate side), the initiator issues `brk.revoke(jti)` and records the orphan. It does **not** retry the handoff with the same `jti` — a retry with a consumed-or-orphaned nonce is exactly the replay C4 forbids. - The delegate, on receipt, re-validates `pol_rev` against its *current* `min_acceptable_rev`, not the cached one used at negotiation time, and recomputes the state digest. Any mismatch → reject with a structured `FederationHandoffRejected`, and the initiator treats that as a signal that its capability descriptor was stale. The measurable effect: in our reproduction, adding the pre-mint gate eliminated the 30s revocation-lag window entirely (aborts at negotiation, zero orphaned tokens), and the compensating revoke reduced orphan-token lifetime from `ttl` (90s) to the round-trip to the broker (~40ms). The cost is one extra capability-descriptor fetch per federation peer, cached with the descriptor's own validity bound — which must be strictly shorter than the delegate's revocation skew, or the gate itself becomes the stale-policy hole it was meant to close. ```python import hashlib import time from dataclasses import dataclass class FederationHandoffRejected(RuntimeError): """Raised when a brokered cross-org handoff cannot be safely completed.""" @dataclass(frozen=True) class EnforcementProfile: pol_rev_enforced: bool revocation_skew_bound_s: float jti_single_use: bool state_binding: bool valid_until: float # wall-clock; descriptor itself must be fresh @dataclass(frozen=True) class Warrant: jti: str iss: str sub: str aud: str scope: str pol_rev: int exp: float def state_digest(state: bytes, w: Warrant) -> str: h = hashlib.sha256() h.update(state) h.update(f"{w.jti}|{w.iss}|{w.sub}|{w.aud}|{w.scope}".encode()) return h.hexdigest() def pre_mint_gate(profile: EnforcementProfile | None, requested_ttl_s: float, scope_requires_revocable: bool, now: float | None = None) -> None: """Decide BEFORE minting whether the delegate can honor the warrant we are about to create.""" now = time.time() if now is None else now if profile is None: raise FederationHandoffRejected("no enforcement profile from delegate; cannot verify C1-C4") if profile.valid_until <= now: raise FederationHandoffRejected( f"delegate enforcement profile stale (valid_until={profile.valid_until}, now={now})" ) if scope_requires_revocable: if not profile.pol_rev_enforced: raise FederationHandoffRejected( "delegate treats pol_rev as advisory; any minted token is a bearer credential " "for its full ttl and cannot be revoked before expiry" ) if requested_ttl_s > profile.revocation_skew_bound_s: raise FederationHandoffRejected( f"requested ttl {requested_ttl_s}s exceeds delegate revocation skew bound " f"{profile.revocation_skew_bound_s}s; revocation would be invisible for the gap" ) if not profile.jti_single_use: raise FederationHandoffRejected("delegate does not consume jti atomically; replay C4 unenforced") if not profile.state_binding: raise FederationHandoffRejected( "delegate cannot bind task state to warrant; confused-deputy replay possible" ) def complete_handoff(w: Warrant, state: bytes, profile: EnforcementProfile, delegate_min_acceptable_rev: int, bound_digest: str, now: float | None = None) -> str: """Delegate-side acceptance. Re-checks against CURRENT policy, not negotiation-time cache.""" now = time.time() if now is None else now if w.exp <= now: raise FederationHandoffRejected(f"warrant {w.jti} expired at {w.exp}") if w.pol_rev < delegate_min_acceptable_rev: raise FederationHandoffRejected( f"warrant pol_rev {w.pol_rev} older than delegate min_acceptable_rev " f"{delegate_min_acceptable_rev}; issuer policy may have been revoked since mint" ) if state_digest(state, w) != bound_digest: raise FederationHandoffRejected( f"state digest mismatch for jti {w.jti}; state not bound to this warrant" ) return w.jti # caller must atomically consume jti in replay cache ```