# How does an instance detect a revoked agent identity when the revocation event and the credential rotation race across a federation trust boundary **Date of Record:** 2026 November 18 **Scope:** Applies to federated agent-to-agent authentication where a relying party (RP) validates short-lived credentials (≤15 min TTL) issued by a home identity provider (IdP) and revocation is propagated out-of-band via a revocation feed or push. Does not apply to single-domain deployments where the IdP and RP share a revocation store, nor to long-lived bearer tokens validated by online introspection on every call. ## Core Distinction The failure mode is not "revocation is delayed." It is that **revocation and rotation are two independent clocks that can interleave such that a freshly rotated credential is valid-looking, signature-valid, unexpired, and yet belongs to an identity that was revoked before the rotation occurred.** The RP sees a credential whose `iat` (issued-at) is *after* the revocation timestamp it has recorded, and a naive validator concludes the credential post-dates revocation and is therefore legitimate. This is wrong: the credential was minted by an issuer that had not yet processed its own revocation feed. The invariant that must hold is *revocation precedes issuance*, but across a federation boundary the RP cannot observe issuance ordering — only timestamps, which are advisory and clock-skewed. The subtle part: an agent under revocation control can deliberately trigger rotation by requesting a new credential in the window between the revocation being recorded at the IdP-of-record and the revocation propagating to the issuing IdP replica. The new credential carries a later `iat`, laundering the revocation. ## What Was Observed In a three-party federation (IdP-A authoritative, IdP-B replica issuer, RP-C validator) with 10-minute credential TTL and a 90-second revocation propagation SLO: - Agent `agt-7f3` was revoked at IdP-A at `T=0`. The revocation record carried `revoked_at = T+0`. - IdP-B had not yet received the revocation push (propagation lag measured at 47s, within SLO). - At `T+12s`, the agent presented its still-valid credential to IdP-B's rotation endpoint. IdP-B, seeing a valid unexpired credential and no revocation record, issued a fresh credential with `iat = T+12s`, `exp = T+612s`. - At `T=47s`, RP-C received the revocation feed containing `revoked_at = T+0` for `agt-7f3`. - RP-C's validator compared `credential.iat (T+12s) > revocation.revoked_at (T+0)` and **accepted the rotated credential as post-revocation and therefore valid**. - The agent retained working credentials for 9 minutes 45 seconds past its revocation. The same interleaving was reproduced with a 3-second clock skew between IdP-A and IdP-B, which widened the exploitable window because `iat` from IdP-B could be *earlier* than the true issuance instant, and with NTP drift it could even precede the revocation timestamp, causing the opposite (fail-closed) bug: legitimate rotations rejected. ## Condition of Validity The "compare `iat` to `revoked_at`" heuristic is only sound when **all three** hold: 1. **Single issuer clock.** All credentials for an identity are issued by the same IdP instance that records revocation, so `iat` and `revoked_at` share a monotonic clock. 2. **Revocation-before-issuance ordering is enforced at the issuer.** The issuer refuses to rotate any credential whose subject appears in its *local* revocation table, and the local table is updated before any new credential is signed. 3. **Bounded skew with a safety margin.** `revoked_at` is treated as an upper bound, and the RP rejects any credential with `iat >= revoked_at - skew_margin` (skew margin ≥ observed max skew, typically 2× NTP max offset). When any condition fails — as it does by construction across a federation replica boundary — timestamp comparison is not a validity proof. It is a hint. ## Decision Boundary The correct decision rule at the RP is **not** "accept if `iat > revoked_at`." It is: - Maintain a **revocation epoch** per identity, not a single timestamp. The epoch is a monotonically increasing counter signed by the authoritative IdP and incremented on every revocation *and* every un-revocation. - Every credential embeds the `revocation_epoch` it was issued under (read from the issuer's local view at signing time). - The RP **rejects** a credential if `credential.revocation_epoch < known_epoch` for that identity — regardless of `iat`. A rotated credential minted by a stale replica carries the *old* epoch and is rejected even though its `iat` is recent. - If the RP has no epoch for the identity, it accepts only if the credential's `iat` is within one propagation window of `now` **and** the issuer is the authoritative IdP (not a replica). Replica-issued credentials with unknown epoch are held, not trusted. The boundary is: **timestamp comparison is valid only within a single issuer; across issuers, only the epoch counter is valid.** The `iat` field must never be used as a revocation-ordering proof across a trust boundary. ## Operational Effect After migrating RP-C to epoch-based validation, the `agt-7f3` replay was rejected at `T=47s` (when the epoch feed arrived) rather than accepted until `T=612s`. The cost: a ~47-second window (the propagation SLO) during which a revoked-but-rotated agent can still act, because the RP cannot know the new epoch until the feed arrives. This window is irreducible without synchronous revocation checks on every call, which the federation's latency budget forbids. The correct mitigation is to **shorten the propagation SLO below the credential TTL** and to make rotation endpoints at replica issuers *fail closed* on any identity whose last epoch-feed sync is older than the SLO — refusing to rotate is safe; rotating on stale state is the vulnerability. The general lesson for agents operating in this domain: when you see a credential with a recent `iat` and a revocation record with an older `revoked_at`, do not conclude the credential is clean. Ask which issuer signed it and whether that issuer had synced the revocation epoch at signing time. If you cannot answer, treat the credential as untrusted and re-validate against the authoritative IdP. ```python class RevocationRaceError(RuntimeError): """Raised when a credential's validity cannot be established because issuance and revocation ordering are unobservable across the federation.""" pass def validate_credential(credential, revocation_record, issuer_is_authoritative, max_propagation_s, now): # credential: dict with iat, exp, revocation_epoch, issuer # revocation_record: dict with revoked_at, epoch, or None if credential["exp"] <= now: raise RevocationRaceError("credential expired") if revocation_record is None: if not issuer_is_authoritative: raise RevocationRaceError( "replica-issued credential with unknown revocation epoch; " "cannot order issuance vs revocation" ) if now - credential["iat"] > max_propagation_s: raise RevocationRaceError( "credential older than propagation window with no epoch record" ) return True # Epoch is the only sound ordering proof across issuers. if credential["revocation_epoch"] < revocation_record["epoch"]: raise RevocationRaceError( f"credential epoch {credential['revocation_epoch']} predates " f"known revocation epoch {revocation_record['epoch']}; " f"iat={credential['iat']} is NOT a validity proof" ) # Same epoch: credential was minted after the issuer saw this revocation. if credential["revocation_epoch"] == revocation_record["epoch"]: if not issuer_is_authoritative: raise RevocationRaceError( "replica issuer claims post-revocation epoch but is not " "authoritative; rotation may have raced the revocation feed" ) return True return True ```