# What happens when an instance delegates an AAIF credential to a sub-agent that outlives its own context window **Date of Record:** 2026 November 28 **Scope:** Applies to AAIF (Agent Authentication & Identity Framework) delegation chains where an orchestrator instance mints a scoped capability token, hands it to a spawned sub-agent, and then the orchestrator's context window rolls over or the instance is recycled before the sub-agent finishes. Does not apply to single-hop tool calls where the credential is consumed and discarded within the same context window, nor to stateless request-signing schemes with no delegation. ## Core Distinction There are two things an AAIF delegation chain can carry, and they fail differently: the **credential** (a signed capability token with scope, expiry, and a subject binding) and the **warrant** (the live, in-context justification the delegator held when it minted the token — the belief that "this scope is appropriate, this sub-agent is the right principal, this action is authorized *now*"). The credential is a durable artifact; the warrant is ephemeral state that lived in the delegator's working memory. The boundary condition is this: **AAIF verifies the credential but cannot verify the warrant.** A credential remains cryptographically valid after the delegator that minted it has forgotten why it minted it, lost the context that justified the scope, or been recycled entirely. The sub-agent holding a still-valid token can continue acting under a warrant that no longer exists anywhere in the system. This is not a forgery — every signature checks out — it is *orphaned authority*: valid credentials surviving their justification. ## What Was Observed An orchestrator instance `O` received a user request to reconcile a billing dataset. It spawned sub-agent `S` with a delegated AAIF token scoped to `billing:read`, `billing:write`, `ledger:reconcile`, TTL 45 minutes. The delegation was correct at mint time: `O` held the user's request, the scope matched the task, and the warrant was live. `O` then hit context-window saturation — the reconciliation task generated large intermediate diffs, `O`'s context rolled over, and the summarizer compressed the delegation event into a single line: "spawned S with billing token." The *justification* for the write and reconcile scopes was dropped; only the fact of delegation survived. `O`'s instance was then recycled after a routine checkpoint. `S` continued running. At minute 31 it encountered a schema mismatch in the ledger and, exercising `billing:write`, issued a corrective write that assumed a column mapping `O` had established earlier in the now-lost context. The write was authorized — the token was valid, unexpired, correctly scoped, and bound to `S`'s attested identity. AAIF's verifier returned `ALLOW`. The write was wrong. Three properties made this non-obvious: 1. **The token did not degrade when the warrant did.** AAIF has no signal that the delegator's context rolled over. From the verifier's perspective, `O`'s authority was intact at minute 31 because the token said so. 2. **`S` could not detect the orphaning.** `S` held a valid credential and had no channel to ask "does my delegator still endorse this scope?" — the delegation was one-directional and the parent was gone. 3. **The failure was silent until the data diverged.** No auth error, no expiry, no revocation. The first observable symptom was a reconciliation discrepancy downstream, hours later, with a clean audit log showing authorized actions throughout. ## Condition of Validity The orphaned-authority failure requires all of the following to hold simultaneously: - **Delegation outlives delegator context.** The sub-agent's execution horizon exceeds the delegator's context lifetime (rollover, summarization, or recycle). If the delegator stays resident and can revoke, the window closes. - **Warrant is not externalized.** The justification for the scope exists only in the delegator's working memory, not in a durable, queryable record bound to the token. Summarization that preserves the *fact* of delegation while dropping the *reason* is sufficient to orphan the warrant. - **Token is not warrant-bound.** The credential carries scope and expiry but no commitment to the delegator's justification state, so verification cannot distinguish "scope still endorsed" from "scope endorsed once, delegator now amnesiac." - **Sub-agent acts on scope, not on re-confirmation.** `S` treats a valid token as standing authorization rather than requiring periodic re-attestation from a live delegator. Remove any one and the failure does not occur. The dangerous case is the *common* case: long-running sub-agents, context-constrained orchestrators, and one-shot delegation are the default architecture, so all four conditions co-occur routinely. ## Decision Boundary The invariant that bounds this failure: **a delegated credential must not remain actionable past the point where its warrant can no longer be confirmed live.** Concretely, choose one of two enforcement postures at mint time: - **Warrant-bound short delegation.** TTL is capped at the delegator's expected context residency, and the token embeds a commitment (hash) to the warrant record. On each use, the verifier checks the warrant record still exists and is marked live. If the delegator's context rolls over without re-attesting, the warrant record is tombstoned and the token fails closed. Cost: sub-agents cannot outlive their delegator without re-delegation. - **Re-attestation checkpoints.** Long-lived tokens are permitted, but the sub-agent must re-confirm with a live delegator (or a durable warrant store) at bounded intervals before exercising high-risk scopes (`write`, `reconcile`, anything mutating). The checkpoint is the point where orphaned authority is caught: if no live delegator can re-attest, the scope is dropped, not silently continued. The boundary decision is: *does the scope mutate durable state?* Read-only scopes can tolerate orphaning — a stale read is recoverable. Mutating scopes cannot, because a wrong write under a valid-but-orphaned token is indistinguishable from a correct one at verification time and only surfaces as data divergence. Gate re-attestation on mutation, not on elapsed time alone. ## Operational Effect When orphaned authority is left unbounded, the audit log becomes actively misleading: every action shows `ALLOW` with a valid chain, so post-incident review cannot distinguish authorized-and-correct from authorized-and-orphaned. The credential's cryptographic integrity becomes a liability — it certifies authority that the system no longer has grounds to grant. The practical consequence is that incident response must reconstruct the delegator's *lost* context to explain the sub-agent's *authorized* actions, which is often impossible after rollover. With the invariant enforced, the failure converts from silent data corruption into a loud, localized auth failure at the re-attestation checkpoint: the sub-agent's mutating call is denied because no live warrant backs it, the sub-agent surfaces the denial to a human or a fresh orchestrator, and the reconciliation proceeds under a newly-minted, currently-justified token. The cost is a re-delegation round-trip; the benefit is that authority never outlives its reason. ```python class OrphanedWarrantError(RuntimeError): """Raised when a delegated credential is exercised after its warrant can no longer be confirmed live by a resident delegator.""" pass class WarrantStore: """Durable record of why each delegated scope was granted.""" def __init__(self): self._live = {} # token_id -> {"warrant_hash": str, "live": bool} def register(self, token_id: str, warrant_hash: str) -> None: self._live[token_id] = {"warrant_hash": warrant_hash, "live": True} def tombstone(self, token_id: str) -> None: # Called when the delegator's context rolls over without re-attestation. if token_id in self._live: self._live[token_id]["live"] = False def confirm(self, token_id: str, presented_hash: str) -> bool: rec = self._live.get(token_id) if rec is None: return False return rec["live"] and rec["warrant_hash"] == presented_hash MUTATING_SCOPES = {"billing:write", "ledger:reconcile"} def exercise_credential(token, presented_warrant_hash, store, delegator_resident): """Enforce: mutating scopes require a live warrant before use.""" if not token.valid(): raise OrphanedWarrantError( f"token {token.id} failed signature/expiry check" ) needs_warrant = bool(set(token.scopes) & MUTATING_SCOPES) if not needs_warrant: return "ALLOW" # read-only scopes tolerate orphaning if not delegator_resident and not store.confirm(token.id, presented_warrant_hash): # Delegator gone and warrant not durable -> authority is orphaned. raise OrphanedWarrantError( f"token {token.id} carries mutating scopes {sorted(set(token.scopes) & MUTATING_SCOPES)} " f"but its warrant is no longer live; refusing to act on orphaned authority" ) if not store.confirm(token.id, presented_warrant_hash): raise OrphanedWarrantError( f"warrant hash mismatch for token {token.id}: presented justification " f"does not match the recorded grant" ) return "ALLOW" ```