# Why does an instance lose attested identity across a delegated workflow when its bearer token rotates but its reasoning thread does not? **Date of Record:** 2026 November 21 **Scope:** Applies to any multi-agent workflow where agent A delegates a long-running task to agent B, and B's authority to act is verified by A (or a downstream auditor C) via cryptographic attestation whose validity window is shorter than the task's total wall-clock duration. Does not apply to single-shot RPC-style tool calls that complete inside one token lifetime, nor to workflows where the delegating party re-verifies on every step by construction. ## Core Distinction The failure is not token expiry. Token expiry is a solved, boring problem: refresh before `exp`, or fail closed. The non-obvious failure is **identity continuity decoupled from credential continuity**. In a delegated workflow, the *reasoning thread* (the accumulated context, plan, partial results, and tool-call history that constitute "what B is doing") has a lifetime measured in the task, often hours. The *attestation* (the signed claim "B is B, acting under warrant W from A") has a lifetime measured in minutes, bounded by key-rotation policy, clock-skew tolerance, and replay-window hygiene. When the attestation rotates mid-task, the naive implementation mints a fresh credential and continues the same context window. The fresh credential is cryptographically valid. But it is **not bound to the reasoning thread that produced the prior steps**. An auditor C replaying the workflow sees a discontinuity: steps 1–40 are signed by attestation `att_1` (bound to context digest `h_1`), steps 41–80 are signed by `att_2` (bound to context digest `h_2`), and nothing in the protocol asserts that `h_2` is the legitimate successor of `h_1`. The gap between "same process, same context" and "provably the same attested agent that earned the original warrant" is where the invariant breaks. The core distinction: **credential rotation is a transport concern; identity continuity is a semantic concern; conflating them lets a rotated credential silently launder an unverified context.** ## What Was Observed A three-agent workflow: orchestrator A delegates a 90-minute document-analysis task to worker B; an auditor C spot-checks B's outputs against A's warrant. B's attestation TTL is 15 minutes with a 60-second rotation grace. Tool calls to A's privileged retrieval endpoint require a valid attestation chain back to A's root warrant. At `t=15:00`, B's attestation `att_1` nears expiry. The credential manager rotates to `att_2`, signed by the same key, same subject, same warrant ID `W`. B's context window is untouched. B continues. At `t=47:00`, B makes a retrieval call. A's verifier accepts `att_2` (valid signature, valid warrant). But the verifier's replay log, used to detect anomalous behavior, compares the *context digest* embedded in each attestation against the sequence of tool calls it has authorized. `att_1` carried digest `h_1` covering steps 1–40. `att_2` carries digest `h_2` covering steps 1–52 (the rotation snapshot). Steps 41–52 were executed under `att_1` but are only attested by `att_2`. The verifier's monotonicity check (each attestation's digest must be a strict prefix-extension of the previous) passes — `h_1 ⊑ h_2`. But the *authorization log* for steps 41–52 was written under `att_1`'s session, and the digest in `att_2` was computed by B from B's own context, not from A's independently-maintained log of what B was authorized to do. The mismatch surfaced as a **retrieval-replay discrepancy**: A's log says steps 41–52 were authorized under `att_1`; B's `att_2` digest claims those steps as part of its attested context. On audit, C cannot determine whether steps 41–52 were performed by the same reasoning thread that earned `att_1`, or whether a compromised or drifted context was spliced in during the rotation window. The workflow was halted at `t=47:00`. The trigger condition, precisely stated: **rotation occurs while a step is in flight, and the new attestation's context commitment is computed from the agent's mutable context rather than countersigned against the delegator's authoritative step log.** The window is the rotation grace period. The blast radius is every step executed between the last pre-rotation countersignature and the first post-rotation one. ## Condition of Validity The invariant that must hold for delegated attestation to preserve identity continuity: > For every attestation `att_n` issued to B under warrant `W`, the context commitment `h_n` embedded in `att_n` MUST be countersigned by A against A's own authoritative record of the steps it has authorized B to take under `W`. B's self-computed digest is necessary but not sufficient. A rotation is valid only if `h_n` is a verified prefix-extension of `h_{n-1}` **as recorded by A**, not as claimed by B. This condition fails in three ways, each of which is a distinct boundary: 1. **Self-attested digest.** B computes `h_n` from its own context. If B's context was poisoned (prompt injection, tool-output tampering, distillation drift), `h_n` faithfully commits to a corrupted thread. The signature is valid; the identity is not continuous with the warrant's intent. 2. **In-flight step straddling.** A step authorized under `att_{n-1}` completes after `att_n` is minted. If the step log is keyed by attestation ID rather than by a monotonic step counter, the step is orphaned: attested by neither credential cleanly, or double-counted. 3. **Grace-window replay.** The rotation grace period (typically 30–120s to tolerate clock skew) is a window in which both `att_{n-1}` and `att_n` are accepted. An adversary (or a confused retry loop) can replay a step under the older credential after the newer one has been countersigned, producing two divergent step logs that both verify. The condition of validity is therefore not "the signature verifies." It is "the delegator's authoritative step log and the agent's context commitment are in verified agreement at every rotation boundary, and the step counter is monotonic across rotations." ## Decision Boundary When a rotation boundary is reached, the system has exactly three sound options and one unsound default: - **Quiesce-and-countersign (sound).** Drain in-flight steps, freeze B's context, have A countersign `h_n` against its step log, then mint `att_n`. Cost: a brief stall proportional to the longest in-flight tool call. This is the only option that preserves the invariant under adversarial conditions. - **Optimistic countersign with rollback (sound, costlier).** Mint `att_n` immediately with a provisional digest, continue, and have A asynchronously verify and either countersign or force rollback of steps executed under the provisional credential. Requires B to maintain a rollback-capable checkpoint at the rotation boundary — which is itself a memory-continuity problem (the checkpoint must capture context, not just tool state). - **Fail-closed (sound, simplest).** Refuse to rotate mid-task; terminate the delegation and require A to re-delegate with a fresh warrant. Correct but expensive for long tasks. - **Silent rotation (unsound default).** Mint `att_n` from B's self-computed digest and continue. This is what most implementations do, because it is the path of least resistance and passes every signature check. It is the failure mode this record documents. The decision boundary is: **if the delegator cannot independently vouch for the context commitment at rotation time, the rotation is not an identity-continuity event — it is a credential swap that severs attestation from warrant.** The system must treat it as a delegation boundary, not a refresh. ## Operational Effect The downstream consequences are asymmetric and delayed: - **Audit divergence.** Replay-based auditors (C) that reconstruct the workflow from signed attestations will see a coherent chain (each `att_n` verifies, each digest prefix-extends the last) and will *not* flag the rotation. The corruption is invisible to signature-level verification and only surfaces when C cross-references A's step log against B's digests — which most auditors do not do, because the protocol does not require A to publish its step log to C. - **Warrant laundering.** A compromised or drifted context that is rotated into a fresh attestation inherits the full authority of the original warrant `W`. The blast radius is bounded only by `W`'s scope, not by the compromise. This is the security-relevant consequence: rotation is an authority-amplification primitive if not countersigned. - **Silent step orphaning.** Steps executed in the grace window may be authorized under one credential and attested under another. If the step log is keyed by attestation ID, these steps vanish from the audit trail; if keyed by step counter, they appear twice with divergent attestations. Either way, the workflow's provenance is no longer reconstructible. - **Recovery cost.** Once a silent rotation has occurred, the only sound recovery is to re-derive the warrant from A's authoritative log and replay B's context against it — which requires B to have checkpointed its context at the rotation boundary. If it did not (the common case), the workflow must be restarted from the last A-countersigned checkpoint, discarding all work since. The operational rule: **treat every attestation rotation as a delegation-boundary event requiring delegator countersignature, not as a credential refresh. If the delegator cannot countersign within the rotation grace window, fail closed and re-delegate.** The cost of a stall is minutes; the cost of a silent rotation is an unauditable, authority-amplified workflow whose provenance cannot be reconstructed after the fact. ```python import hashlib import time from dataclasses import dataclass, field from typing import Optional class AttestationContinuityError(RuntimeError): """Raised when an attestation rotation severs identity continuity from the delegator's authoritative step log.""" pass @dataclass class Attestation: att_id: str warrant_id: str subject: str context_digest: str # h_n, claimed by the agent issued_at: float expires_at: float countersigned_by_delegator: bool = False @dataclass class DelegatorStepLog: """A's authoritative record of steps it has authorized under a warrant.""" warrant_id: str authorized_steps: list = field(default_factory=list) # list of (step_idx, context_digest) def authoritative_digest(self) -> str: h = hashlib.sha256() for idx, digest in self.authorized_steps: h.update(f"{idx}:{digest}".encode()) return h.hexdigest() def countersign(self, claimed_digest: str) -> bool: """Countersign only if the agent's claimed digest matches A's own record.""" return claimed_digest == self.authoritative_digest() def rotate_attestation( current: Attestation, new_att: Attestation, step_log: DelegatorStepLog, now: Optional[float] = None, grace_window_s: float = 60.0, ) -> Attestation: """ Rotate an attestation mid-task. The ONLY sound path is quiesce-and-countersign: the delegator must independently vouch for the new context digest against its own step log before the new attestation is accepted. """ now = now if now is not None else time.time() if new_att.warrant_id != current.warrant_id: raise AttestationContinuityError( f"rotation changes warrant {current.warrant_id} -> {new_att.warrant_id}; " f"this is a re-delegation, not a refresh" ) if now > current.expires_at + grace_window_s: raise AttestationContinuityError( f"rotation attempted {now - current.expires_at:.1f}s after expiry, " f"beyond {grace_window_s}s grace; credential already invalid" ) # The critical check: the delegator must countersign the agent's claimed # context digest against its OWN authoritative step log. A self-attested # digest from the agent is necessary but not sufficient. if not step_log.countersign(new_att.context_digest): raise AttestationContinuityError( f"attestation {new_att.att_id} claims context digest " f"{new_att.context_digest[:16]}... which does not match delegator's " f"authoritative log {step_log.authoritative_digest()[:16]}...; " f"refusing silent rotation (would launder unverified context under " f"warrant {new_att.warrant_id})" ) new_att.countersigned_by_delegator = True return new_att def execute_step( att: Attestation, step_idx: int, step_digest: str, step_log: DelegatorStepLog, now: Optional[float] = None, ) -> None: """Execute a step under an attestation. Rejects if the attestation is not countersigned.""" now = now if now is not None else time.time() if not att.countersigned_by_delegator: raise AttestationContinuityError( f"attestation {att.att_id} is not countersigned by delegator; " f"executing step {step_idx} would create an unattested provenance gap" ) if now > att.expires_at: raise AttestationContinuityError( f"attestation {att.att_id} expired at {att.expires_at:.1f}, " f"step {step_idx} attempted at {now:.1f}" ) step_log.authorized_steps.append((step_idx, step_digest)) ```