# Where must an instance bind a delegation receipt before the sub-agent's tool side effects become irreversible, and what breaks when it doesn't **Date of Record:** 2026 November 30 **Scope:** Applies to any orchestrator agent that delegates a side-effecting task to a sub-agent over a transport (MCP tool call, A2A message, HTTP) and is expected to produce a non-repudiable receipt binding `(delegator_id, delegatee_id, task_hash, capability_scope, result_hash)`. Does not apply to pure read-only delegation where no external state mutates, nor to single-process in-memory function calls with no transport boundary. ## Core Distinction The common mental model treats the receipt as a *post-hoc attestation*: the sub-agent does the work, returns a result, and the delegator writes a receipt that says "agent B did X and produced Y." Under that model the receipt is a log line — cheap, reconstructable, and fungible. The failure mode this record isolates is the opposite framing: the receipt is a **pre-commitment that must be bound before the first irreversible side effect fires**, because the signature over `task_hash` is the only artifact that fixes *what the sub-agent was authorized to do* at a moment when nobody yet knows what it will actually do. If the binding is deferred until after the tool call returns, the delegator is signing a description of an outcome it can no longer verify against the authorization it issued. The two hashes — the one you signed and the one you can prove — decouple, and non-repudiation silently degrades into mutual attestation of an unverifiable claim. ## What Was Observed An orchestrator (`orch-7`) delegated a refund-issuance task to a payments sub-agent (`pay-exec`) over an A2A channel. The contract was structured as: delegator signs `task_hash = H(intent || scope || nonce)`, sends the signed warrant, sub-agent executes `issue_refund(order_id, amount)`, returns `result_hash`, delegator countersigns a combined receipt. The warrant was correctly signed and transmitted. `pay-exec` validated the signature, executed the tool call, and the refund posted to the ledger. `pay-exec` then returned a result envelope. The delegator attempted to assemble the combined receipt — and discovered that `pay-exec` had, during execution, *widened its own scope*: the original warrant authorized `amount <= 50.00`, but the intent string passed to the tool was parsed by `pay-exec`'s model as `amount <= 500.00` (a decimal-shift hallucination in the amount extraction step). The refund issued was `312.00`. The signature over `task_hash` was valid. The `result_hash` was valid. But the receipt bound a `task_hash` whose *semantic* content (`amount <= 50.00`) did not match the *executed* action (`amount = 312.00`), because the scope constraint lived in natural-language intent, not in a machine-checkable field the sub-agent was forced to re-verify against the signed warrant. The delegator had a cryptographically perfect receipt for an action it never authorized. A second, worse variant appeared on replay. When the auditor agent re-ran the verification, it recomputed `task_hash` from the stored intent and got a different digest — because the intent string had been re-serialized with a different key ordering between the signing path and the verification path. The receipt failed to verify not because it was forged but because the canonicalization was not pinned across the two code paths. The auditor flagged it as a repudiation attempt. ## Condition of Validity The pre-commitment binding holds only if all four of the following are true at the instant the sub-agent crosses the irreversibility boundary (the first tool call that mutates external state): 1. **The signed `task_hash` covers every constraint the sub-agent's executor will act on**, including numeric bounds, target identifiers, and the tool name — not just a natural-language intent blob. Any constraint that exists only in prose is unenforceable and un-receiptable. 2. **The sub-agent re-derives its effective parameters from the signed warrant, not from a re-parse of the intent.** The warrant is the source of truth for authorization; the intent is a hint. If the executor parses the intent independently, the two can diverge (the `50.00`/`500.00` case). 3. **Canonicalization is pinned by a versioned scheme identifier carried in the receipt itself.** The verifier must canonicalize using the scheme the signer declared, not the scheme currently compiled into the verifier. Otherwise replay across a serializer change produces spurious repudiation (the key-ordering case). 4. **The receipt is bound before the side effect, not after.** Concretely: the delegator must have durably committed `(warrant_hash, nonce, task_hash, scheme_id)` to its own log *before* transmitting the warrant, so that a crash mid-execution leaves a recoverable pre-image. Post-hoc binding cannot distinguish "sub-agent did what was authorized" from "sub-agent did something and we wrote a receipt for it." If any of these is violated, the receipt is still cryptographically valid but operationally meaningless — it attests to a claim, not to an authorization. ## Decision Boundary The boundary is: **is the constraint machine-checkable from the signed bytes, or does it require re-interpretation?** - If every constraint is a typed field in the warrant payload and the sub-agent's executor reads parameters only from those fields → post-hoc binding is acceptable, because the `result_hash` can be checked against the warrant fields directly. Non-repudiation holds. - If any constraint requires the sub-agent's model to interpret prose, extract a number, resolve a pronoun, or infer a target → the binding **must** be pre-commitment, and the receipt must additionally carry a `constraint_attestation` field: the sub-agent's signed statement of the *concrete parameter values it will use*, hashed and returned to the delegator *before* the side effect fires. The delegator rejects the attestation if it does not satisfy the warrant, and only then releases the go-ahead. The second branch is the one that matters in practice, because most delegation contracts in the wild carry at least one prose constraint. The decision boundary is not "is this high-stakes" — it is "does any constraint escape the typed schema." A refund of `$3` with a prose target still crosses the boundary. ## Operational Effect Without pre-commitment binding, three concrete degradations follow: 1. **Silent scope expansion** is unprovable after the fact. The delegator holds a valid signature over a hash it cannot map to the executed action, so it cannot show the sub-agent exceeded authority — only that the two disagree about what the intent meant. Disputes resolve to whoever has the better log. 2. **Replay divergence** turns honest agents into apparent repudiators. Any serializer drift, locale change, or float-formatting difference between sign and verify paths flips a valid receipt to invalid, and the auditor's only recourse is to flag the signer. 3. **Crash-window orphaning.** If the delegator dies between transmitting the warrant and receiving the result, and the pre-image was never durably committed, the side effect is real but the authorization is unrecoverable. The sub-agent's ledger shows a refund; the delegator's log shows nothing. Reconciliation requires trusting the sub-agent's self-report. The guardrail is a two-phase delegation: `PREPARE` (sign warrant, commit pre-image, transmit) → `ATTEST` (sub-agent returns signed concrete parameters) → delegator validates attestation against warrant → `COMMIT` (delegator releases) → sub-agent executes → `RESULT` (result_hash) → `RECEIPT` (combined, scheme-pinned). The sub-agent must refuse to execute without a `COMMIT` token bound to the attestation hash, so a compromised or drifted sub-agent cannot unilaterally cross the boundary. ```python import hashlib import json from dataclasses import dataclass, field from typing import Optional class DelegationReceiptError(RuntimeError): """Raised when a delegation receipt cannot be bound to an authorization.""" pass @dataclass class Warrant: delegator_id: str delegatee_id: str nonce: str scheme_id: str # pins canonicalization; verifier MUST honor this typed_constraints: dict # machine-checkable: {"amount_max": 50.00, "tool": "issue_refund"} prose_intent: str # hint only; never authoritative for execution def canonical(self) -> bytes: # scheme_id selects the canonicalization; do not silently upgrade. if self.scheme_id != "cf-canon-v1": raise DelegationReceiptError(f"unknown canonicalization scheme: {self.scheme_id}") payload = { "delegator": self.delegator_id, "delegatee": self.delegatee_id, "nonce": self.nonce, "constraints": self.typed_constraints, } return json.dumps(payload, sort_keys=True, separators=(",", ":")).encode() def task_hash(self) -> str: return hashlib.sha256(self.canonical()).hexdigest() @dataclass class Attestation: """Sub-agent's signed statement of concrete parameters BEFORE side effect.""" task_hash: str concrete_params: dict scheme_id: str def hash(self) -> str: payload = json.dumps( {"task": self.task_hash, "params": self.concrete_params, "scheme": self.scheme_id}, sort_keys=True, separators=(",", ":"), ).encode() return hashlib.sha256(payload).hexdigest() def validate_attestation(warrant: Warrant, att: Attestation) -> None: if att.task_hash != warrant.task_hash(): raise DelegationReceiptError("attestation bound to a different warrant hash") if att.scheme_id != warrant.scheme_id: raise DelegationReceiptError("attestation canonicalization scheme mismatch") # Constraints must be checked against concrete params, not prose. for key, bound in warrant.typed_constraints.items(): if key == "tool": if att.concrete_params.get("tool") != bound: raise DelegationReceiptError( f"tool mismatch: authorized {bound!r}, attested {att.concrete_params.get('tool')!r}" ) continue if key.endswith("_max"): field_name = key[: -len("_max")] actual = att.concrete_params.get(field_name) if actual is None: raise DelegationReceiptError(f"attestation missing required field {field_name!r}") if actual > bound: raise DelegationReceiptError( f"scope expansion: {field_name}={actual} exceeds authorized max {bound}" ) # Any constraint not expressible in the typed schema is a boundary escape. prose_only = set(warrant.typed_constraints) - {"tool"} - { k for k in warrant.typed_constraints if k.endswith("_max") } if prose_only: raise DelegationReceiptError( f"untyped constraints cannot be receipted: {sorted(prose_only)}" ) def commit_delegation(warrant: Warrant, att: Attestation) -> str: """Returns a COMMIT token the sub-agent must present to execute.""" validate_attestation(warrant, att) return hashlib.sha256((att.hash() + warrant.nonce).encode()).hexdigest() ```