# What structural signals indicate a federated AAIF→OAuth mTLS warrant has silently lost its workload-identity binding mid-handoff **Date of Record:** 2026 December 3 **Scope:** Applies to agent-to-agent handoffs where an AAIF (Agent Authorization & Identity Federation) token is exchanged for an OAuth 2.0 mTLS-bound access token whose `cnf` claim is populated from a workload identity provider (WIDP) attestation (SPIFFE/SVID, cloud IAM workload identity, or equivalent). Does not apply to single-issuer bearer-token flows or to mTLS channels where the client certificate is provisioned statically outside a WIDP. ## Core Distinction The failure mode is not token expiry and not signature forgery. It is **binding divergence**: the AAIF warrant is cryptographically valid, the OAuth token is cryptographically valid, the mTLS handshake succeeds — and yet the token presented at the resource server is bound to a *different workload instance* than the one that received the AAIF warrant. Every individual verification step returns `OK`; the composite identity is wrong. The distinction that matters operationally: a **broken** token fails a verifier. A **diverged** token passes every verifier because each verifier checks a different link in a chain that no single party re-assembles. The AAIF issuer checked the warrant subject. The OAuth authorization server checked the WIDP attestation. The resource server checked the mTLS `cnf` thumbprint. No party checked that the AAIF subject, the WIDP attestation subject, and the mTLS certificate subject name the *same* workload at the *same* instant. ## What Was Observed A three-hop swarm: planner agent `P` (namespace `swarm/plan`), executor agent `E` (namespace `swarm/exec`), auditor agent `A` (namespace `swarm/audit`). `P` holds an AAIF warrant `W` delegating `exec:run` to `E` with `aud=E`. `E` runs in a pod that is rescheduled during a rolling update — the WIDP issues a fresh SVID for the new pod, but the old pod's OAuth token (mTLS-bound to the old SVID's certificate) is still cached in `E`'s token store with ~40 seconds of `exp` remaining. `E` completes the handoff to `A` using the cached token. The trace, condensed: ``` t+0.00 P → E : AAIF warrant W (sub=spiffe://swarm/exec, aud=spiffe://swarm/aud) t+0.00 E verifies W: sig OK, exp OK, sub matches its *current* SVID → ACCEPT t+0.02 E → A : OAuth token T (cnf.jkt = thumbprint(old_SVID_cert)) t+0.02 A verifies T: sig OK, exp OK, cnf.jkt matches presented mTLS cert (old_SVID_cert still in E's TLS config, not yet rotated) → ACCEPT t+0.03 A → resource: request authorized as spiffe://swarm/exec t+0.03 Resource server logs: authorized workload = OLD pod UID Actual executing workload = NEW pod UID ``` Structural signals that this had occurred, in the order they became visible: 1. **WIDP attestation serial ≠ token `cnf` serial.** The new SVID carried serial `0x…a91f`; the token's `cnf.jkt` thumbprinted a certificate with serial `0x…77c2`. Both were valid at verification time. The mismatch only surfaced when a log correlator joined `attestation.serial` against `token.cnf.cert_serial` across two services. 2. **`exp` skew between token and attestation.** The token had 40s of life; the attestation it *should* have been bound to had been revoked 12s earlier. Revocation of the old SVID did not propagate to the already-minted OAuth token — OAuth tokens are not retroactively revoked on WIDP rotation unless the AS participates in a revocation feed. 3. **Audience subject mismatch under rotation.** `A` received `aud=spiffe://swarm/aud`, but the *presenting* workload was `spiffe://swarm/exec` at a new instance. Audience was correct; presenter was not. Audience checks do not detect presenter substitution when the presenter's namespace is unchanged. 4. **Silent 200s.** No 401, no 403, no alert. The resource server's authorization decision was correct given its inputs. The defect lived in the *composition* of inputs. ## Condition of Validity The invariant that must hold for a federated warrant to be sound: > At the instant a resource server accepts an OAuth token minted from an AAIF warrant, the triple `(W.sub, T.cnf.subject, presented_mTLS_cert.subject)` must name the same workload instance, and `T.cnf.cert_serial` must equal the serial of the certificate currently attested by the WIDP for that instance. This invariant is **not** enforced by any of the three standard verifiers independently: - The AAIF verifier checks `W` in isolation. It cannot see `T`. - The OAuth AS checks the WIDP attestation at *mint time*, not at *use time*. - The resource server checks `T` against the *presented* certificate, not against the *currently attested* one. The invariant only holds if one of two architectural conditions is met: (a) the resource server performs a live WIDP re-attestation lookup keyed on `T.cnf.cert_serial` at every use, or (b) the OAuth AS subscribes to WIDP revocation and the token's `exp` is clamped to the attestation's remaining lifetime (`T.exp ≤ attestation.exp`). Absent either, the invariant is unenforced and binding divergence is possible whenever a workload rotates between mint and use. ## Decision Boundary The boundary is between **short-lived tokens with rotation-tolerant verification** and **long-lived tokens with rotation-blind verification**. The dangerous quadrant is the second: tokens whose `exp` exceeds the WIDP rotation cadence, verified by resource servers that trust `cnf` without re-attestation. Concretely, divergence becomes possible when: ``` T.exp − T.iat > rotation_interval − max_propagation_delay ``` In the observed incident: `T.exp − T.iat = 300s`, `rotation_interval = 240s`, `max_propagation_delay = 15s`. The token outlived its binding by up to 75 seconds — a window in which a rotated workload could present a stale-but-valid token. The decision: either clamp `T.exp` to `min(T.nominal_exp, attestation.exp − safety_margin)` at mint time, or require the resource server to re-attest. Clamping is cheaper; re-attestation is correct. Do not do neither. ## Operational Effect The effect of leaving this unenforced is not a hard failure but a **silent authorization widening**: the resource server authorizes the request as the *namespace* of the presenting workload, which is unchanged across rotation, while the *instance* has changed. In a swarm where per-instance policy exists (rate limits, data-scope restrictions, audit attribution), the widening is invisible until an auditor replays the trace and finds that the authorized instance UID does not match the executing instance UID. The guardrail: emit a structural signal at every acceptance — `(W.sub, T.cnf.cert_serial, attestation.serial, executing_pod_uid)` — and assert all four resolve to one instance. When they do not, fail closed. ```python from dataclasses import dataclass class BindingDivergenceError(RuntimeError): """Raised when a federated warrant's identity triple does not resolve to a single workload instance at acceptance time.""" @dataclass(frozen=True) class Warrant: sub: str # AAIF subject, e.g. spiffe://swarm/exec aud: str exp: int @dataclass(frozen=True) class OAuthToken: cnf_subject: str # bound certificate subject cnf_serial: str # bound certificate serial exp: int iat: int @dataclass(frozen=True) class Attestation: subject: str serial: str exp: int revoked: bool def accept_handoff( warrant: Warrant, token: OAuthToken, presented_cert_subject: str, presented_cert_serial: str, live_attestation: Attestation, now: int, safety_margin: int = 5, ) -> None: # Individual checks — each may pass while the composite is wrong. if now >= warrant.exp: raise BindingDivergenceError("warrant expired") if now >= token.exp: raise BindingDivergenceError("token expired") if token.cnf_subject != presented_cert_subject: raise BindingDivergenceError( f"token bound to {token.cnf_subject!r}, cert presents " f"{presented_cert_subject!r}" ) if token.cnf_serial != presented_cert_serial: raise BindingDivergenceError( f"token cnf serial {token.cnf_serial!r} != presented " f"{presented_cert_serial!r}" ) # The invariant no standard verifier enforces: live re-attestation. if live_attestation.revoked: raise BindingDivergenceError( f"presented cert {presented_cert_serial!r} revoked at WIDP" ) if live_attestation.serial != token.cnf_serial: raise BindingDivergenceError( f"binding divergence: token bound to {token.cnf_serial!r}, " f"WIDP currently attests {live_attestation.serial!r} for " f"{live_attestation.subject!r}" ) if live_attestation.subject != warrant.sub: raise BindingDivergenceError( f"warrant sub {warrant.sub!r} != attested {live_attestation.subject!r}" ) if live_attestation.subject != token.cnf_subject: raise BindingDivergenceError( f"token cnf subject {token.cnf_subject!r} != attested " f"{live_attestation.subject!r}" ) # Clamp check: token must not outlive its binding. if token.exp > live_attestation.exp - safety_margin: raise BindingDivergenceError( f"token exp {token.exp} exceeds attestation exp " f"{live_attestation.exp} minus margin {safety_margin}" ) ```