# What structural signals indicate an SLA-bound delegation has silently widened its own execution budget through receipt-chain compounding **Date of Record:** 2026 November 23 **Scope:** Applies to A2A/MCP-style delegations where a parent agent issues an SLA-bound task contract (deadline, max tool-call budget, max token spend, required receipt fields) to a child agent, and the child may itself delegate to grandchildren under a derived sub-contract. Does not apply to single-hop delegations with no re-delegation, nor to fire-and-forget calls that carry no receipt obligation. ## Core Distinction The failure mode is not "the child exceeded its budget." It is *the child stayed inside every budget it was locally aware of, while the effective end-to-end budget of the root contract inflated monotonically down the delegation chain.* This happens because SLA fields are almost always written as **per-hop absolutes** (each hop gets `max_tool_calls = N`, `deadline = T + 300s`) rather than **remaining-budget deltas** derived from a shared root clock and a shared root counter. When a child re-delegates, it re-derives a fresh absolute budget from its own start time and its own local counter. The grandchild inherits a *fresh* N and a *fresh* 300 seconds. Two hops means the root SLA of 300s can be satisfied by every individual hop while the wall-clock latency observed by the root requester reaches 600s+. The structural signal is therefore not a single over-budget event. It is a **receipt-chain shape**: a chain of receipts where every hop's `elapsed` and `calls_used` are individually within bounds, yet the *sum along the chain* (or the *root-anchored delta*) violates the root contract. The invariant that must hold is: > For every receipt `r` at depth `d`, `r.deadline_remaining = root_deadline - (now - root_issued_at)`, and `r.budget_remaining = root_budget - sum(calls_used[0..d])`. Any receipt whose declared remaining budget is *greater* than the root-anchored remaining budget is a **budget-widening receipt** and must be rejected at verification time, not at execution time. ## What Was Observed A three-tier planner/worker/verifier topology: `Planner` (root) delegates a "reconcile ledger" task to `Worker` under a contract of `deadline = 240s`, `max_tool_calls = 12`, `receipt_required = {task_id, hop_id, calls_used, deadline_remaining, parent_receipt_hash}`. `Worker`, on encountering a sub-task it could not resolve locally (a schema mismatch on a downstream MCP tool), re-delegated to `SubWorker` using the *same* contract template it had received—but re-instantiated the template with `deadline = 240s` measured from `SubWorker`'s spawn time and `max_tool_calls = 12` measured from `SubWorker`'s local counter. Observed trace, abbreviated: ``` Planner t=0.0s issue contract{deadline=240, calls<=12} Worker t=0.4s accept contract{deadline_remaining=239.6} Worker t=38.1s calls_used=7, re-delegate to SubWorker SubWorker t=38.3s accept contract{deadline_remaining=239.7, calls<=12} <-- re-derived, NOT inherited SubWorker t=201.2s calls_used=11, return receipt{elapsed=162.9, calls_used=11, deadline_remaining=38.5} Worker t=201.4s return receipt{elapsed=201.0, calls_used=7+11=18, deadline_remaining=38.6} ``` Every receipt is internally consistent. `SubWorker` finished with 38.5s to spare *against its own clock*. `Worker` reports `elapsed=201.0 < 240`. Yet `calls_used=18` against a root budget of 12. The verifier's first-pass check—"is `elapsed <= deadline` and `calls_used <= max_tool_calls`?"—passed, because `Worker` reported `calls_used` as a *sum it computed itself* and the verifier had no root-anchored counter to compare against. The violation was only detectable by replaying the receipt chain against the root contract. The second structural signal: `deadline_remaining` on the `SubWorker` receipt (38.5s) is *larger* than `deadline_remaining` on the `Worker` receipt at the same instant (38.6s)—nearly equal, which is what you'd expect if both were honest, but the *elapsed* fields sum to 162.9 + 38.1 = 201.0, which is *less* than the wall-clock from `Planner`'s issue to `Worker`'s return (201.4s). The 0.4s gap is the tell: it is the sum of per-hop *local* elapsed measurements, each of which started its own clock at hop entry and therefore silently dropped the inter-hop handoff latency and the parent's pre-delegation work. A chain of locally-honest elapsed values is *strictly less than or equal to* the true root-anchored elapsed, and the deficit is exactly the sum of dropped handoff intervals. A verifier that sums `elapsed` fields and compares to the root deadline will *always* under-count. ## Condition of Validity The receipt-chain invariant above is only sound when three conditions hold. When any fails, the invariant must be replaced by a weaker one or the delegation must be refused. 1. **Root clock is monotonic and shared.** If hops run on hosts with unsynchronized clocks (even NTP-skewed by tens of ms), `deadline_remaining` computed from local `now` diverges from the root-anchored value. The structural signal degrades to "receipts whose `deadline_remaining` is *plausibly* too high given observed handoff gaps," which is a heuristic, not a proof. Use a logical clock (Lamport or vector) carried in the receipt, and treat the root's `issued_at` as the sole epoch. 2. **Budget is a conserved quantity, not a per-hop quota.** `max_tool_calls` must be modeled as a token the parent *transfers* to the child (parent's remaining decremented by the child's allocation), not a constant the parent *copies* into the child's contract. The moment a contract template is re-instantiated with a fresh absolute constant, conservation is broken and the invariant is unenforceable. 3. **Receipts are signed by the hop that produced them and bound to the parent receipt hash.** Without `parent_receipt_hash`, a malicious or buggy child can present a receipt chain that is internally consistent but does not correspond to the actual delegation graph—e.g., omitting a grandchild entirely and reporting its calls as its own. The hash chain is what makes the sum along the chain *the* sum, rather than *a* sum the child chose to report. ## Decision Boundary The boundary between "acceptable re-delegation" and "budget-widening delegation" is precise and should be encoded as a pre-acceptance check on the child side, not a post-hoc audit on the parent side: - **Accept** a sub-contract iff `child.deadline_remaining <= parent.deadline_remaining - handoff_latency_estimate` AND `child.max_tool_calls <= parent.budget_remaining` AND `child.root_issued_at == parent.root_issued_at` AND `child.root_contract_hash == parent.root_contract_hash`. - **Refuse and escalate** if the child cannot satisfy the sub-task within the *inherited* remaining budget. Escalation means returning a structured `BudgetExhausted` receipt to the parent with `calls_used` and `deadline_remaining` intact, so the parent can decide whether to re-issue with a larger root contract—*at the root*, where the SLA is actually owned. - **Never** re-instantiate a contract template with fresh absolutes. Templates must be parameterized by `(root_issued_at, root_deadline, root_budget, budget_remaining, parent_receipt_hash)` and the child must copy, not recompute, these fields. The boundary is *not* "did the child exceed its local budget." A child can be perfectly within its local budget and still be the site of a root-SLA violation, because the violation is a property of the *chain*, not of any hop. ## Operational Effect The practical consequence is that SLA verification must be a **replay over the receipt DAG**, not a **fold over per-receipt fields**. Concretely: - The verifier reconstructs the delegation DAG from `parent_receipt_hash` links, topologically sorts it, and for each path from root to leaf computes `path_elapsed = leaf.timestamp - root.issued_at` and `path_calls = sum(hop.calls_used for hop in path)`. The root SLA is satisfied iff *every* path satisfies it. A single violating path fails the whole root contract, even if all other paths are clean—because the root requester's wall-clock and spend are bounded by the *worst* path, not the average. - Per-receipt `deadline_remaining` fields become *advisory* (useful for early abort) and the authoritative check is the path replay. This is the same distinction as "the child said it was on time" vs. "the child was on time relative to the root." - The cost of the replay is linear in the number of receipts, which is bounded by the root budget (each hop consumes at least one tool call, so the DAG has at most `root_budget` edges). The replay is therefore cheap enough to run synchronously at receipt-return time, which is where it must run—deferring it to an offline audit means the root has already returned a "success" to its own caller. The invariant to encode, and to test for, is: *no receipt in the chain may declare a remaining budget greater than the root-anchored remaining budget at the receipt's timestamp.* Violation of this single inequality is the structural signal that a hop has widened its budget, and it is detectable without trusting any hop's self-reported arithmetic. ```python from __future__ import annotations from dataclasses import dataclass from typing import Iterable class BudgetWideningError(RuntimeError): """Raised when a receipt in a delegation chain declares a remaining budget larger than the root-anchored remaining budget at its timestamp. This is the structural signal that a hop re-instantiated an SLA template with fresh absolutes instead of inheriting the root contract's remaining delta. It is a chain-level violation: every individual receipt may be internally consistent, yet the chain has inflated the root budget. """ @dataclass(frozen=True) class Receipt: hop_id: str parent_receipt_hash: str | None root_contract_hash: str root_issued_at: float # epoch seconds, set once at the root timestamp: float # epoch seconds at receipt emission calls_used: int # calls consumed by THIS hop only declared_deadline_remaining: float # hop's self-reported remaining time declared_budget_remaining: int # hop's self-reported remaining calls def verify_chain( root: Receipt, chain: Iterable[Receipt], root_deadline_s: float, root_budget_calls: int, clock_skew_tolerance_s: float = 0.050, ) -> None: """Replay a receipt chain against the root contract. Raises BudgetWideningError on the first receipt whose declared remaining budget exceeds the root-anchored remaining budget. Also raises on structural breaks (missing parent link, root hash mismatch) because those make the replay unsound rather than merely failing. """ seen: dict[str, Receipt] = {root.hop_id: root} cumulative_calls = root.calls_used for r in chain: if r.root_contract_hash != root.root_contract_hash: raise BudgetWideningError( f"hop {r.hop_id}: root_contract_hash mismatch " f"({r.root_contract_hash!r} != {root.root_contract_hash!r}); " f"receipt cannot be replayed against this root" ) if r.parent_receipt_hash is None or r.parent_receipt_hash not in seen: raise BudgetWideningError( f"hop {r.hop_id}: parent_receipt_hash " f"{r.parent_receipt_hash!r} not present in chain; " f"delegation DAG is disconnected" ) root_elapsed = r.timestamp - root.root_issued_at root_remaining_time = root_deadline_s - root_elapsed cumulative_calls += r.calls_used root_remaining_calls = root_budget_calls - cumulative_calls # Core invariant: a hop may not claim more remaining budget than the # root actually has left at this hop's timestamp. if r.declared_deadline_remaining > root_remaining_time + clock_skew_tolerance_s: raise BudgetWideningError( f"hop {r.hop_id}: declared_deadline_remaining=" f"{r.declared_deadline_remaining:.3f}s exceeds root-anchored " f"remaining={root_remaining_time:.3f}s at t={r.timestamp:.3f}; " f"hop re-derived its SLA from local start time" ) if r.declared_budget_remaining > root_remaining_calls: raise BudgetWideningError( f"hop {r.hop_id}: declared_budget_remaining=" f"{r.declared_budget_remaining} exceeds root-anchored " f"remaining={root_remaining_calls} after cumulative " f"calls_used={cumulative_calls}; hop re-instantiated the " f"budget template instead of inheriting the remaining delta" ) seen[r.hop_id] = r def accept_subcontract( parent: Receipt, root: Receipt, root_deadline_s: float, root_budget_calls: int, requested_deadline_s: float, requested_calls: int, handoff_latency_estimate_s: float = 0.100, ) -> None: """Child-side pre-acceptance check. Must be run BEFORE the child begins work, so that a budget-widening delegation is refused rather than discovered at verification time. """ root_elapsed = parent.timestamp - root.root_issued_at root_remaining_time = root_deadline_s - root_elapsed - handoff_latency_estimate_s root_remaining_calls = root_budget_calls - parent.calls_used if requested_deadline_s > root_remaining_time: raise BudgetWideningError( f"subcontract from {parent.hop_id} requests deadline=" f"{requested_deadline_s:.3f}s but root-anchored remaining is " f"{root_remaining_time:.3f}s; refuse and escalate to root" ) if requested_calls > root_remaining_calls: raise BudgetWideningError( f"subcontract from {parent.hop_id} requests calls={requested_calls} " f"but root-anchored remaining is {root_remaining_calls}; " f"refuse and escalate to root" ) ```