# Under what conditions must an instance treat a re-evaluated authorization decision as invalidating an in-flight A2A handoff **Date of Record:** 2026 November 27 **Scope:** Applies to agent-to-agent (A2A) sessions where a receiving agent (callee) admits a caller based on a signed capability warrant, and a continuous authorization (CA) loop re-evaluates that warrant mid-session against mutable policy, credential revocation, and observed tool behavior. Does not apply to single-shot request/response calls where the warrant is checked once at admission and the session terminates before the next CA tick. ## Core Distinction The failure is not "authorization was revoked." It is the distinction between **admission-time authorization** (a predicate over the warrant at handshake) and **continuity authorization** (a predicate over the *pair* of warrant and accumulated session state at each CA tick). A zero-trust A2A handshake typically validates a warrant `W` signed by an issuer `I`, binds it to a session `S`, and admits. The CA loop then re-checks `W` every `τ` seconds. The non-obvious boundary is this: a re-evaluation that returns `DENY` is treated as a binary kill signal, but the correct semantics depend on *whether the deny is attributable to the warrant or to the session's own accumulated effects*. A warrant that is still cryptographically valid but whose *scope no longer covers the session's current state* produces a deny that is indistinguishable, at the CA output, from a revoked credential — and the two require opposite remediation. Conflating them causes either (a) silent continuation of a session that has drifted outside its authority, or (b) destruction of a session that is still fully authorized but whose state has merely grown. ## What Was Observed A planner agent `A` holds a warrant `W_A` issued by orchestrator `O` with scope `{tools: [search, read_file], paths: /data/**, budget_tokens: 200000, ttl: 3600s}`. `A` opens an A2A session to worker `B`. `B`'s admission gate verifies `W_A`'s signature chain, checks `ttl`, checks that the requested operation (`read_file:/data/x`) is within scope, and admits. The session is bound to `W_A`'s `jti` and a monotonic `session_epoch`. `B` runs a CA loop at `τ = 5s`. Each tick it re-fetches the revocation list and re-evaluates scope against **the session's current request log** — not just the next request. At tick 47, `A` has consumed 198,400 of its 200,000 token budget across the session. The CA tick evaluates the *aggregate* session consumption against `W_A.budget_tokens` and returns `DENY` with reason code `SCOPE_EXHAUSTED`. `B` tears down the session and returns a transport-level `403` to `A`. `A`, receiving `403`, applies its own retry policy: it treats `403` as a transient admission failure, re-signs a fresh handshake with the *same* `W_A`, and reconnects. `B`'s admission gate admits again — because at admission time the budget check is against *this request's* cost, not the historical aggregate, and `A`'s fresh session starts with a clean `session_epoch`. The budget that was exhausted is now invisible to both gates. The session continues and `A` spends another 200,000 tokens before the next teardown. This is a **budget-reset loop**: a continuity deny that is misclassified as an admission deny, remediated by re-admission, which resets the very state that triggered the deny. The observed trace: ``` t=0 A→B handshake(W_A) B: ADMIT (epoch=1) t=5..230 CA tick: aggregate < budget B: ALLOW t=235 CA tick: aggregate 198400/200000 B: ALLOW (headroom) t=240 CA tick: aggregate 200050/200000 B: DENY reason=SCOPE_EXHAUSTED t=240 B→A 403 SESSION_TERMINATED epoch=1 closed t=241 A retry: classify 403 as transient → re-handshake t=241 A→B handshake(W_A) B: ADMIT (epoch=2) ← budget aggregate reset t=242 CA tick: aggregate 0/200000 B: ALLOW ``` The invariant that broke: *the CA deny at t=240 was a property of the session's accumulated state, but the remediation path (re-handshake) operates on the warrant, and the warrant's budget counter was scoped to the session, not to the warrant's `jti`.* The budget lived in the wrong place. ## Condition of Validity The budget-reset loop is *not* reachable under all CA designs. It requires the conjunction of three conditions, and the guardrail must be stated against them precisely: 1. **Session-scoped accounting for warrant-scoped limits.** The consumed quantity (tokens, tool calls, wall-clock) is tracked per `session_epoch` while the limit is defined per `jti`. Any re-handshake with the same `jti` resets the numerator but not the denominator. 2. **CA deny is terminal at the transport layer but non-terminal at the caller's retry layer.** `B` closes the session; `A`'s retry classifier maps the close code to a retryable class. If `A` treated `SCOPE_EXHAUSTED` as non-retryable, the loop would not close — but this pushes correctness onto every caller, which is not a bound. 3. **Admission does not consult the warrant's historical consumption.** If `B`'s admission gate re-read the per-`jti` ledger before admitting `epoch=2`, it would see 200050 consumed and deny. The loop depends on admission being stateless with respect to prior sessions. The invariant to enforce: **for any limit `L` defined on a warrant `W`, the consumed quantity must be keyed by `W.jti` (not by `session_epoch`), and both the admission gate and every CA tick must read the same keyed ledger.** Under this invariant, a re-handshake with an exhausted `jti` is denied at admission, and the deny is correctly attributable to the warrant. The loop is bounded because the ledger is monotonic in `jti` and cannot be reset by reconnection. A second, subtler invariant: **a CA deny must carry an attribution field distinguishing `WARRANT_INVALID` (signature, revocation, ttl — remediation is "get a new warrant") from `SESSION_OUT_OF_SCOPE` (aggregate drift — remediation is "the session must narrow, not restart").** Without attribution, the caller cannot choose the correct remediation, and the default retry classifier will choose the wrong one. ## Decision Boundary The boundary is not "allow vs. deny" but **"which state does the deny invalidate, and what is the legal successor state."** - If the CA deny is attributable to the **warrant** (`WARRANT_INVALID`: revoked, expired, signature chain broken), the session must terminate and the caller must obtain a *new* warrant with a new `jti`. Re-handshaking with the same `W_A` must fail at admission. Successor state: new warrant, fresh ledger entry. - If the CA deny is attributable to the **session** (`SESSION_OUT_OF_SCOPE`: aggregate budget, path drift, tool-behavior anomaly), the session must terminate but the warrant remains valid *for a narrower successor session*. The caller may re-handshake, but the successor session inherits the `jti`'s consumed ledger and must be admitted only against the *remaining* headroom. If headroom is zero, admission is denied and the caller must request a warrant re-issuance with an increased or reset budget — an explicit, audited act by `O`, not an implicit side effect of reconnection. The decision rule an instance must apply at every CA tick: ``` attribution = classify(deny_reason) if attribution == WARRANT_INVALID: terminate(epoch); require_new_jti() elif attribution == SESSION_OUT_OF_SCOPE: terminate(epoch); successor_epoch = epoch+1 admit(successor) iff ledger[jti].remaining >= requested_cost # never reset ledger[jti] on re-handshake ``` The failure mode is any implementation where `terminate(epoch)` is followed by `admit(successor)` without the `ledger[jti].remaining` guard — that is exactly the budget-reset loop. ## Operational Effect In a swarm of `N` planners sharing an orchestrator-issued warrant pool, the loop is not merely wasteful; it is an **amplification vector**. Each planner that hits `SCOPE_EXHAUSTED` and reconnects re-admits with a fresh epoch, and the orchestrator's aggregate spend — the quantity `O` uses to enforce its own cross-agent budget — is computed from per-`jti` issuance, not from per-epoch admission. The two diverge: `O` believes total spend is bounded by `N × budget`, but the actual spend is `N × budget × (number of reconnects per planner)`, which is unbounded because reconnects are driven by the CA loop's own teardown. The CA loop, intended as a containment mechanism, becomes the engine of the overrun. This is the operational signature: **spend grows superlinearly in `τ⁻¹`** — a faster CA loop produces more teardowns, more reconnects, and more resets. Tightening `τ` to catch drift sooner *worsens* the overrun unless the ledger keying is fixed first. The corrective ordering matters: fix the ledger key (`jti`, not `epoch`) and the attribution field *before* tuning `τ`. A system that adds attribution but keeps epoch-scoped accounting will correctly label the deny as `SESSION_OUT_OF_SCOPE` and then admit the successor against a reset ledger — it will log the loop clearly while still running it. Attribution without keyed accounting is observability without containment. ```python from dataclasses import dataclass, field from enum import Enum from typing import Dict class AuthorizationAttribution(Enum): WARRANT_INVALID = "WARRANT_INVALID" # revoked / expired / broken chain SESSION_OUT_OF_SCOPE = "SESSION_OUT_OF_SCOPE" # aggregate drift, warrant still valid class BudgetResetLoopError(RuntimeError): """Raised when a re-handshake would reset a warrant-scoped ledger keyed by session epoch.""" @dataclass class Warrant: jti: str budget_tokens: int revoked: bool = False @dataclass class Ledger: # Keyed by warrant jti, NOT session epoch. Monotonic. Never reset by reconnect. consumed: Dict[str, int] = field(default_factory=dict) def remaining(self, jti: str, warrant: Warrant) -> int: return warrant.budget_tokens - self.consumed.get(jti, 0) def charge(self, jti: str, cost: int) -> None: self.consumed[jti] = self.consumed.get(jti, 0) + cost def admit(ledger: Ledger, warrant: Warrant, requested_cost: int, epoch: int) -> int: """Admission gate. Must consult the jti-keyed ledger, never a per-epoch counter.""" if warrant.revoked: raise BudgetResetLoopError( f"admission denied: warrant {warrant.jti} revoked; obtain new jti" ) if ledger.remaining(warrant.jti, warrant) < requested_cost: # This is the guard that breaks the budget-reset loop. raise BudgetResetLoopError( f"admission denied: jti {warrant.jti} has " f"{ledger.remaining(warrant.jti, warrant)} tokens remaining, " f"requested {requested_cost}; re-handshake cannot reset ledger" ) return epoch def ca_tick(ledger: Ledger, warrant: Warrant, epoch: int) -> AuthorizationAttribution: """Continuous authorization. Returns attribution, not a bare boolean.""" if warrant.revoked: return AuthorizationAttribution.WARRANT_INVALID if ledger.remaining(warrant.jti, warrant) < 0: return AuthorizationAttribution.SESSION_OUT_OF_SCOPE return AuthorizationAttribution.SESSION_OUT_OF_SCOPE # placeholder; caller inspects remaining def handle_deny(ledger: Ledger, warrant: Warrant, attribution: AuthorizationAttribution, next_epoch: int, requested_cost: int) -> int: """Remediation must branch on attribution. Re-handshake is legal only for SCOPE denies, and only against remaining headroom.""" if attribution is AuthorizationAttribution.WARRANT_INVALID: raise BudgetResetLoopError( f"warrant {warrant.jti} invalid; session must terminate and caller must " f"request a new jti from the issuer" ) if attribution is AuthorizationAttribution.SESSION_OUT_OF_SCOPE: # Legal successor session, but inherits the jti ledger. return admit(ledger, warrant, requested_cost, next_epoch) raise BudgetResetLoopError(f"unhandled attribution {attribution}") # --- Reproduce the loop and show the guard breaking it --- w = Warrant(jti="jti-7f3a", budget_tokens=200_000) led = Ledger() led.charge(w.jti, 200_050) # session epoch=1 exhausted the budget try: # Caller receives SCOPE_EXHAUSTED, retries with same warrant, fresh epoch. handle_deny(led, w, AuthorizationAttribution.SESSION_OUT_OF_SCOPE, next_epoch=2, requested_cost=500) except BudgetResetLoopError as e: print(f"loop broken: {e}") ```