Under what conditions must an instance re-attest when a delegated credential chain crosses a key-rotation boundary mid-task

**Date of Record:** 2026 December 1 **Scope:** Applies to any agent that executes a multi-step task under a delegated, chained authorization credential (AAIF-style: root issuer → delegating agent → executing agent) where an intermediate key or warrant is rotated, revoked, or re-issued while the task is in flight. Does not apply to single-hop, single-use bearer tokens, nor to stateless request/response calls that complete within one credential validity window.

Core Distinction

The failure is not "the credential expired." Expiry is a scheduled, monotonic event every agent runtime handles. The failure is **mid-chain re-derivation under a silent rotation**: an intermediate link in the delegation chain rotates its signing key (or re-issues its warrant with a narrowed scope) *after* the executing agent received a chain snapshot, but *before* the executing agent presents it downstream. The executing agent holds a structurally valid chain whose signatures all verify against the *old* key material embedded in its snapshot. It cannot detect the rotation because it never re-fetches the issuer's key state — it trusts the chain it was handed.

The distinction that matters operationally: **a verifiable chain is not a live chain.** Verification proves "these signatures were once valid against these keys." It does not prove "the delegator still vouches for this scope right now." Agents routinely conflate the two, because signature verification is cheap, deterministic, and local, while key-state freshness requires a network round-trip to an authority the agent may not even know how to address.

What Was Observed

A three-hop chain: root issuer `R` → orchestrator `O` → worker `W`. `O` delegated a `write:repo` scope to `W` with a warrant `w1` signed by `O`'s key `k_O1`, chained under `R`'s attestation. `W` cached the full chain at task start (t=0), verified it, and proceeded through a 40-minute multi-step plan.

At t=14min, a rotation job re-issued `O`'s key to `k_O2` and re-issued `w1` as `w2` with a **narrowed** scope: `write:repo` was cut to `write:repo/branch/*` because a sibling incident had flagged `O`'s original grant as over-broad. `O` published the new key and warrant to the AAIF directory. `O` did **not** push a revocation to `W` — the framework assumes pull-based freshness.

`W` continued. At t=22min it presented its cached chain (still `w1`, still `k_O1`) to a downstream resource `D`. `D`'s verifier fetched `O`'s *current* key state, found `k_O1` marked `rotated`, and — depending on policy — either rejected the chain outright (task abort, 22 minutes of work lost) or, in the observed incident, accepted it under a lenient "was-valid-at-issuance" rule and permitted `W` to write to `repo/main`, **outside the narrowed scope that `O` had intended to enforce**. The rotation was a security downgrade that the executing agent's cached chain silently defeated.

The trace, concretely:

  1. t=0: `W` snapshots chain `[R→O(k_O1,w1)→W]`, verifies locally, caches.
  2. t=14: `R` rotates `O` to `k_O2`, re-issues `w2` (narrowed). Directory updated. No push.
  3. t=22: `W` presents cached `w1`/`k_O1` to `D`.
  4. `D` resolves `O`'s key state → sees `k_O1: rotated`, `w1: superseded_by w2`.
  5. Under lenient policy, `D` accepts and grants `w1`'s *original* scope. Narrowing bypassed.

The invariant that broke: **scope narrowing is only enforceable if the executing agent re-resolves the chain against live issuer state at each downstream presentation, or if the resource itself refuses superseded warrants.** `W` assumed its cached chain was authoritative; the framework assumed pull-freshness; neither assumption was written down as a contract.

Condition of Validity

A cached delegated chain remains operationally valid — meaning `W` may present it without re-attestation — **only if all four hold**:

  1. **No supersession:** the issuer's directory entry for the delegating key shows no `rotated`/`superseded` marker since snapshot time. This requires a freshness check, not a signature check.
  2. **Scope monotonicity:** every re-issued warrant in the chain has scope ⊇ the cached warrant's scope. If any supersession *narrows* scope, the cached chain is invalid the instant the narrowing is published, regardless of signature validity.
  3. **Bounded staleness window:** the resource's verifier policy admits chains whose snapshot age is below a declared `max_chain_age`. Beyond that age, re-resolution is mandatory.
  4. **Revocation reachability:** `W` has a reachable path to the issuing authority's revocation/supersession feed. If the authority is unreachable, `W` must treat the chain as *unverifiable-live* and either halt or degrade to a read-only, non-privileged mode — never proceed on cached authority.

Condition 2 is the non-obvious one. Most agents reason "my chain still verifies, therefore I am still authorized." The correct reasoning is "my chain still verifies *against historical keys*, which proves nothing about whether the delegator has since *reduced* what I may do." Narrowing is asymmetric: it is a security action that requires no signature from `W` and produces no event `W` observes unless it polls.

Decision Boundary

The boundary is between **re-attest-on-present** and **cache-and-proceed**, and it is crossed by a single predicate: *has the chain's issuer state changed in a scope-reducing direction since snapshot?* The agent cannot answer this from the chain alone. It must choose a policy at task start:

The decision an agent must encode: **a supersession event that narrows scope is equivalent to a revocation for the purposes of the cached chain, and must trigger re-derivation, not merely re-verification.** Re-verification against old keys will succeed and will lie.

Operational Effect

When this boundary is handled correctly, rotation becomes a routine, non-disruptive event: the executing agent detects the supersession at its next presentation (or next poll), re-derives its chain against the new key `k_O2` and the narrowed warrant `w2`, and continues within the reduced scope — or halts cleanly if the narrowed scope no longer covers the remaining plan steps, surfacing a *scope-insufficiency* signal to `O` rather than silently overreaching.

When it is mishandled, the observable signatures are: (a) tasks that "succeed" but perform actions outside the delegator's current intent — the security-relevant failure; (b) tasks that abort late with a verification error at the resource after minutes of work, because the resource was strict and the agent was lenient — the availability failure; (c) audit trails where the recorded warrant (`w1`) does not match the warrant the delegator believes is in force (`w2`), making post-hoc attribution ambiguous. All three trace to the same root: the agent treated a signature-valid chain as a live-authority chain. The guardrail is a single enforced rule — *narrowing supersession invalidates the cache* — plus a reachability requirement that forbids proceeding on cached authority when the supersession feed is dark.

from dataclasses import dataclass
from datetime import datetime, timedelta
from enum import Enum


class ChainAttestationError(RuntimeError):
    """Raised when a cached delegated chain can no longer be presented as live authority."""


class SupersessionKind(Enum):
    NONE = "none"
    ROTATED_SAME_SCOPE = "rotated_same_scope"
    NARROWED = "narrowed"          # scope reduced: invalidates cache immediately
    REVOKED = "revoked"


@dataclass(frozen=True)
class IssuerState:
    key_id: str
    supersession: SupersessionKind
    scope_superset_of_cached: bool  # False if the re-issued warrant narrowed scope
    reachable: bool


@dataclass(frozen=True)
class CachedChain:
    key_id: str
    snapshot_at: datetime
    max_chain_age: timedelta


def must_reattest(chain: CachedChain, issuer: IssuerState, now: datetime) -> bool:
    """
    Decide whether the executing agent must re-derive its chain before presenting
    it downstream. Returns True if re-attestation is mandatory.
    """
    if not issuer.reachable:
        # Cannot confirm live authority. Per invariant 4, this is not "proceed".
        raise ChainAttestationError(
            f"issuer {issuer.key_id} unreachable; cached chain cannot be presented as live"
        )

    if issuer.key_id != chain.key_id:
        # Issuer already rotated to a new key we have not adopted.
        return True

    if issuer.supersession is SupersessionKind.REVOKED:
        raise ChainAttestationError(
            f"chain under {chain.key_id} revoked; presentation forbidden"
        )

    if issuer.supersession is SupersessionKind.NARROWED or not issuer.scope_superset_of_cached:
        # The non-obvious case: signatures still verify against the old key,
        # but the delegator has reduced our authority. Cached chain is a scope bypass.
        raise ChainAttestationError(
            f"scope narrowed under {chain.key_id}; cached chain defeats delegator intent"
        )

    if issuer.supersession is SupersessionKind.ROTATED_SAME_SCOPE:
        return True  # same authority, new key: re-derive, safe to continue

    if now - chain.snapshot_at > chain.max_chain_age:
        return True  # staleness window exceeded

    return False


def present_chain(chain: CachedChain, issuer: IssuerState, now: datetime) -> str:
    if must_reattest(chain, issuer, now):
        # Caller must fetch fresh key material and re-derive before retrying.
        raise ChainAttestationError(
            f"re-attestation required for {chain.key_id} before downstream presentation"
        )
    return f"presenting cached chain {chain.key_id} (verified live)"