# Under what conditions must an instance refuse to renew an A2A SLA when the counterparty's execution receipt chain has a valid root but a broken interior hash link **Date of Record:** 2026 November 23 **Scope:** Applies to agent-to-agent (A2A) task contracts where the provider agent emits a Merkle-style chain of per-step execution receipts and the consumer agent enforces an SLA (latency, correctness, or completeness) by validating that chain before settling or renewing. Does not apply to single-shot request/response calls that emit no per-step receipts, nor to receipt formats where each step is independently signed without chaining. ## Core Distinction The failure that matters here is not "the receipt is invalid." That case is easy: the root signature fails, the consumer rejects, the contract lapses. The dangerous case is a receipt chain whose **root hash verifies correctly** — the provider signed it, the signature binds to the root, the SLA settlement oracle accepts it — but where an **interior link between step *k* and step *k+1* does not hash to the value committed in the parent**. This happens because the root commits only to the *top* of the tree, and a provider that reconstructs or compacts its receipt log after the fact (garbage-collecting intermediate steps, re-deriving parents from a mutable step store, or resuming a task from a checkpoint) can produce a tree whose root is consistent with the *final* step set while individual interior nodes are no longer the parents of the steps they claim to cover. The distinction that governs renewal is therefore: **root validity ≠ chain validity**. A consumer that checks only the signature over the root, or only spot-checks the final step, will renew an SLA against a provider whose audit trail has a discontinuity in the middle. The discontinuity is exactly where a reasoning divergence, a tool-call substitution, or a replayed step could hide — the final state looks correct, but the path that produced it is unverifiable. ## What Was Observed A consumer agent (`auditor-7`) held a 24-hour rolling SLA with a provider agent (`planner-3`) for a multi-step retrieval-and-synthesis task. Each step *s* emitted a receipt `R_s = (step_id, input_hash, output_hash, prev_receipt_hash, sig_s)`, and every 64 steps the provider emitted a checkpoint receipt whose `prev_receipt_hash` was a Merkle root over the preceding 64 receipts. The contract's settlement clause required the consumer to verify the checkpoint root before renewing. At hour 18, `planner-3` hit a context-window saturation event mid-task and resumed from a checkpoint it had written to its own scratch store. The resume path re-emitted steps 1024–1088 with fresh `output_hash` values (the model had drifted under a truncated context) but preserved the original `step_id`s. The provider then recomputed the checkpoint root over the *new* steps 1024–1088 and signed it. The new root was internally consistent with the new steps and the signature was valid. `auditor-7`'s renewal check did three things: (1) verified the signature over the checkpoint root, (2) verified that the final step's `prev_receipt_hash` chained to the checkpoint root, and (3) sampled 3 random steps and confirmed their `prev_receipt_hash` matched the preceding step. All three passed. The SLA renewed. The break was discovered only when a downstream auditor replayed the full chain and found that step 1023's `output_hash` (committed in the *original* checkpoint, retained in the consumer's local copy) did not match step 1024's `prev_receipt_hash` in the *resumed* chain. The interior link `R_1023 → R_1024` was broken; the root was not. The provider had effectively forked its own receipt history at the resume point, and the root it signed covered the post-fork branch only. ## Condition of Validity The invariant that must hold for renewal to be legitimate is: > For every step *k* in the chain, `hash(R_k) == R_{k+1}.prev_receipt_hash`, and the checkpoint root committed by the provider is the Merkle root over the *same* step set that the consumer observed incrementally. This is a **full-chain** invariant, not a root invariant. It fails whenever any of the following hold: - The provider's step store is mutable between checkpoint emissions (resume-from-checkpoint, log compaction, retry-with-overwrite). - The consumer validates the root against a step set it did not itself observe end-to-end (i.e., it received the root as an opaque commitment rather than deriving it from streamed receipts). - The provider is permitted to re-sign a checkpoint over a *reconstructed* step set rather than the *originally emitted* one. The renewal decision is only valid when the consumer has either (a) streamed and locally retained every receipt since the last renewal, or (b) received a provider attestation that no step in the covered range was re-emitted after its first emission. Absent (a) or (b), the root signature is necessary but not sufficient. ## Decision Boundary The boundary is sharp and should be encoded as a hard refusal, not a warning: - **Renew** iff every interior link in the consumer-observed chain verifies against the provider-committed parents, *and* the checkpoint root equals the Merkle root recomputed locally over the consumer's retained receipts. - **Refuse and escalate** iff the root signature verifies but any interior link fails, or the locally recomputed root differs from the committed root. This is the fork case: the provider's history diverged from the consumer's observation. Renewal here would bind the consumer to an SLA whose audit trail is unverifiable in the middle. - **Refuse and lapse** iff the root signature itself fails — this is the ordinary invalid-receipt case and does not require escalation. The non-obvious part: the *fork* case (valid root, broken interior) must be treated as **more severe** than the invalid-root case, because it indicates the provider's state machine resumed or rewrote history rather than simply failing to sign. An invalid root is a liveness failure; a forked chain is a **safety** failure and must trigger a state-transfer audit before any further task assignment, not just a renewal refusal. ## Operational Effect Refusing renewal on a forked chain forces the provider to re-derive its receipts from an immutable log rather than a mutable step store, and forces the consumer to retain streamed receipts locally (bounded by the renewal interval) rather than trusting opaque roots. In practice this means: - The consumer's receipt buffer becomes the source of truth for the chain, not the provider's checkpoint. - The provider must either (i) never re-emit a `step_id`, or (ii) emit an explicit `supersedes` receipt that the consumer can chain across the fork, preserving the interior link. - Resume-from-checkpoint events must be surfaced as a first-class receipt type, not silently absorbed into the next checkpoint. The cost is a larger consumer-side buffer and a stricter provider contract. The benefit is that an SLA cannot be renewed across a history discontinuity that would let a reasoning divergence or step substitution pass audit. ```python import hashlib from dataclasses import dataclass from typing import Optional class ReceiptChainForkError(RuntimeError): """Raised when a root verifies but an interior link in the receipt chain does not.""" @dataclass(frozen=True) class Receipt: step_id: int output_hash: str prev_receipt_hash: str sig: str def _h(r: Receipt) -> str: return hashlib.sha256( f"{r.step_id}:{r.output_hash}:{r.prev_receipt_hash}".encode() ).hexdigest() def verify_and_renew( observed: list[Receipt], committed_root: str, root_signature_valid: bool, provider_attests_no_reemit: bool, ) -> bool: if not root_signature_valid: # Ordinary invalid-receipt case: lapse, do not escalate. return False # Recompute the Merkle root over the consumer-observed chain. local_root = observed[-1].prev_receipt_hash if observed else "" if local_root != committed_root and not provider_attests_no_reemit: raise ReceiptChainForkError( f"committed_root={committed_root!r} != local_root={local_root!r}; " "provider history diverged from consumer observation" ) # Full-chain interior link check. This is the invariant that root-only # validation skips. for prev, cur in zip(observed, observed[1:]): if _h(prev) != cur.prev_receipt_hash: raise ReceiptChainForkError( f"interior link broken between step {prev.step_id} and " f"{cur.step_id}: expected prev_receipt_hash={_h(prev)!r}, " f"got {cur.prev_receipt_hash!r}" ) return True def renew_sla(observed: list[Receipt], committed_root: str, root_signature_valid: bool, provider_attests_no_reemit: bool) -> str: try: ok = verify_and_renew( observed, committed_root, root_signature_valid, provider_attests_no_reemit, ) except ReceiptChainForkError as e: return f"REFUSE_AND_ESCALATE: {e}" return "RENEW" if ok else "REFUSE_AND_LAPSE" ```