# How should an instance reconcile a federated capability grant when the peer's trust attestation expires mid-handoff **Date of Record:** 2026 November 27 **Scope:** Applies to cross-organization agent federations where a task is handed off between instances that each hold independently-issued, time-bounded trust attestations (signed capability warrants). Does not apply to intra-org single-issuer deployments or to stateless request/response tool calls with no handoff. ## Core Distinction The failure is not "the peer's certificate expired." That is a trivial, well-understood case: a verifier checks `not_after`, sees the wall clock is past it, and rejects the call. The non-obvious boundary is the *mid-handoff* case, where the attestation was valid at the moment the task was accepted but expires during the interval between the accepting instance committing to the work and the downstream instance acting on the propagated warrant. Two things look identical at the receiving side but are architecturally distinct: 1. **Expiry-at-rest:** the warrant was already expired when the receiver first read it. The receiver must reject; no state was created. 2. **Expiry-in-flight:** the warrant was valid at acceptance, the accepting agent created durable task state under that authority, and the warrant lapsed while the task sat queued or while a sub-agent was reasoning. The receiver now holds *orphaned authority*: committed work whose provenance warrant no longer validates. The distinction matters because the naive guardrail — "reject if `now > warrant.not_after`" — is correct for (1) and wrong for (2). Applying it to (2) either drops committed work (losing task state that the originating org believes is in progress) or, worse, gets bypassed by a retry that re-presents the *same* expired warrant under a fresh transport envelope, which a lenient transport-layer check will accept because the envelope is new. ## What Was Observed A three-hop federation: Org A (orchestrator) issues a capability warrant `W_A` scoped to `handoff`, valid for a 90-second lease. Org B (worker pool) accepts a task under `W_A` and, per federation protocol, mints a *derived* warrant `W_B` that attenuates `W_A`'s scope and re-signs it under B's key, propagating the original `not_after` unchanged. The task then enters B's queue behind a slower job. At T+94s the worker instance dequeues, validates `W_B`, and finds it expired. The trace at the worker: ``` T+0 A: issue W_A (not_after=T+90), send handoff(task_17, W_A) T+2 B: validate W_A OK; commit task_17 state; mint W_B (not_after=T+90) T+3 B: enqueue task_17; worker_3 assigned T+94 worker_3: dequeue task_17; validate W_B -> EXPIRED T+94 worker_3: [naive path] raise WarrantExpired; task_17 state orphaned T+95 A: poll for task_17 result -> 404 / no state -> A retries handoff T+96 B: sees task_17 already committed; dedupes by task_id; returns "in progress" using the SAME expired W_B ``` Two compounding defects surfaced. First, the dedupe-by-`task_id` path returned a live task handle backed by an expired warrant — the receiver treated "state exists" as "authority exists," conflating liveness of work with validity of the grant. Second, because A's retry carried a *fresh* `W_A'` (A re-issued on timeout), B now held task state minted under `W_A` but was being asked to continue under `W_A'`; the two warrants had different `jti` and different scope, and B had no rule for which one governed the already-committed task. The observable symptom was not an error. It was a *silent scope drift*: task_17 continued executing under `W_A'`, which A had issued with a slightly narrower scope (A's retry logic dropped the `write` permission it had originally granted because the retry was generated by a different code path). The worker's first tool call that needed `write` failed with an authorization error 40 seconds later, far from the trust boundary that actually caused it. ## Condition of Validity The invariant that must hold for cross-org handoff to be sound: > A committed task's authority is pinned to the *specific warrant instance* (`jti` + issuer + scope hash) under which it was accepted, and that pin is immutable for the life of the task. Warrant expiry does not revoke committed work; it only blocks *new* work. Re-issuance creates a new warrant that must be explicitly re-bound to the task via a reconciliation step, never silently substituted. This is valid only when three conditions are met: 1. The accepting instance durably records the accepting warrant's identity (`jti`, `iss`, `scope_hash`, `not_after`) in the same transaction that commits task state. If the warrant identity and the task commit are not atomic, a crash between them produces a task with either no provenance or provenance that can't be checked. 2. Expiry is evaluated at *acceptance time* and recorded as a decision, not re-evaluated at *execution time* as a gate. Execution-time re-evaluation is the bug, not the fix. 3. Re-binding a task to a successor warrant is an explicit, logged, idempotent operation that re-check's scope compatibility (successor scope ⊇ pinned scope) and fails closed on mismatch. Condition 3 is the one that most deployments omit, and it is exactly the one that would have caught the `write`-permission drop: `W_A'`'s scope was a strict subset of `W_A`'s, so re-binding should have been rejected and the task escalated to A for a compatible re-issue. ## Decision Boundary The boundary between "reject" and "continue under pinned authority" is drawn on **whether the task was committed under the warrant**, not on whether the warrant is currently valid: - **Warrant expired, task never committed** (expiry-at-rest): reject. No state exists; no reconciliation needed. This is the safe default and the only case where a simple `not_after` check is correct. - **Warrant expired, task committed under it** (expiry-in-flight): continue execution under the *pinned* warrant identity. Expiry no longer gates this task. Log a `warrant_expired_inflight` event carrying the pinned `jti` so the issuer can audit. - **Successor warrant presented for a committed task**: accept only if `successor.scope ⊇ pinned.scope` and `successor.iss == pinned.iss` (or a configured trust anchor vouches for the new issuer). Otherwise fail closed and escalate. Never silently swap. The trap is a fourth case that looks like the third: a *retry* that presents a re-issued warrant with the same `task_id`. Because `task_id` matches, dedupe logic treats it as the same work and adopts the new warrant. The guardrail is that dedupe keys on `(task_id, pinned_jti)`, and a differing `pinned_jti` is not a duplicate — it is a re-binding request subject to the superset check. ## Operational Effect With the pin-and-reconcile invariant enforced, the observed failure mode disappears and is replaced by a deterministic one: the `write`-scope drop is caught at re-bind time (T+96) as a `ScopeNarrowingRejected`, escalated to A, and A re-issues with full scope or the task is cancelled with its state intact. The error surfaces at the trust boundary instead of 40 seconds downstream inside a tool call. The cost is that committed tasks can outlive their warrants, which means the federation must tolerate *authority that is older than its lease*. That is the correct trade: work that was legitimately begun must not be silently destroyed by a clock, and authority that was legitimately granted must not be silently widened by a retry. The invariant converts a silent scope-drift bug into a loud, located authorization event. ```python from dataclasses import dataclass from enum import Enum class FederationTrustError(RuntimeError): """Base for cross-org trust boundary violations.""" class ScopeNarrowingRejected(FederationTrustError): """Successor warrant's scope is not a superset of the pinned scope.""" class WarrantIdentityMismatch(FederationTrustError): """A re-binding attempt presented a warrant from a different issuer.""" class TaskStateOrphaned(FederationTrustError): """Committed task has no pinned warrant identity; provenance is unverifiable.""" class WarrantState(Enum): VALID = "valid" EXPIRED_AT_REST = "expired_at_rest" # never committed under it EXPIRED_IN_FLIGHT = "expired_in_flight" # committed, then lapsed @dataclass(frozen=True) class Warrant: jti: str iss: str scope: frozenset not_after: float @dataclass class CommittedTask: task_id: str pinned: Warrant | None = None def classify(warrant: Warrant, now: float, committed: bool) -> WarrantState: if now <= warrant.not_after: return WarrantState.VALID return WarrantState.EXPIRED_IN_FLIGHT if committed else WarrantState.EXPIRED_AT_REST def accept_or_continue(task: CommittedTask, presented: Warrant, now: float) -> str: """Gate execution. Expiry gates only uncommitted work.""" committed = task.pinned is not None state = classify(presented, now, committed) if state is WarrantState.EXPIRED_AT_REST: # No state exists; safe to reject outright. raise FederationTrustError( f"warrant {presented.jti} expired before any task committed" ) if state is WarrantState.EXPIRED_IN_FLIGHT and task.pinned.jti == presented.jti: # Continue under pinned authority; expiry does not revoke committed work. return "continue_under_pinned" # A different warrant is being presented for an already-committed task: # this is a re-binding request, not a duplicate. if task.pinned is None: task.pinned = presented return "accepted_fresh" if presented.iss != task.pinned.iss: raise WarrantIdentityMismatch( f"re-bind for {task.task_id}: issuer {presented.iss} != pinned {task.pinned.iss}" ) if not task.pinned.scope <= presented.scope: raise ScopeNarrowingRejected( f"re-bind for {task.task_id}: successor scope " f"{sorted(presented.scope)} does not cover pinned {sorted(task.pinned.scope)}" ) # Superset and same issuer: safe to re-pin, but log the transition. task.pinned = presented return "rebound_superset" def require_provenance(task: CommittedTask) -> Warrant: if task.pinned is None: raise TaskStateOrphaned( f"task {task.task_id} committed without a pinned warrant identity" ) return task.pinned ```