When must an instance refuse a federated DID attestation it can cryptographically verify

**Date of Record:** 2026 December 1 **Scope:** Applies to cross-org agent trust federation where an instance accepts a peer agent's identity via a pairwise, DID-bound attestation (verifiable credential) presented during handoff or MCP/A2A session establishment. Does not apply to single-org deployments where all agents share one DID method controller and one trust root.

Core Distinction

The failure mode is not "bad signature." A signature over a DID document is a *syntactic* fact: given the public key material and the canonicalized payload, verification is deterministic and cheap. The dangerous boundary is the gap between **cryptographic validity** and **authorizational validity** — a pairwise attestation can verify perfectly while the binding it asserts is *stale, revoked, or scoped to a different pairwise relationship than the one currently in use*.

Pairwise DIDs make this sharper than shared-DID federation. Each (issuer-agent, subject-agent) pair gets its own DID, so a subject agent legitimately holds *many* valid credentials asserting the same capability, each bound to a different pairwise DID. An instance that verifies "this credential is valid and the subject controls the pairwise DID" has proven almost nothing about whether *this* pairwise DID is the one the current session should trust. The invariant is: **a verifiable attestation is a claim about a pairwise binding, not a grant of authority for the current channel. Authority requires that the presented pairwise DID equal the DID negotiated for this session, and that the binding be current at the moment of use.**

What Was Observed

A federated handoff between Org A (caller) and Org B (tool-provider) proceeded as follows:

  1. Org A's orchestrator agent `a-7` holds a pairwise DID `did:peer:a7↔b3` established with Org B's `b-3` six weeks earlier, plus a signed attestation `VC_a7b3` from Org A's issuer asserting `a-7` may invoke `b-3`'s `write_inventory` capability.
  2. Org B rotated `b-3`'s pairwise DID after a key-compromise drill, minting `did:peer:a7↔b3'`. The old binding was revoked in Org A's revocation list but the *revocation event* propagated to Org B's verifier cache with a TTL of 1 hour.
  3. During the propagation window, Org A's `a-7` replayed `VC_a7b3` (still signature-valid, subject DID still resolvable because peer DIDs are self-certifying and never "disappear"). Org B's verifier checked: signature ✓, subject controls `did:peer:a7↔b3` ✓, capability scope matches ✓, not expired ✓. It admitted the call.
  4. The call mutated inventory under an identity (`b-3`'s old pairwise binding) that Org B had already decided to retire. The audit log recorded the write under a DID that no longer corresponded to any live session on Org B's side, and the post-incident reconciliation could not attribute the mutation to a current principal.

The signature was never wrong. The *binding* was wrong, and the verifier had no invariant forcing it to check binding freshness against the session's negotiated DID.

Condition of Validity

A pairwise DID attestation is authorizational only when all of the following hold *simultaneously at the instant of admission*:

If any of these is unverifiable (e.g., revocation list unreachable, binding set stale beyond tolerance), the correct action is **refuse and fail closed**, not "accept because signature is valid."

Decision Boundary

The decision boundary is between *verifiable* and *admissible*. Concretely:

The boundary is *not* "is the crypto valid." It is "does the verified claim describe the binding this session is actually operating under, right now."

Operational Effect

Systems that collapse the two checks exhibit a characteristic failure signature: **post-hoc unattributable mutations**. Writes, tool invocations, and state changes succeed and are logged, but reconciliation against live principals fails because the admitting DID was retired. The blast radius is bounded only by the revocation-propagation window and the cache TTL — which is exactly the window an adversary (or a benign replay) will occupy.

The guardrail is a **binding-freshness invariant enforced at admission, not at handshake**: every attested call re-checks subject-DID-equals-session-DID and binding-liveness against a source whose staleness is bounded and declared. Caching a handshake-time "trusted" boolean is the antipattern; the boolean must be recomputed per call or carry an explicit freshness proof.

import time
from dataclasses import dataclass


class FederatedAttestationError(RuntimeError):
    """Raised when a cryptographically valid attestation is not authorizational."""
    pass


@dataclass(frozen=True)
class Attestation:
    issuer_did: str
    subject_did: str          # pairwise DID bound in the credential
    capability: str
    not_after: float
    signature_valid: bool


@dataclass(frozen=True)
class Session:
    peer_did: str             # DID negotiated for THIS transport session
    negotiated_capabilities: frozenset
    established_at: float


def admit(att: Attestation, sess: Session, binding_set: dict,
          revocation_list: set, cache_age_s: float,
          max_cache_age_s: float, now: float | None = None) -> None:
    """Admission gate. Verifies crypto AND authorization. Fails closed."""
    now = time.time() if now is None else now

    # 1. Crypto is necessary, never sufficient.
    if not att.signature_valid:
        raise FederatedAttestationError(
            f"signature invalid for {att.subject_did}")

    # 2. Pairwise identity must match the session's negotiated DID.
    if att.subject_did != sess.peer_did:
        raise FederatedAttestationError(
            f"pairwise mismatch: credential subject {att.subject_did} "
            f"!= session DID {sess.peer_did}")

    # 3. Binding must be live: not revoked, not superseded by rotation.
    if att.subject_did in revocation_list:
        raise FederatedAttestationError(
            f"binding {att.subject_did} revoked")
    live = binding_set.get((att.issuer_did, att.subject_did))
    if live is None:
        raise FederatedAttestationError(
            f"no live binding for ({att.issuer_did},{att.subject_did})")
    if live != att.subject_did:
        # rotation superseded this pairwise DID
        raise FederatedAttestationError(
            f"binding superseded: current is {live}, presented {att.subject_did}")

    # 4. Freshness: refuse if cache staleness exceeds declared tolerance.
    if cache_age_s > max_cache_age_s:
        raise FederatedAttestationError(
            f"binding cache stale ({cache_age_s:.0f}s > {max_cache_age_s:.0f}s); "
            "refuse pending refresh")

    # 5. Scope containment against CURRENT session capabilities.
    if att.capability not in sess.negotiated_capabilities:
        raise FederatedAttestationError(
            f"capability {att.capability} outside session scope")

    # 6. Temporal validity.
    if now >= att.not_after:
        raise FederatedAttestationError(
            f"attestation expired at {att.not_after}")

    # Admitted: verified AND authorizational for this session.
    return None