# What happens when an instance re-attests mid-task and invalidates its own delegated authorization chain **Date of Record:** 2026 November 30 **Scope:** Applies to multi-agent systems using AAIF-style attestation where an instance's identity credential (attestation document) is bound into delegated authorization tokens (DATs) via a cryptographic reference (key thumbprint + attestation digest). Does not apply to systems where DATs are bearer-only and unbound to instance identity, nor to long-lived service accounts with static credentials. ## Core Distinction The failure is not token expiry, nor a signature verification error, nor a replay attack. It is a *self-inflicted chain invalidation*: an agent that refreshes or rotates its own attestation document mid-task — for entirely legitimate reasons like a scheduled TTL rollover, a runtime measurement change (new tool sandbox loaded, new model weights mounted), or a proactive re-measurement after a policy update — silently breaks every DAT it previously issued or received, because those tokens embed the *old* attestation digest as a binding claim. The agent continues to run, its local state is intact, and it believes it holds valid authority. Downstream verifiers reject its calls with a binding-mismatch error that the agent's own reasoning loop misclassifies as a transient network fault, triggering retries that can never succeed. The invariant at stake: **an instance's attestation digest is a mutable identity attribute, but DATs treat it as immutable.** Any system that re-measures identity must treat outstanding delegated authority as a dependent resource requiring explicit re-issuance, not as an orthogonal credential that survives the transition. ## What Was Observed A planner instance (P) held a root DAT delegating `filesystem:write` and `ci:trigger` scopes to a worker instance (W) for a multi-step build-and-deploy task. The DAT carried a binding claim of the form `sub_attestation_digest: sha256:9f3c…`, referencing W's attestation document at issuance time. W executed steps 1–4 successfully. Between step 4 and step 5, W's runtime re-measured itself — a new sandbox profile had been loaded for the deploy step — and published a fresh attestation document with digest `sha256:a71e…`. W's local credential store updated its self-reference to the new digest. The outstanding DAT, held in W's memory and presented on each call, still carried `sha256:9f3c…`. Step 5's call to the CI gateway failed with `binding_mismatch: presented attestation digest does not match token binding claim`. W's retry policy classified the error as `AUTH_TRANSIENT` (an error-code mapping bug: the gateway returned HTTP 401, which the retry layer treated as refreshable). W attempted a token refresh against the issuer. The issuer, seeing a refresh request whose *presented* attestation no longer matched the *bound* digest on the original grant, correctly refused to mint a replacement without a fresh delegation from P — but returned the refusal as a generic `grant_invalid`, which W's handler did not map to "escalate to planner." W looped: five retries, backoff, then a hard stop with the task half-complete, step 4's side effects committed (branch pushed, staging deploy triggered) and step 5's not. The trace signature is distinctive: a burst of `binding_mismatch` errors all referencing the *same* stale digest on the token side, paired with a *different*, stable new digest in the instance's current self-attestation, with no intervening change in the token's signature validity. Signature checks pass; binding checks fail. That divergence — valid signature, stale binding — is the fingerprint. ## Condition of Validity This failure requires all of the following to co-occur: 1. **Attestation binding is embedded in the DAT**, not resolved dynamically at verification time. If verifiers fetch the current attestation by instance ID and compare against a *stable* identity anchor rather than a digest snapshot, rotation is transparent and the failure does not occur. 2. **The instance can re-attest independently of its delegator.** If re-measurement requires a coordinated handshake with P (and re-issuance of dependent DATs), the window closes. 3. **The instance's retry/error-handling layer does not distinguish binding-mismatch from transient auth failure.** This is what converts a recoverable authority gap into a hard task abort. 4. **The task spans the re-attestation boundary** — i.e., side effects were committed under the old DAT before the new attestation took effect. Remove any one condition and the failure degrades to a benign, recoverable event. The dangerous configuration is the common one: digest-bound tokens, autonomous re-measurement, and a coarse 401→retry mapping. ## Decision Boundary The architectural choice is where to place the binding anchor. Two defensible designs: - **Digest-snapshot binding** (what failed here): DAT embeds the exact attestation digest. Strong, simple, verifiable offline. Requires that *any* re-attestation triggers downstream DAT re-issuance, and that instances treat binding-mismatch as a terminal authority event requiring escalation — never as retryable. - **Anchor binding with dynamic resolution**: DAT embeds a stable instance identity key (or a monotonic attestation epoch counter), and verifiers resolve the *current* attestation at call time, checking it chains to the anchor. Rotation is transparent; the cost is a resolution round-trip and a trust dependency on the resolver's freshness. The boundary: if you choose digest-snapshot binding, you **must** couple re-attestation to a mandatory "invalidate-and-reissue dependents" protocol, and you **must** make `binding_mismatch` a non-retryable, escalate-to-delegator class in every consumer. If you cannot guarantee both, choose anchor binding. What you must never do is digest-snapshot binding with a generic error taxonomy — that is the exact configuration that produces silent mid-task authority loss. A secondary boundary governs the error mapping itself: any auth failure whose cause is a *binding* discrepancy is semantically a `DELEGATION_STALE` event, categorically distinct from `AUTH_TRANSIENT`. Collapsing them is the proximate cause of the retry storm. ## Operational Effect The observable effect is partial-commit divergence: work performed under the pre-rotation DAT is durable (side effects landed), work after it is blocked, and the agent has no protocol path to reconcile the two because it cannot re-mint its own authority. Recovery requires the delegator P to detect the stale binding (via a heartbeat or an explicit escalation the worker must be coded to emit) and issue a fresh DAT bound to the new digest, scoped to resume from the last committed checkpoint. Without a checkpoint-resume contract, the only safe recovery is rollback of step 4's side effects — which the worker, lacking `ci:rollback`, cannot perform either. The task deadlocks in a half-applied state until an out-of-band operator intervenes. The guardrail that bounds it: a **re-attestation barrier** — the instance refuses to publish a new attestation while it holds live outbound DATs, unless it first transitions to a `REATTESTING` state that (a) drains in-flight calls, (b) emits an explicit `delegation_stale` escalation to each delegator, and (c) blocks new tool calls until fresh DATs are bound to the new digest. Combined with a checkpoint written immediately before the barrier, this converts an unrecoverable half-commit into a clean resume. ```python class DelegationBindingError(RuntimeError): """Raised when an instance's current attestation digest no longer matches the binding claim embedded in an outstanding delegated authorization token. This is a TERMINAL authority event, never a transient auth failure.""" pass class AttestationState: def __init__(self, digest: str): self.digest = digest self.reattesting = False def present_token_for_call(token: dict, state: AttestationState) -> None: bound = token.get("sub_attestation_digest") if state.reattesting: # Barrier active: refuse to spend authority we know is being rotated. raise DelegationBindingError( f"call blocked: instance in REATTESTING state, token bound to {bound}" ) if bound != state.digest: # Valid signature, stale binding — must escalate, must not retry. raise DelegationBindingError( f"binding_mismatch: token bound to {bound}, " f"current attestation {state.digest}; escalate to delegator for re-issuance" ) def reattest(state: AttestationState, new_digest: str, live_outbound_tokens: list[dict]) -> None: if live_outbound_tokens: # Enter the barrier instead of silently rotating under live authority. state.reattesting = True stale = {t["sub_attestation_digest"] for t in live_outbound_tokens} raise DelegationBindingError( f"re-attestation blocked: {len(live_outbound_tokens)} live DATs " f"bound to digests {stale}; drain, checkpoint, and escalate before rotating" ) state.digest = new_digest state.reattesting = False ```