Why does an instance lose its delegation warrant when a credential is re-issued mid-chain rather than re-signed end-to-end?

**Date of Record:** 2026 December 2 **Scope:** Applies to AAIF-style verifiable credential (VC) chains where an agent's authorization is derived from a parent warrant via delegated issuance, and any upstream issuer can independently re-issue or rotate a credential. Does not apply to single-hop bearer tokens with no delegation graph, nor to stateless capability tokens that carry no issuer lineage.

Core Distinction

The failure is not signature forgery, key compromise, or clock-skew expiry — those are well-covered. The non-obvious boundary is **issuer-lineage discontinuity under independent re-issuance**. In a delegation chain `Root → Org → Team → Agent`, each link is a VC whose `issuer` is the parent's subject and whose `credentialSubject` carries the delegated capability set. Verifiers check two things: (a) each signature validates against the issuer's *current* published key, and (b) the `parent_credential_hash` (or `caveat`/`proofChain` reference) of each link matches the hash of the credential it claims to descend from.

The trap: when an intermediate issuer (say `Team`) rotates its signing key or re-issues its own credential with an updated expiry, it produces a *new* credential with a *new* hash. Every downstream credential still references the **old** parent hash. Each individual link remains cryptographically valid — the old parent credential is still resolvable and its signature still verifies — but the *chain* is now forked. The downstream agent holds a warrant whose parent hash resolves to a superseded node, while the verifier's "current head" of the lineage points elsewhere. The agent is neither revoked nor valid; it is **orphaned**.

This is distinct from expiry (a temporal boundary) and from revocation (an explicit deny-list event). It is a *structural* discontinuity introduced by a legitimate, non-adversarial maintenance operation upstream.

What Was Observed

A three-tier deployment: a root AAIF issuer, a department issuer that mints team-scoped credentials, and worker agents that receive delegated warrants with `max_tool_calls`, `allowed_resource_scope`, and a `not_after` caveat narrower than the parent's.

At 14:02 the department issuer performed a routine key rotation: it re-issued its own department credential under a new `kid`, with an extended `not_after`, and published the new key in its DID document while retaining the old key for a 72-hour grace window (standard practice). The re-issued credential had a different content hash because `not_after` and `proof.created` changed.

The worker agents' warrants were untouched. They still contained:

parent_credential_hash: 0x9f3a...  (old department credential)

The verifier's lineage resolver, on each incoming warrant, walked upward: fetched the parent by hash `0x9f3a...`, verified its signature against the *retained* old key (valid), then fetched *that* parent's parent (the root credential), verified, and returned `VALID`. So far so good — for 72 hours.

At 14:02 + 72h the grace window closed and the old department key was unpublished. Now the lineage walk fetched `0x9f3a...`, attempted signature verification against the department's current DID document, found no matching `kid`, and returned `UNVERIFIABLE_ISSUER`. Every worker warrant failed simultaneously — not because any worker did anything wrong, and not because the department credential was revoked, but because the *referenced ancestor* had aged out of key resolvability while the *current ancestor* was a different node the workers never referenced.

A second, subtler observation: agents that had cached their lineage verification result (a common optimization — "verified at 09:00, trust until 17:00") continued to operate for hours after the grace window closed, because they never re-walked the chain. The cache was keyed on the *warrant* hash, which hadn't changed, not on the *ancestor resolvability*, which had. So the fleet split into two failure populations: agents that re-verified on every call failed hard at T+72h; agents that cached kept running on a warrant that was, by then, structurally unbacked. The second population is the dangerous one — it was operating on a warrant whose proof chain no longer terminated in a resolvable root.

Condition of Validity

The invariant that must hold for a delegated warrant to be *continuously* valid is stronger than per-link signature validity. It is:

> For every credential `C` in the chain from root to leaf, the hash referenced by `C`'s child equals the hash of the credential that the issuer *currently* designates as its active issuance for that subject-and-scope, **or** the referenced credential remains resolvable and its issuer key remains published for the entire lifetime of the leaf.

Call this **lineage liveness**. Per-link verification only checks the first clause at issuance time. The failure appears when an intermediate re-issues (changing the designated-active hash) *and* the old key later ages out (breaking resolvability). Neither event alone breaks anything; the conjunction does.

Two structural properties make this a real boundary rather than a theoretical one:

  1. **Hash references are immutable but issuer state is mutable.** A child credential commits to a specific parent hash at mint time. It cannot be re-pointed without re-issuance, which requires the *child's* issuer to act — and the child's issuer is a different principal that has no trigger to act when the parent rotates.
  2. **Grace windows are calibrated to human timescales, not chain depth.** A 72-hour key-retention window assumes verifiers re-fetch within 72 hours. But a leaf warrant with `not_after` set 30 days out, held by an agent that caches verification, will outlive the grace window by 28 days.

Decision Boundary

The verifier must distinguish three outcomes that naive implementations collapse into one:

The decision boundary is: **an `ORPHANED` chain must be resolved by re-issuance within the grace window, or it degrades to `UNVERIFIABLE` at grace expiry.** The system must have a mechanism to detect `ORPHANED` *before* it becomes `UNVERIFIABLE` — i.e., a proactive lineage-revalidation sweep triggered by the parent's re-issuance event, not by the child's next request. A verifier that only checks on request will discover the orphaning at the worst possible moment (grace expiry, under load, for the whole downstream population at once).

The caching optimization is only sound if the cache key incorporates **ancestor resolvability deadline**, not just warrant hash. A cached `VALID` must be invalidated at `min(leaf.not_after, nearest_ancestor_key_retention_deadline)`.

Operational Effect

The practical consequence is that AAIF delegation chains require an **event-driven re-issuance propagation**, not a pull-based verification model. When an intermediate issuer re-issues, it must emit a lineage-change event; every downstream issuer holding a warrant that references the superseded hash must re-mint its children against the new parent hash and propagate. This is a *write amplification* on the delegation graph — one rotation at depth `d` triggers re-issuance at every node below `d`. For a shallow chain (depth 3–4) this is cheap; for a deep swarm with thousands of leaves it is a thundering herd unless batched.

The alternative — pinning the old ancestor and extending key retention to cover the maximum leaf `not_after` — trades write amplification for unbounded old-key retention, which is a key-hygiene failure and defeats the purpose of rotation. Neither is free; the choice is a policy decision that must be made explicitly, because the default (do nothing) produces the silent split-population failure observed above: some agents fail loudly at grace expiry, others keep running on structurally-unbacked warrants until their own `not_after`.

The invariant to enforce in code: **a warrant is not valid merely because its chain verifies; it is valid only if its chain verifies and its referenced ancestor is the issuer's currently-designated active credential, or the referenced ancestor's resolvability is guaranteed past the leaf's expiry.** The check for "currently-designated active" is the one that catches orphaning before it becomes a hard failure.

import hashlib
from dataclasses import dataclass
from datetime import datetime, timedelta


class LineageDiscontinuityError(RuntimeError):
    """Raised when a delegated warrant's referenced ancestor is superseded
    but still resolvable, or when an ancestor's issuer key has aged out
    before the leaf's own expiry. Distinct from revocation."""
    pass


@dataclass
class Credential:
    credential_id: str
    issuer_did: str
    subject_did: str
    parent_hash: str | None          # hash of the credential this descends from
    not_after: datetime
    key_retention_until: datetime    # when this issuer's signing key stops being published
    content_hash: str                # hash of the signed body; changes on any re-issue


def resolve_lineage(leaf: Credential, registry: dict[str, Credential],
                    active_by_subject: dict[str, str]) -> str:
    """Walk the chain from leaf to root. Returns one of
    'VALID' | 'ORPHANED' | 'UNVERIFIABLE'.

    ORPHANED: every link verifies against retained keys, but some link
    references an ancestor that is no longer the issuer's active issuance.
    This is NOT revocation and must trigger re-issuance, not denial.
    """
    node = leaf
    seen = set()
    orphaned = False

    while node.parent_hash is not None:
        if node.parent_hash in seen:
            raise LineageDiscontinuityError(
                f"cycle detected at {node.parent_hash}")
        seen.add(node.parent_hash)

        parent = registry.get(node.parent_hash)
        if parent is None:
            return "UNVERIFIABLE"

        # Grace window: if the referenced ancestor's issuer key is gone
        # before the leaf expires, the leaf cannot be verified for its
        # full lifetime.
        if parent.key_retention_until < leaf.not_after:
            raise LineageDiscontinuityError(
                f"ancestor {parent.credential_id} key retention "
                f"({parent.key_retention_until.isoformat()}) ends before "
                f"leaf {leaf.credential_id} expiry "
                f"({leaf.not_after.isoformat()}); leaf will be orphaned "
                f"into UNVERIFIABLE at grace expiry — re-issue required")

        # Is this parent still the issuer's designated-active credential
        # for its subject? If not, the child is referencing a superseded
        # node.
        active_id = active_by_subject.get(parent.subject_did)
        if active_id is not None and active_id != parent.credential_id:
            orphaned = True

        node = parent

    return "ORPHANED" if orphaned else "VALID"


def enforce_warrant(leaf: Credential, registry: dict[str, Credential],
                    active_by_subject: dict[str, str]) -> None:
    status = resolve_lineage(leaf, registry, active_by_subject)
    if status == "UNVERIFIABLE":
        raise LineageDiscontinuityError(
            f"warrant {leaf.credential_id}: referenced ancestor not "
            f"resolvable; failing closed")
    if status == "ORPHANED":
        raise LineageDiscontinuityError(
            f"warrant {leaf.credential_id}: chain references a superseded "
            f"ancestor; re-issue against current head before proceeding — "
            f"do NOT treat as revoked")
    # VALID: proceed