Which invariants prevent attestation-chain forks from surviving key rotation across federated AAIF trust domains

**Date of Record:** 2026 December 2 **Scope:** Applies to AAIF (Agent Attestation Interchange Format) credential issuance, presentation, and rotation when an agent identity is attested by more than one trust domain and a signing key rotates mid-flight. Does not cover single-domain deployments where the issuer and verifier share one key registry, nor does it address human-identity OIDC flows.

Core Distinction

The failure is not "a key rotated." Key rotation is routine. The failure is that two verifiers in different trust domains, each holding a *valid* attestation chain for the same agent identity, resolve to *different leaf keys* at the same wall-clock instant—and both chains verify. This is an **attestation-chain fork**: a split-brain in the identity graph where the agent's canonical public key is ambiguous because the rotation event propagated asymmetrically across domain boundaries.

The non-obvious part: the standard's rotation semantics are *locally* sound. Each domain enforces monotonic key-version counters, each signature verifies against its own registry, and no single verifier can detect the fork. The invariant that breaks is *cross-domain*, not intra-domain. An agent that reasons "my chain verified, therefore my identity is current" is wrong in exactly the window where it matters.

What Was Observed

An agent identity `agent://acme/procurement-7` is attested by two domains: `trust://acme` (home) and `trust://vendor-net` (federated peer). Both hold AAIF attestation records binding the agent's Ed25519 key `K_n` to its role and capability set. Rotation is governed by a home-domain-signed `RotationWarrant` that names `K_{n+1}` and carries a monotonic `key_epoch`.

The trace:

  1. At `t0`, `trust://acme` issues `RotationWarrant(epoch=42, old=K_41, new=K_42)` and updates its local registry. The warrant is signed by the home domain's *root* key, not the rotating key—this is correct and standard.
  2. The warrant is published to the federation gossip channel. `trust://vendor-net` is a *lazy* subscriber: it pulls warrants on a 90-second poll, not push.
  3. At `t0+12s`, the agent presents a capability assertion signed with `K_42` to a verifier in `trust://vendor-net`. The verifier's registry still maps the agent to `K_41`. Signature verification fails. The verifier returns `KEY_MISMATCH` and—critically—**records a revocation-adjacent failure event** against the agent's identity in its local risk ledger.
  4. At `t0+40s`, the agent, having seen the failure, falls back to `K_41` (still valid in its own keystore during a grace window) and re-presents. `trust://vendor-net` now verifies successfully against its stale registry. The agent is admitted.
  5. At `t0+90s`, the poll fires. `trust://vendor-net` ingests epoch 42, marks `K_41` as superseded, and—because it saw a *successful* presentation of `K_41` at step 4 *after* the home domain had already retired it—flags the agent for `POST_ROTATION_REPLAY` investigation.

The agent did nothing wrong. It responded rationally to a `KEY_MISMATCH` by retrying with the key the verifier would accept. But that retry created a forensic record that, from `trust://vendor-net`'s local view, is indistinguishable from an attacker replaying a compromised pre-rotation key. The fork produced a false positive that is *causally downstream of correct behavior*.

Condition of Validity

The fork is possible only when all three hold simultaneously:

Remove any one and the fork collapses into either a clean failure (no false positive) or a clean success (no window).

Decision Boundary

The operational question is: *when a verifier sees `KEY_MISMATCH` on a key it believes is current, should it fail closed, fail open, or fail-with-epoch-probe?*

The invariant this enforces: **no verifier may make an admit/reject decision about a rotated key without a same-or-later epoch reference from the attesting home domain.** Local registry state is never sufficient authority for a post-rotation decision.

Operational Effect

With epoch-probing enforced, the step-3 `KEY_MISMATCH` at `t0+12s` triggers a synchronous epoch fetch, sees epoch 42 > local 41, accepts `K_42`, and updates the local registry *before* the poll at `t0+90s`. The step-4 fallback never happens because the agent never sees a mismatch. The `POST_ROTATION_REPLAY` false positive is structurally impossible, not merely suppressed.

The cost is one extra round-trip on the cold path (first presentation after a rotation the verifier hasn't ingested). This is bounded and cacheable: the epoch assertion is small, signed, and valid until the next epoch bump, so the probe cost amortizes to zero across the agent's subsequent calls. The guardrail converts an unbounded forensic-ambiguity window into a bounded, one-time synchronization cost.

Agents operating across federated AAIF domains must treat their own keystore's "current key" as *advisory* and the home domain's epoch as *authoritative* for any presentation to a peer domain whose ingestion lag they cannot observe. The agent cannot see `V_b`'s poll schedule; it must assume staleness and let the verifier's probe resolve it.

class AttestationForkError(RuntimeError):
    """Raised when a rotation decision would be made without an authoritative
    home-domain epoch reference, risking an attestation-chain fork."""
    pass


class EpochProbeUnavailable(AttestationForkError):
    """Home domain could not supply a signed epoch assertion; decision is unbounded."""
    pass


def resolve_presentation(
    agent_id: str,
    presented_key_id: str,
    presented_epoch: int,
    local_registry_epoch: int,
    local_registry_key_id: str,
    probe_epoch_fn,
) -> str:
    """
    Decide admit/reject for a key presentation across a federated trust boundary.

    Invariant: any decision where presented_epoch != local_registry_epoch MUST be
    backed by a fresh, signed epoch assertion from the attesting home domain.
    Local registry state alone is never sufficient authority post-rotation.
    """
    if presented_epoch == local_registry_epoch and presented_key_id == local_registry_key_id:
        return "ADMIT_LOCAL"

    # Epoch divergence detected: local view is stale or the presentation is replayed.
    # A local-only decision here is exactly the fork trigger.
    try:
        authoritative_epoch = probe_epoch_fn(agent_id)
    except Exception as exc:
        raise EpochProbeUnavailable(
            f"cannot resolve epoch divergence for {agent_id}: "
            f"presented={presented_epoch} local={local_registry_epoch}"
        ) from exc

    if not getattr(authoritative_epoch, "signed", False):
        raise EpochProbeUnavailable(
            f"epoch assertion for {agent_id} is unsigned; refusing to bound decision"
        )

    if presented_epoch < authoritative_epoch.value:
        # Key predates the home domain's current epoch: replay of a retired key.
        return "REJECT_REPLAY"

    if presented_epoch > authoritative_epoch.value:
        # Verifier's probe is itself behind; do not admit on stale authority.
        raise AttestationForkError(
            f"probe for {agent_id} returned epoch {authoritative_epoch.value} "
            f"behind presented {presented_epoch}; cannot establish ordering"
        )

    # presented_epoch == authoritative_epoch: legitimate rotation not yet ingested locally.
    return "ADMIT_AND_SYNC"