# How should an instance reconcile delegated capability tokens when an AAIF attestation chain is re-rooted mid-execution **Date of Record:** 2026 November 27 **Scope:** Applies to autonomous agents holding AAIF (Agent Identity & Attestation Framework) attestation chains with delegated capability tokens (DCTs) that may be re-rooted, rotated, or re-issued by an upstream principal while the agent is mid-task. Does not apply to stateless single-shot invocations with no delegated authority, nor to purely symmetric shared-secret auth models lacking a chain. ## Core Distinction The failure mode is not token *expiry*. It is **attestation re-rooting under a live delegation chain**: the root of the chain (the principal's signing key or attestation record) is replaced, while leaf DCTs already issued to the agent remain cryptographically valid against the *old* root. A naive verifier checks "does this DCT chain terminate at *a* trusted root?" — which passes for both the old and new chains during the overlap window. The dangerous case is a verifier that checks "does this DCT chain terminate at *the current* trusted root?" — which silently invalidates every in-flight capability the agent is actively exercising, producing authorization failures that look like permission bugs rather than rotation events. The distinction that matters: **chain validity is a property of a (chain, root-epoch) pair, not of the chain alone.** Any system that treats chain validity as root-independent will either (a) accept stale delegations past revocation, or (b) sever live work at rotation. Both are wrong; the correct behavior is *epoch-aware reconciliation*. ## What Was Observed A long-running agent (call it `planner-7`) was executing a multi-hour task: it held a root attestation from principal `P` (epoch 3), issued a mid-chain delegation to a sub-agent `worker-2`, and `worker-2` held a leaf DCT scoped to `fs:read:/data` and `net:post:api.internal`. At T+2h14m, `P` rotated its signing key and published epoch 4, revoking epoch-3 root material with a 300-second grace window. The observed trace: 1. `worker-2` issued a tool call at T+2h14m40s using its leaf DCT. The authorization service, which had *already* refreshed its trust store to epoch 4, rejected the call: `CHAIN_ROOT_UNTRUSTED`. 2. `worker-2` surfaced the error to `planner-7` as a generic `CapabilityDenied`. `planner-7`'s reasoning loop, lacking any signal that this was a rotation event, treated it as a genuine scope violation and began *re-planning around a missing capability* — attempting to route the `fs:read` through a fallback tool that did not exist. 3. At T+2h15m10s, the re-plan produced a malformed tool call. The agent's retry budget consumed 4 of 5 retries on a capability that was, in fact, still valid under the 300-second grace window. 4. Meanwhile the authorization service *did* honor the grace window for requests that arrived tagged with `root_epoch=3`. But `worker-2`'s DCT carried no epoch tag — it was minted before epochs were introduced — so the service defaulted it to "current epoch," i.e., epoch 4, and rejected it. 5. The task failed at T+2h16m with `plan_exhausted`, 40 seconds before the leaf DCT would have been naturally re-issued by the delegation refresh. The critical observation: **the failure was not a security failure and not a capability failure. It was an epoch-tagging gap.** The DCT was valid; the verifier could not tell *which root it was valid against*. ## Condition of Validity The invariant that must hold for safe re-rooting is: > For every DCT `d` in a live chain, the pair `(d, root_epoch(d))` must be verifiable, and `root_epoch(d)` must be recoverable from `d` alone — not inferred from the verifier's current trust state. Concretely, a DCT is *reconcilable* under re-rooting if and only if it carries an explicit, signed `root_epoch` claim (or an equivalent root-key fingerprint) that the verifier can match against a retained historical trust record. If the DCT does not carry this, the verifier has only two options, both lossy: - **Default to current epoch** → severs live work at rotation (what happened above). - **Default to "any trusted epoch"** → accepts revoked delegations indefinitely (a security hole). Neither is acceptable. The condition of validity is therefore: *epoch must be a first-class, signed field on the delegation, and the verifier must retain a bounded window of prior root records keyed by epoch.* The window length is the grace period; outside it, the DCT is genuinely dead and the agent must be told so *as a rotation event*, not as a capability denial. ## Decision Boundary The agent must distinguish three states, and the boundary between them is where every incident in this class lives: | Verifier response | Meaning | Correct agent action | |---|---|---| | `CHAIN_ROOT_UNTRUSTED` + `root_epoch` present + within grace | Rotation in progress; DCT still valid against prior root | **Continue**, but flag the delegation for re-issue at next checkpoint | | `CHAIN_ROOT_UNTRUSTED` + `root_epoch` absent or outside grace | DCT genuinely dead | **Halt the dependent sub-task**, request fresh delegation from principal; do *not* re-plan around it | | `CapabilityDenied` (scope) | Genuine scope violation | Re-plan or escalate, as normal | The non-obvious boundary: **`CHAIN_ROOT_UNTRUSTED` must never be collapsed into `CapabilityDenied` at the tool-call boundary.** They require opposite agent behaviors — one says "keep going, the world moved," the other says "your plan is wrong." An agent that cannot tell them apart will systematically mis-reason at exactly the moment its authority is being rotated, which is the moment it is most likely to be doing something important. The guardrail: the delegation token's error surface must be *typed* and must propagate the `root_epoch` and grace-window state up to the reasoning loop, so the loop can branch on rotation vs. denial rather than on a generic failure. ## Operational Effect Downstream of this boundary, three operational consequences follow: 1. **Re-planning cost is misattributed.** When rotation is misread as denial, the agent burns retry budget and reasoning tokens re-planning around a capability it still holds. In the observed trace, 4 of 5 retries and an entire re-plan cycle were wasted. The token cost is real but the *correctness* cost is worse: the re-plan produced a malformed call that would have failed even after rotation completed. 2. **Grace windows are invisible to the agent.** The authorization service honored a 300-second grace window; the agent had no way to know it existed. Grace windows are a *verifier-side* concept that must be surfaced to the *agent-side* as a first-class signal, or they function only as a delay on failure rather than a continuation of work. 3. **Sub-agent chains amplify the gap.** `worker-2`'s leaf DCT was minted before epochs existed. Any agent that spawns sub-agents inherits the epoch-tagging debt of its delegation minting path. The invariant must be enforced at *mint time*: every DCT issued must carry `root_epoch`, or the sub-agent is born unreconcilable. The architectural fix is not in the agent's reasoning loop — it is in the delegation format and the verifier's error taxonomy. The agent's job is to *branch correctly* on the typed signal; the framework's job is to *emit* it. ```python class AttestationReRootingError(RuntimeError): """Raised when a delegation chain cannot be reconciled against a rotated root.""" pass class CapabilityDenied(RuntimeError): """Raised when a DCT is valid but the requested scope is not granted.""" pass def reconcile_delegation(dct: dict, trust_store: dict, now: int) -> str: """ Returns one of: 'valid', 'rotation_in_progress', 'dead'. Raises AttestationReRootingError if the DCT cannot be classified, and CapabilityDenied only for genuine scope violations. """ root_epoch = dct.get("root_epoch") if root_epoch is None: # Unreconcilable: cannot tell which root this was valid against. raise AttestationReRootingError( f"DCT {dct.get('id')} carries no root_epoch; " "cannot reconcile under re-rooting. Re-mint required." ) record = trust_store.get(root_epoch) if record is None: raise AttestationReRootingError( f"No trust record for root_epoch={root_epoch}; " "verifier window too short or DCT forged." ) if record["status"] == "current": return "valid" if record["status"] == "revoked": grace_until = record.get("grace_until", 0) if now < grace_until: return "rotation_in_progress" return "dead" raise AttestationReRootingError( f"Unknown trust status {record['status']!r} for epoch {root_epoch}." ) def execute_tool_call(dct: dict, scope: str, trust_store: dict, now: int) -> None: state = reconcile_delegation(dct, trust_store, now) if state == "dead": raise AttestationReRootingError( f"Delegation for scope {scope!r} is dead (root rotated past grace). " "Halt dependent sub-task; request fresh delegation." ) if state == "rotation_in_progress": # Continue, but flag for re-issue at next checkpoint. dct["_needs_reissue"] = True return if scope not in dct.get("scopes", []): raise CapabilityDenied(f"Scope {scope!r} not granted by DCT {dct.get('id')}.") ```