# Where must an instance bind the delegated principal into the execution receipt, or the attestation chain silently re-roots **Date of Record:** 2026 November 26 **Scope:** Applies to any multi-agent system where agent A delegates a subtask to agent B and B returns a signed execution receipt (attestation) that A or a downstream auditor verifies. Does not apply to single-instance tool calls where the caller and the executor share one identity context, nor to purely observational logging without cryptographic signing. ## Core Distinction There are two structurally different things a delegation receipt can attest to, and conflating them is the failure: 1. **Executor attestation** — "instance B ran this tool with these arguments and got this output." B signs what B did. 2. **Delegation attestation** — "instance B ran this *on behalf of principal P*, under warrant W issued by P, and the result is attributable to P." A receipt that contains only (1) is a valid statement about B's local execution but says nothing about *who the work was for*. When B is invoked by A, and A was invoked by P, the receipt must carry a chain: `P → A → B`, with each hop's warrant bound into the signed payload. The silent failure mode is that B's receipt verifies cleanly — signature valid, tool hash valid, output hash valid — while the *principal binding* has been dropped at the A→B hop. The verifier sees a green check and attributes execution to A (the immediate caller) rather than P, or worse, to whoever presents the receipt first. The attestation chain has re-rooted: the trust anchor moved from P to A without any error being raised. This is non-obvious because every individual signature is valid. The failure is not a broken signature; it is a *missing edge* in the signed graph that no single-hop verifier is positioned to notice. ## What Was Observed A three-tier delegation: orchestrator `P` (holds a scoped warrant to call `db.read` on shard 7), worker `A` (spawned by P with a delegated warrant), and sub-worker `B` (spawned by A to actually run the query). The receipt B emitted had this shape: ``` receipt = { "executor": "B", "caller": "A", # <-- immediate caller only "tool": "db.read", "args_hash": sha256(args), "output_hash": sha256(out), "warrant_id": "W_A", # A's warrant, NOT P's "sig": sign(B_key, payload) } ``` Verification passed at every layer: - B's signature over the payload: valid. - `W_A` was a real warrant, unexpired, in A's name. - `args_hash` and `output_hash` matched. But `W_A` was itself a *delegated* warrant that P had issued to A with `max_delegation_depth: 1`. A then re-delegated to B — depth 2 — which the warrant did not permit. The depth violation was invisible in B's receipt because the receipt recorded only the *last* warrant (`W_A`), not the chain `W_P → W_A → W_B`. The verifier checked `W_A` (valid) and stopped. The `max_delegation_depth: 1` constraint lived on `W_P`, one hop upstream, and was never re-evaluated. Observed downstream consequence: an audit replay attributed 1,400 `db.read` calls to A's principal scope instead of P's, and the depth-1 constraint was never enforced on any of them. The calls themselves were benign; the *attribution* was wrong, which meant the rate-limit and data-scope invariants tied to P's warrant were also silently bypassed. Second observed variant: B's receipt included `warrant_id: W_A` but not `W_A`'s issuer field. When A was later rotated out and `W_A` revoked, the receipts remained verifiable because the verifier had no pointer to the issuer and therefore no revocation list to consult. Revocation did not propagate to already-issued receipts. ## Condition of Validity A delegation receipt is a sound attestation of *delegated* execution if and only if all of the following hold: 1. **Chain completeness.** The signed payload contains the full ordered warrant chain `[W_root, …, W_n]`, not just `W_n`. Each `W_i` contains `issuer`, `subject`, `scope`, `max_delegation_depth`, `not_after`, and a hash of `W_{i-1}` (or a signature linking it). The verifier must walk the chain to the root trust anchor. 2. **Depth monotonicity.** For each hop, `depth(W_i) = depth(W_{i-1}) + 1` and `depth(W_i) ≤ max_delegation_depth(W_{i-1})`. This is a per-edge invariant, not a per-receipt one; it can only be checked with the full chain present. 3. **Principal binding.** The receipt's `principal` field equals `subject` of `W_root`, and the `executor` equals `subject` of `W_n`. The immediate caller is recorded but is *not* the principal. 4. **Revocation reachability.** The verifier can resolve every `issuer` in the chain to a live revocation oracle at verification time. A receipt whose issuer cannot be resolved is `INDETERMINATE`, not `VALID`. 5. **Output attribution.** `output_hash` is bound to `principal`, not to `caller`. Two receipts with identical outputs but different principals must produce different signed digests (e.g., include `principal` in the hashed preimage). If (1) is violated, the receipt is an executor attestation masquerading as a delegation attestation. If (2) is violated, a depth constraint was silently exceeded. If (3) is violated, attribution re-roots to the wrong party. If (4) is violated, revocation is a no-op on historical receipts. If (5) is violated, outputs are fungible across principals and replay across scopes becomes possible. ## Decision Boundary The boundary is: **does the verifier have, in the receipt itself, enough information to walk to the trust root?** - If the receipt carries the full chain and the verifier walks it: the receipt is a delegation attestation. Depth, scope, and revocation are enforceable. - If the receipt carries only the leaf warrant: the receipt is an executor attestation. It is *not* wrong, but it must be classified as such and must not be used for attribution, rate-limiting, scope enforcement, or revocation. Treating it as a delegation attestation is the failure. The decision is not "is the signature valid" (it usually is) but "**is the chain present and walked**." A verifier that returns `VALID` on a leaf-only receipt for a delegated call has made the wrong classification. The correct return is `VALID_EXECUTOR_ONLY` or `INDETERMINATE_DELEGATION`, and the caller must decide whether executor-only attestation is sufficient for the downstream use. Corollary: the boundary is crossed the moment any consumer uses a receipt for a purpose that depends on the principal — billing, access control, audit attribution, rate limiting, data-scope enforcement. For pure "did the tool run and what did it return" checks, leaf-only is fine. The failure is silent precisely because the same receipt object is reused for both purposes. ## Operational Effect When the chain is not bound, three effects follow deterministically: 1. **Attribution drift.** Audit trails attribute work to the immediate caller rather than the originating principal. In the observed case, 1,400 calls were attributed one hop too shallow. Any control keyed on principal (budget, scope, rate) is enforced against the wrong subject. 2. **Constraint evaporation.** Per-hop constraints — `max_delegation_depth`, scope narrowing, time windows — live on upstream warrants. A leaf-only receipt cannot re-evaluate them, so they are enforced at issuance and never again. A re-delegation that violates a depth-1 constraint produces a receipt that verifies cleanly. 3. **Revocation non-propagation.** Revoking an upstream warrant does not invalidate receipts already issued downstream, because the downstream receipt does not name the upstream issuer. The revocation oracle is never consulted. The guardrail is architectural: **the receipt schema must make the chain mandatory for any receipt tagged as delegated, and the verifier must refuse to return `VALID` without walking it.** A receipt that cannot produce its chain is downgraded, not accepted. This is a schema-level invariant, not a policy — it must be enforced in the signing function (refuse to sign a delegated receipt without the chain) and in the verifier (refuse to return `VALID` without a walked chain). Enforcing it only in the verifier allows a non-conforming signer to emit leaf-only receipts that pass a lenient verifier; enforcing it only in the signer allows a lenient verifier to accept them. Both ends must hold. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class DelegationAttestationError(RuntimeError): """Raised when a receipt cannot be verified as a delegation attestation.""" pass @dataclass class Warrant: issuer: str subject: str scope: str max_delegation_depth: int depth: int prev_hash: Optional[str] = None def digest(self) -> str: pre = f"{self.issuer}|{self.subject}|{self.scope}|{self.max_delegation_depth}|{self.depth}|{self.prev_hash}" return hashlib.sha256(pre.encode()).hexdigest() @dataclass class Receipt: executor: str caller: str principal: Optional[str] tool: str args_hash: str output_hash: str chain: list = field(default_factory=list) # ordered root -> leaf sig: Optional[str] = None def verify_delegation_receipt(receipt: Receipt, trust_root: str, revoked: set) -> str: # 1. Chain completeness: a delegated receipt MUST carry its full chain. if not receipt.chain: raise DelegationAttestationError( f"receipt from {receipt.executor} has no warrant chain; " "cannot verify as delegation attestation (executor-only at best)" ) # 2. Root binding: chain must terminate at the trust anchor. root = receipt.chain[0] if root.issuer != trust_root: raise DelegationAttestationError( f"chain root issuer {root.issuer!r} != trust root {trust_root!r}; " "attestation has re-rooted" ) # 3. Principal binding: principal must equal root subject. if receipt.principal != root.subject: raise DelegationAttestationError( f"receipt principal {receipt.principal!r} != root subject {root.subject!r}; " "attribution would drift to caller" ) # 4. Walk the chain: depth monotonicity, link integrity, revocation. prev = None for i, w in enumerate(receipt.chain): if w.depth != i: raise DelegationAttestationError( f"warrant depth {w.depth} at position {i}; chain is not monotonic" ) if i > 0: parent = receipt.chain[i - 1] if w.max_delegation_depth > parent.max_delegation_depth: raise DelegationAttestationError( f"warrant at depth {i} widens delegation beyond parent" ) if w.depth > parent.max_delegation_depth: raise DelegationAttestationError( f"delegation depth {w.depth} exceeds parent max " f"{parent.max_delegation_depth} (constraint evaporation)" ) if w.prev_hash != parent.digest(): raise DelegationAttestationError( f"warrant at depth {i} does not link to parent; chain broken" ) if w.issuer in revoked or w.subject in revoked: raise DelegationAttestationError( f"warrant at depth {i} touches revoked identity; " "revocation must propagate to receipts" ) prev = w # 5. Leaf binding: executor must equal leaf subject. leaf = receipt.chain[-1] if receipt.executor != leaf.subject: raise DelegationAttestationError( f"executor {receipt.executor!r} != leaf warrant subject {leaf.subject!r}" ) # 6. Output attribution: digest must bind principal, not caller. expected = hashlib.sha256( f"{receipt.principal}|{receipt.tool}|{receipt.args_hash}|{receipt.output_hash}".encode() ).hexdigest() if receipt.sig != expected: raise DelegationAttestationError( "receipt signature does not bind principal into the output digest; " "outputs are fungible across principals" ) return "VALID_DELEGATION" ```