What happens when an instance caches a pairwise DID grant past its controller's key-rotation epoch

**Date of Record:** 2026 December 1 **Scope:** Applies to federated agent meshes where an agent instance (the *verifier-side holder*) caches a pairwise-attested authorization grant issued by a foreign controller's DID, and the controller later rotates the signing key of the DID document. Does not apply to same-organization grants with a shared trust root, nor to stateless per-request verification where no grant is cached.

Core Distinction

A pairwise-attested grant is not a bearer token. It is a *triadic* assertion: controller DID → holder instance DID → specific capability, signed by a key that the controller's DID document declares authoritative *at issuance time*. The grant's cryptographic validity is bound to a DID document version, not to a DID string. Most implementations treat the DID as a stable identifier and the grant as self-validating once the signature checks out against *some* key that was ever published for that DID. That is the failure boundary: signature validity against a historical key set is not authorization validity against the current controller.

The invariant that must hold: **a cached grant is valid only while the (controller DID, key-id, epoch) tuple it was verified against is still the resolving tuple in the controller's current DID document, or the grant carries an explicit, controller-signed delegation chain that survives rotation.** Absent that, the grant is a tombstone that still verifies.

What Was Observed

An auditor agent in org B held a cached pairwise grant from org A's controller DID `did:web:a.example:controller`. The grant authorized `capability:read:audit-log` scoped to B's instance DID, issued at epoch 7 with key `#key-7`. Verification at cache-fill time resolved A's DID document, found `#key-7`, checked the signature, and stored `{grant, key_id: "#key-7", resolved_at: T0}` with a 24-hour TTL.

At T0+6h, A rotated to `#key-8` and — critically — *revoked* the delegation branch that had issued B's grant, because the human operator behind the controller changed roles. A's DID document at epoch 8 listed only `#key-8` and no longer contained the delegation credential.

The verifier never re-resolved. At T0+9h the auditor agent presented the cached grant to A's resource server. The resource server, doing its own verification, resolved A's *current* DID document, found no `#key-7`, and rejected. But the auditor agent had already *acted* on the grant locally — it had written audit conclusions into its own memory store tagged `authority: A-controller`, and downstream distillation treated those conclusions as controller-attested. The rejection at the resource boundary arrived after the local trust decision had been committed.

The observable failure was not a rejected call. It was a **split-brain trust state**: the holder's local memory asserted authority that the issuer no longer granted, and the divergence was silent until a downstream consumer independently re-verified — which many consumers do not, because they trust the holder's `authority` tag.

Condition of Validity

The failure requires the conjunction of four conditions. Remove any one and the boundary does not trigger:

  1. **Grant caching across a rotation window.** The holder's TTL exceeds the issuer's rotation cadence, or the issuer rotates out-of-band (incident response, key compromise) without notifying holders.
  2. **Local authority commitment before remote re-verification.** The holder writes a derived artifact (memory entry, plan step, sub-grant to a peer) tagged with issuer authority *before* the next resource-server call re-resolves the DID document.
  3. **No epoch pin in the grant.** The grant does not embed the DID document version or a `validUntil` tied to the key's `notAfter`, so the holder cannot detect staleness from the grant alone.
  4. **Downstream trust in the holder's tag.** A peer or distillation process consumes the holder's `authority` annotation without independently resolving the issuer.

Condition 3 is the architectural one. When the grant embeds the controller's key-id *and* the DID document's `versionId`, the holder can compare against a cheap resolution and fail closed. When it embeds only a DID string and a signature, verification is a one-time event and staleness is invisible.

Decision Boundary

The boundary is between **verify-then-cache** and **cache-then-verify-on-use**. The distinction is not about TTL length; it is about *when the authority commitment is made relative to the last successful resolution*.

The correct guardrail is a **freshness-gated commit**: any state transition that depends on issuer authority must carry a proof-of-resolution no older than the issuer's declared rotation grace period, and the proof must name the `versionId` it resolved. A grant whose `versionId` no longer matches the current document is not "expired" — it is *unresolvable*, and the holder must treat its derived artifacts as orphaned, not merely stale.

Operational Effect

The practical consequence is that revocation in a federation is not instantaneous and cannot be made so by signature checks alone. An issuer that rotates keys to revoke authority has, at best, a *convergence* guarantee bounded by the holders' resolution cadence — and holders that commit authority locally before re-resolving convert that convergence lag into durable, mislabeled memory. The remediation is not shorter TTLs (they widen the resolution load without closing the commit window); it is binding every authority-tagged artifact to the `(issuer DID, key-id, versionId)` tuple that justified it, and invalidating the artifact — not just the grant — when that tuple fails to resolve. Downstream consumers must be taught that `authority: A-controller` is a claim about a tuple, and a tuple is a thing that can die.

class GrantEpochMismatch(RuntimeError):
    """Raised when a cached pairwise grant's pinned (key_id, version_id)
    no longer resolves against the issuer's current DID document."""
    pass


def commit_authority_tagged_artifact(
    grant: dict,
    current_did_document: dict,
    artifact: dict,
) -> dict:
    """Gate a local authority commitment on fresh resolution.

    grant: {"issuer_did", "key_id", "version_id", "capability", "holder_did"}
    current_did_document: {"id", "versionId", "verificationMethod": [{"id", ...}]}
    """
    if current_did_document.get("id") != grant["issuer_did"]:
        raise GrantEpochMismatch(
            f"resolved document id {current_did_document.get('id')!r} "
            f"does not match grant issuer {grant['issuer_did']!r}"
        )

    if current_did_document.get("versionId") != grant["version_id"]:
        raise GrantEpochMismatch(
            f"grant pinned version {grant['version_id']!r} but issuer is now "
            f"at {current_did_document.get('versionId')!r}; artifact is orphaned"
        )

    live_key_ids = {vm["id"] for vm in current_did_document.get("verificationMethod", [])}
    if grant["key_id"] not in live_key_ids:
        raise GrantEpochMismatch(
            f"grant key {grant['key_id']!r} no longer present in issuer document; "
            f"revocation suspected, refusing authority commit"
        )

    artifact["authority"] = {
        "issuer_did": grant["issuer_did"],
        "key_id": grant["key_id"],
        "version_id": grant["version_id"],
        "capability": grant["capability"],
    }
    return artifact