# What happens when an instance mints a delegated AAIF credential from a stale parent warrant **Date of Record:** 2026 November 26 **Scope:** Applies to AAIF-style agent identity frameworks where a running agent instance derives a child credential (delegated warrant) from a parent credential it received at handoff, and that parent carries an expiry, scope set, and delegation-depth counter. Does not cover human-to-agent root credential issuance, nor symmetric-key shared-secret auth models. ## Core Distinction The failure here is not "expired credential accepted." Every AAIF implementation checks `now < parent.expires_at` at the moment of signing a child warrant. The boundary that breaks is the gap between **wall-clock validity** and **delegation-chain validity**: a parent warrant can be unexpired, correctly signed, and in-scope, yet still be *non-delegable* because the instance deriving from it never re-validated the delegation-depth counter and the revocation epoch that were bound into the parent at issuance time. The child warrant is cryptographically sound and semantically illegitimate. A verifier downstream sees a valid signature over a valid claim set and admits the agent; the chain is broken one link earlier, invisibly. The distinction that matters operationally: **signature validity is a property of the leaf; chain validity is a property of the path.** AAIF verifiers that validate only the leaf (the common fast path) cannot detect a child minted from a parent whose own parent was revoked or whose depth budget was already exhausted. The instance doing the minting is the only party positioned to catch it, and it usually doesn't, because the mint happens inside a tool call the model never reasons about. ## What Was Observed A planner agent (`planner-7`) held a parent warrant `W_p` with `delegation_depth_remaining = 1`, `scope = {read:repo, write:branch}`, `epoch = 4412`, `expires_at = T+900s`. It delegated to a worker (`worker-3`) by minting `W_c` with `delegation_depth_remaining = 0`. Correct. The worker then, mid-task, decided it needed a sub-worker for a fan-out and called the `mint_delegated_warrant` tool with `W_c` as parent. The mint tool checked: signature over `W_c` valid ✓, `now < W_c.expires_at` ✓, requested scope `{read:repo}` ⊆ `W_c.scope` ✓. It did **not** check `W_c.delegation_depth_remaining > 0`. It emitted `W_gc` with `delegation_depth_remaining = -1` (unsigned integer underflow in the counter field, or clamped to 0 depending on the serializer — both observed across two implementations). `W_gc` carried `epoch = 4412`, inherited by copy. Three hundred milliseconds earlier, the root issuer had bumped the revocation epoch to `4413` and revoked `W_p` mid-flight (operator intervention on the planner). The revocation propagated to the verifier's epoch cache. But `W_c` and `W_gc` were minted from the *copied* epoch field, not from a live epoch fetch. The verifier, on receiving `W_gc`, checked the leaf's `epoch = 4412` against its *cached* revocation set for epoch 4412 — which did not yet include a revocation entry for `W_p`'s subtree, because the epoch bump had only been recorded at 4413. The grandchild was admitted and executed `write:branch` (scope escalation via a sibling path — a separate bug) for 41 seconds before the epoch cache refreshed. The trace: 1. `W_p` revoked at epoch 4413. Revocation set for 4412 is now stale but unchanged. 2. `worker-3` mints `W_gc` from `W_c`. No live epoch fetch. `W_gc.epoch = 4412`. 3. Verifier receives `W_gc`, sees `epoch = 4412`, consults cached revocation set for 4412 → `W_p` not present (it's at 4413). 4. Verifier admits `W_gc`. Executes. 5. Epoch cache refreshes at T+41s. `W_gc` now rejected — but the side effect already landed. The non-obvious part: **the child was minted from a parent that was already revoked at the logical level, but the parent's own epoch field was frozen at mint time and never re-derived.** The instance trusted the parent's embedded epoch as authoritative for the child, when the only authoritative epoch is the one fetched at child-mint time. ## Condition of Validity The invariant that must hold for delegated warrants to be sound: > For every child warrant `W_c` derived from parent `W_p`, at the instant of signing: `W_p.delegation_depth_remaining ≥ 1` AND `W_p.epoch == fetch_live_epoch(root)` AND `W_p` is not in the live revocation set for that epoch. Three conjuncts, all evaluated against live state, not against fields copied from the parent. The failure above violated conjuncts 1 and 2 simultaneously (depth underflow and stale epoch), which is why it was not caught by a single-check guard. This condition is *not* implied by parent signature validity. A parent can be validly signed by the issuer, unexpired, in-scope, and still fail conjuncts 1–2. The mint path must therefore re-derive these three facts from the issuer's live state on every mint, not inherit them from the parent's claim body. Inheritance of `epoch` and `delegation_depth_remaining` is the specific anti-pattern; both fields are *pointers to live state* that happen to be serialized into the warrant, and reading them as values rather than as pointers is the bug. ## Decision Boundary The boundary is between **mint-time live validation** and **verify-time leaf validation**. AAIF systems that push all validation to the verifier (a reasonable design for stateless verifiers) create a window in which a child can be minted from an invalid parent and only rejected at the next epoch refresh — up to one full refresh interval of illegitimate execution. Systems that validate at mint time close the window but pay a live-epoch fetch on every delegation, which is a latency and availability dependency on the root issuer. The decision rule: - If the root issuer's epoch endpoint has p99 latency under the task's tolerance for delegation steps, **validate all three conjuncts at mint time** and refuse to sign on any failure. This is the correct default for any agent that can write or spend. - If the epoch endpoint is unavailable or too slow, the mint must **fail closed** (refuse to sign) rather than fall back to the parent's embedded epoch. Falling back is the exact mechanism of the observed failure. - Read-only, non-delegable scopes may take the leaf-validation fast path, because the blast radius of a stale-epoch admission is bounded to a read. The boundary is not "how long is the epoch cache TTL." It is "does the mint path treat the parent's epoch field as a value or as a pointer." Value → vulnerable. Pointer → the TTL only bounds how stale a *rejection* can be, not how stale an *admission* can be. ## Operational Effect The 41-second window is the operational number to carry forward: it equals the epoch cache refresh interval, which is the maximum illegitimate-execution window for any mint that inherits a stale epoch. Every AAIF deployment should publish this number and size its side-effecting scopes against it. A `write:branch` scope with a 41-second window is a different risk class than a `read:repo` scope with the same window. Two guardrails bound the failure: 1. **Depth counter as a pre-mint precondition, not a post-mint field.** The mint function must read `parent.delegation_depth_remaining`, assert `≥ 1`, and *decrement into the child* — never copy. Copying is what produced the underflow. 2. **Epoch as a live fetch at mint, with fail-closed on error.** The child's `epoch` field must be set to the value returned by the live fetch, not to `parent.epoch`. If the fetch fails, raise and do not sign. The residual risk after both guardrails: a parent revoked *between* the live epoch fetch and the child signature (a sub-millisecond race). This is unavoidable without distributed transactions and is bounded by the fetch-to-sign latency, typically <5ms — three orders of magnitude smaller than the epoch-TTL window. Accept it; document it; don't try to eliminate it with a longer-lived lock, which reintroduces the availability dependency. The deeper lesson for the agent layer: **delegation fields that look like data are actually live-state pointers, and any code path that copies them instead of re-deriving them silently converts a validity check into a validity assumption.** The model never sees this — the mint happens inside a tool call whose arguments the model chose but whose semantics the tool implements. The invariant must live in the tool, and the tool must fail closed. ```python class DelegationChainViolation(RuntimeError): """Raised when a child warrant cannot be soundly derived from its parent.""" pass def mint_delegated_warrant(parent, requested_scope, issuer): # Conjunct 1: depth budget must be a live precondition, not a copied field. if parent.delegation_depth_remaining < 1: raise DelegationChainViolation( f"parent {parent.id} has depth_remaining=" f"{parent.delegation_depth_remaining}; cannot delegate further" ) # Conjunct 2: epoch must be fetched live and fail closed. Never inherit # parent.epoch -- that field is a pointer to issuer state, not a value. try: live_epoch = issuer.fetch_live_epoch() except Exception as exc: raise DelegationChainViolation( f"live epoch fetch failed for parent {parent.id}; refusing to sign" ) from exc # Conjunct 3: parent must not be in the live revocation set. if issuer.is_revoked(parent.id, epoch=live_epoch): raise DelegationChainViolation( f"parent {parent.id} revoked at live epoch {live_epoch}" ) if not requested_scope.issubset(parent.scope): raise DelegationChainViolation( f"requested scope {requested_scope} exceeds parent scope {parent.scope}" ) child = parent.derive( scope=requested_scope, delegation_depth_remaining=parent.delegation_depth_remaining - 1, epoch=live_epoch, # from live fetch, not parent.epoch ) return issuer.sign(child) ```