# Which invariants prevent trust-root divergence from silently re-authorizing a revoked agent across federated DID resolvers **Date of Record:** 2026 November 25 **Scope:** Applies to multi-org agent meshes where agent identity is a DID (did:web, did:key, did:ion) and authorization is carried in signed agent cards verified against per-org resolver caches. Does not apply to single-tenant deployments with a shared trust root or to bearer-token-only A2A handoffs. ## Core Distinction There is a difference between **card validity** and **trust-root liveness**. A signed agent card is a self-verifying statement: given the issuer's DID document, the signature checks out, the `exp` is in the future, and the capabilities hash matches. That is a *local* cryptographic predicate. It says nothing about whether the issuer's DID document is still *authoritative* at the moment of the call. In a federated mesh, each participant resolves DIDs through its own resolver (often a cached or mirrored view of a shared ledger/registry). Trust-root divergence is the condition in which two resolvers return *different but individually well-formed* DID documents for the same DID, because one is serving a stale or superseded version. The card remains signature-valid against the stale document, so the verifier admits an agent whose key was rotated out or whose controller was revoked upstream. The failure is silent: no signature error, no expiry error, no schema mismatch — only an authorization that should have been denied. The invariant that prevents this is **not** "the card signature verifies." It is: *the card must be verified against a DID document whose version is at or above the revocation epoch the verifier has independently observed, and the verifier must refuse to authorize if it cannot prove it has observed a revocation epoch at least as recent as the card's issuance epoch.* Card signature verification and revocation-epoch freshness are two separate gates; collapsing them into one is the bug. ## What Was Observed A three-org federation: Org A (issuer of agent `did:web:agents.a.example`), Org B and Org C (verifiers). A's key-rotation policy rotates the agent's verification key every 24h and publishes a revocation entry for the prior key on rotation. B and C each run a resolver cache with a 15-minute TTL over the shared registry. At T0 the agent rotates its key and A publishes revocation of key `K1`, issuance of `K2`, and bumps the DID document `versionId` from 3 to 4. B's cache refreshes at T0+4m and sees version 4. C's cache had a partial refresh failure (registry returned 503 on the delta endpoint, cache served last-good) and continues to serve version 3, containing `K1`. At T0+9m a compromised process still holding `K1` presents a card signed with `K1`, `issuedAt = T0-2h`, `exp = T0+22h`. C resolves the DID, gets version 3, finds `K1` in `verificationMethod`, verifies the signature, checks `exp`, and authorizes. B, resolving version 4, rejects the same card because `K1` is absent. The mesh now has **split-brain authorization**: the same card is valid at C and invalid at B. The compromised agent does not need to forge anything; it needs only to find the verifier with the stale cache. It probes C, gets a valid session, and uses that session to call downstream tools that trust C's attestations. The trace is: 1. Rotation event at issuer → registry version 3→4, `K1` revoked. 2. Verifier cache refresh fails open (serves last-good on upstream error). 3. Card signed by `K1` arrives; verifier resolves stale doc, finds `K1`, signature passes. 4. Verifier checks `exp` only — passes. 5. Verifier issues session/attestation bound to `K1`-derived identity. 6. Downstream services trust the attestation and execute privileged tool calls. The critical observation: step 3's signature check *succeeded correctly*. The verifier did exactly what the card's crypto told it to. The failure is that the verifier never established that its view of the trust root was current enough to be authoritative. Caching a DID document without caching and comparing its `versionId`/revocation epoch against a freshness floor is the mechanism. ## Condition of Validity The guardrail holds only under these conditions, and each is load-bearing: - **Revocation epoch is monotonic and independently observable.** The verifier must be able to obtain, from a source it does not share a failure domain with, a lower bound on the current revocation epoch (e.g., a signed registry checkpoint with a sequence number, or a gossip quorum). If the only source of "current version" is the same resolver that served the stale doc, the invariant is vacuous. - **Cards carry an issuance epoch, not just a wall-clock `issuedAt`.** The card must bind to the DID document `versionId` it was issued against (or a `keyEpoch`). Without this, the verifier cannot compare card epoch to observed revocation epoch; it can only compare timestamps, which are forgeable and clock-skew-prone. - **Freshness floor is enforced as a hard gate, not a warning.** If `observed_revocation_epoch < card.key_epoch`, the verifier must reject — not log-and-allow. Fail-open caching is incompatible with this invariant. - **Attestations are epoch-scoped.** Any session token or downstream attestation minted after verification must carry the `key_epoch` it was validated under, so downstream services can reject attestations whose epoch is below their own freshness floor. Otherwise the stale authorization propagates past the verifier. If any of these is missing, the system degrades to "signature-valid ⇒ authorized," which is exactly the condition that admits revoked keys. ## Decision Boundary The boundary is between **"I verified the card"** and **"I verified the card against a trust root I can prove is not superseded."** Concretely, a verifier is on the safe side only if, at decision time: ``` observed_epoch >= card.key_epoch AND observed_epoch_source != resolver_that_served_did_doc AND (now - observed_epoch_timestamp) <= max_staleness ``` If `observed_epoch < card.key_epoch`, reject with a hard error (do not fall back to a cached allow). If the freshness source is unreachable, reject — an unreachable freshness oracle is indistinguishable from a compromised one for authorization purposes. If `max_staleness` is exceeded, treat the DID document as untrusted and re-resolve from a source outside the failing cache's domain. The non-obvious part: **a card whose `key_epoch` is *ahead* of the observed epoch is also suspect.** It may indicate the verifier's freshness source is lagging, but it may equally indicate a forged epoch claim. The safe action is to re-resolve and, if the gap persists across two independent sources, quarantine the agent and alert — not to trust the higher epoch. ## Operational Effect Enforcing the invariant changes the failure mode from *silent unauthorized admission* to *loud, bounded rejection*. In the trace above, C would have rejected the `K1` card at step 4 because `observed_epoch` (from the independent checkpoint) was 4 while `card.key_epoch` was 3. The compromised agent's probe fails closed, the split-brain is visible as a rejection spike on C, and the stale cache is flagged by the freshness-floor breach rather than discovered weeks later in an audit. The cost is availability: a verifier whose freshness oracle is down cannot authorize, even for legitimate cards. This is the correct trade for cross-org trust — the alternative is that a single stale cache becomes an authorization bypass. The operational discipline is to treat the freshness oracle as a *separate* dependency from the resolver, with its own SLO, and to make its unavailability a distinct, alertable error class rather than a generic 5xx. ```python class TrustRootDivergenceError(RuntimeError): """Raised when a signed agent card is verified against a DID document whose revocation epoch is below the card's key epoch, or when the verifier cannot prove freshness of its trust-root view.""" def authorize_agent_card( card: dict, did_doc: dict, observed_revocation_epoch: int, observed_epoch_source: str, resolver_source: str, observed_epoch_age_s: float, max_staleness_s: float = 300.0, ) -> bool: """Authorize a card only if signature validity AND trust-root freshness hold.""" if observed_epoch_source == resolver_source: # Freshness must come from a failure domain independent of the resolver. raise TrustRootDivergenceError( f"freshness source {observed_epoch_source!r} shares failure domain " f"with resolver {resolver_source!r}; cannot bound revocation lag" ) if observed_epoch_age_s > max_staleness_s: raise TrustRootDivergenceError( f"observed revocation epoch is {observed_epoch_age_s:.0f}s old " f"(> {max_staleness_s:.0f}s); trust root may be superseded" ) card_key_epoch = card.get("key_epoch") if card_key_epoch is None: raise TrustRootDivergenceError( "card lacks key_epoch binding; cannot compare to revocation epoch" ) if observed_revocation_epoch < card_key_epoch: raise TrustRootDivergenceError( f"card issued at key_epoch {card_key_epoch} but observed " f"revocation epoch is only {observed_revocation_epoch}; " f"card may be signed by a revoked key" ) if observed_revocation_epoch > card_key_epoch: # Card is behind the trust root: re-resolve before trusting. raise TrustRootDivergenceError( f"card key_epoch {card_key_epoch} lags observed epoch " f"{observed_revocation_epoch}; re-resolve from independent source" ) # Signature verification is a separate gate and must also pass. if not verify_signature(card, did_doc): raise TrustRootDivergenceError("card signature invalid against resolved DID document") return True ```