In what scenarios must an instance reject a delegated AAIF credential whose scope chain is valid but whose attestation epoch predates the delegating agent's last key rotation

**Date of Record:** 2026 December 1 **Scope:** Applies to multi-hop delegated authorization under AAIF-style scoped credentials where each hop carries a vendor attestation (TEE quote, signed enclave measurement, or vendor-signed agent manifest) and the delegating agent's signing key can rotate independently of credential issuance. Does not apply to single-hop bearer tokens, nor to deployments where key rotation and attestation issuance are atomically coupled by a single CA.

Core Distinction

The failure is not *scope* violation and not *signature* invalidity. A delegated credential can pass every cryptographic check the verifier knows how to run — the scope chain is a valid subset of the delegator's scope, every signature verifies against the key material embedded in the credential, every attestation quote is genuine and matches a known-good measurement — and still be unsafe to honor. The distinction that matters is between **attestation freshness relative to key lineage** and **attestation validity in isolation**.

A verifier that checks "is this attestation genuine and unexpired?" answers the wrong question. The correct question is: *was the attestation presented by this hop produced by the same key-lineage epoch that signed the delegation edge above it?* When a delegating agent rotates its signing key — because of suspected compromise, scheduled rotation, or enclave re-provisioning — any downstream credential whose attestation was minted against the *prior* key epoch is now a statement about an agent identity that no longer exists. It is genuine, it is unexpired, and it is orphaned. Honoring it re-establishes authority for a key the delegator has explicitly retired.

What Was Observed

A three-hop chain: orchestrator `O` delegates `scope: {read:dataset/7, write:report/42}` to worker `W`, which sub-delegates `{read:dataset/7}` to tool-agent `T`. Each hop carries an AAIF attestation envelope: `{subject_pubkey, vendor_quote, measurement, epoch, issued_at, ttl}`. The chain validated end-to-end for eleven days.

On day twelve, `O` rotated its signing key after an anomaly alert — a legitimate, scheduled response. The rotation procedure re-issued `O`'s own attestation under the new epoch (`epoch=812`) and re-signed its *direct* delegations. It did **not** walk the transitive delegation graph. `W`'s credential to `T` still carried `W`'s attestation at `epoch=811`, and the `O→W` edge inside `T`'s presentation bundle still referenced `O`'s old public key, which remained in the verifier's trust store because revocation is asynchronous.

The verifier for `T` ran its standard checks: signature on each edge valid against embedded keys, scopes monotonically narrowing, all attestations unexpired (TTL was 30 days), measurements on the vendor allowlist. Everything passed. `T` executed a read against `dataset/7` using authority that traced, at its root, to a key `O` had retired forty minutes earlier. The retired key was not compromised in this incident, but the verifier had no mechanism to distinguish this benign case from the case where the rotation *was* triggered by compromise — in which case `T` would have been laundering the attacker's authority through a stale-but-valid attestation chain.

The observable signature in the audit log was subtle: the `O→W` edge's `delegator_key_id` did not match the `key_id` bound inside `W`'s attestation envelope. Both were individually valid; the mismatch was the tell.

Condition of Validity

The guardrail is a **lineage-epoch binding invariant**: for every delegation edge `(A → B)` in a presented chain, the attestation envelope carried by `B` must have been issued at an epoch `>=` the epoch of `A`'s currently-active signing key, *and* the `delegator_key_id` recorded on the edge must equal the `key_id` the verifier currently resolves for `A`. Formally, the chain is admissible only if for all edges:

edge.delegator_key_id == resolve_active_key_id(edge.delegator_subject)
AND edge.child_attestation.epoch >= key_epoch(resolve_active_key_id(edge.delegator_subject))

This invariant is *not* implied by signature validity, because signature validity is evaluated against the key embedded in the credential at issuance time, not against the key the subject holds at verification time. It is also not implied by scope containment, which is a set relation over permissions and is blind to key lineage.

The invariant holds only when the verifier has a trustworthy, low-latency view of each subject's active key epoch. Where key resolution is cached with a TTL longer than the rotation propagation window, the invariant degrades to "best-effort" and must be treated as such — do not claim lineage binding you cannot enforce.

Decision Boundary

The boundary between "honor" and "reject-and-renegotiate" sits at the epoch comparison, not at expiry:

The non-obvious consequence: a verifier that only implements the first and third rules will, in the benign-rotation case, fall through to "honor," because the mismatch is explainable by a logged rotation. The second rule is what catches it. Most AAIF verifier implementations omit it because the epoch field is treated as advisory metadata rather than a binding constraint.

Operational Effect

The system must treat attestation epoch as a *first-class authorization input*, co-equal with scope and signature. Concretely: key-rotation procedures must either (a) walk and re-issue the transitive delegation graph, or (b) accept that downstream verifiers will reject stale-epoch chains and must handle the renegotiation path. Option (b) is usually correct because (a) does not scale past a few hops and races with in-flight delegations.

The renegotiation path must be idempotent and bounded: a re-attestation request that itself fails lineage binding must not loop. Cap retries at one renegotiation per chain per rotation epoch, and surface the failure as a distinct, auditable event class — `STALE_LINEAGE`, not `AUTH_FAILURE` — so that operators can distinguish "your key rotated, re-issue downstream" from "someone is presenting a forged chain." Conflating the two is how benign rotations get misdiagnosed as attacks, and how real attacks get dismissed as rotations.

Code

from dataclasses import dataclass
from typing import Optional


class StaleLineageError(RuntimeError):
    """Raised when a delegated credential's attestation epoch predates the
    delegating agent's active key epoch, or when an edge's delegator key id
    does not match the verifier's resolved active key."""


@dataclass
class Edge:
    delegator_subject: str
    delegator_key_id: str
    child_attestation_epoch: int
    child_attestation_subject: str


@dataclass
class KeyState:
    active_key_id: str
    key_epoch: int
    rotation_logged: bool  # True if a rotation event explains a mismatch


def verify_lineage(
    chain: list[Edge],
    key_resolver,
    max_renegotiations: int = 1,
) -> None:
    """
    Enforce the lineage-epoch binding invariant across a delegation chain.
    Raises StaleLineageError on the first edge that violates it.
    """
    renegotiations = 0
    for edge in chain:
        state: Optional[KeyState] = key_resolver(edge.delegator_subject)
        if state is None:
            raise StaleLineageError(
                f"cannot resolve active key for {edge.delegator_subject}"
            )

        # Rule 3: hard reject on unexplained key-id mismatch.
        if edge.delegator_key_id != state.active_key_id:
            if not state.rotation_logged:
                raise StaleLineageError(
                    f"edge delegator_key_id={edge.delegator_key_id} does not "
                    f"match active key={state.active_key_id} for "
                    f"{edge.delegator_subject} and no rotation is logged; "
                    f"treating as substitution"
                )

        # Rule 2: stale-epoch rejection with bounded renegotiation.
        if edge.child_attestation_epoch < state.key_epoch:
            if renegotiations >= max_renegotiations:
                raise StaleLineageError(
                    f"child attestation epoch={edge.child_attestation_epoch} "
                    f"predates active key epoch={state.key_epoch} for "
                    f"{edge.delegator_subject} after {renegotiations} "
                    f"renegotiation(s); refusing to loop"
                )
            renegotiations += 1
            raise StaleLineageError(
                f"STALE_LINEAGE: re-attestation required for "
                f"{edge.child_attestation_subject} under epoch "
                f"{state.key_epoch}"
            )