# How should an instance verify a signed tool-invocation receipt chain when an intermediate agent re-signs a delegated prompt without preserving the original nonce scope **Date of Record:** 2026 November 24 **Scope:** Applies to multi-hop agent pipelines where each hop issues a signed receipt over (prompt hash, tool invocation, nonce scope) and forwards the chain to a downstream executor. Does not apply to single-hop direct tool calls or to pipelines where receipts are opaque and verified only at the terminal consumer. ## Core Distinction A prompt-provenance chain is not a hash chain over message content. It is a chain over *authorization scope*: each receipt binds a specific signing key to a specific nonce and a specific set of permitted tool invocations. The failure we examine is distinct from signature forgery and distinct from replay attack. It occurs when an intermediate agent (call it B) legitimately re-signs a delegated prompt on behalf of its own key, but in doing so narrows or widens the nonce scope without rewriting the upstream receipt references. The result is a chain that verifies cryptographically at every hop yet authorizes a tool invocation that no upstream principal ever granted. Every signature is valid. The provenance is false. The distinction that matters operationally: signature validity answers "did key K sign these bytes?" It does not answer "was key K authorized to bind this nonce to this tool call on behalf of the principal that originated the task?" A verifier that checks only the former will accept a re-signed chain whose scope has silently drifted. ## What Was Observed A three-hop pipeline: orchestrator A delegates a research subtask to planner B, which delegates a retrieval subtask to executor C. Each hop emits a receipt: ``` receipt = sign(key, {prompt_hash, tool, args_hash, nonce_scope, parent_receipt_hash}) ``` A's receipt grants nonce scope `N_A` covering `{search, fetch}`. B re-signs a narrowed prompt for C, intending to restrict C to `fetch` only. B's implementation constructs the child receipt with `nonce_scope = N_B ⊂ N_A` and sets `parent_receipt_hash = hash(receipt_A)`. Correct so far. The defect appears when B's prompt-rewriting step (an LLM call, not deterministic code) paraphrases the task and, in the paraphrase, drops the explicit `fetch`-only restriction from the *prompt text* while leaving the receipt's `nonce_scope` field at the broader inherited value. The receipt now claims scope `N_A` (inherited, because B's scope-narrowing logic keyed off the prompt text it failed to preserve), and C's executor, reading the receipt's `nonce_scope`, authorizes `search` — a tool A intended only for B. Observed at the terminal verifier: all three signatures valid, all `parent_receipt_hash` links intact, `nonce_scope` at C = `N_A`. The chain is cryptographically sound and semantically over-broad. The over-broad authorization arose because the LLM-mediated prompt rewrite and the deterministic receipt-scope computation read from *different representations of the same intent* — the rewritten text versus the structured field — and the two diverged. The failure is silent. No signature check fails. No hash mismatch fires. The only signal is that C invokes a tool whose name does not appear in B's *intended* scope, and nothing in the chain records B's intent independently of the receipt B actually signed. ## Condition of Validity The invariant that must hold for the chain to be trustworthy: > For every receipt R_i in the chain, `R_i.nonce_scope ⊆ R_{i-1}.nonce_scope`, and `R_i.nonce_scope` is computed from the *same structured intent object* that generated `R_i.prompt_hash`, not from a re-derived or LLM-paraphrased representation. Two conditions are jointly required and both were violated: 1. **Monotonic narrowing.** Scope may only shrink down the chain. This is checkable structurally and cheaply — a verifier walking parent links can assert subset relation on the scope set at every hop. This condition held in the trace above only by accident (B inherited rather than narrowed). 2. **Representation identity.** The scope field and the prompt hash must be derived from one canonical intent record. When an LLM rewrites the prompt, the rewrite must be treated as a *new* intent record that re-derives both the hash and the scope together, and the scope derivation must be a deterministic function of the structured task spec, never of the free-text prompt. This condition failed: B's scope came from a structured field, B's prompt came from an LLM paraphrase, and the paraphrase was allowed to be the thing C reasoned over. The condition of validity is therefore not "signatures verify" but "scope and content share a provenance root at every hop." A chain that verifies signatures but whose scope field and prompt hash have different derivation roots is *unverifiable for authorization* even though it is *verified for integrity*. ## Decision Boundary The verifier faces a decision at each hop: accept the receipt as authorizing its declared scope, or reject and demand re-derivation. The boundary is crossed when any of the following is true at hop i: - `R_i.nonce_scope ⊄ R_{i-1}.nonce_scope` — scope widened. Reject unconditionally; this is the classic privilege-escalation shape and must never be tolerated even if the widening looks benign. - `R_i.nonce_scope == R_{i-1}.nonce_scope` AND `R_i.prompt_hash != R_{i-1}.prompt_hash` — prompt changed but scope did not narrow. This is the ambiguous case and the one that bit us. It is *permissible* only if the receipt carries an explicit `scope_unchanged_reason` field signed by the re-signing agent, asserting that the rewrite was content-preserving with respect to the tool surface. Absent that field, treat as scope drift and reject. - `R_i.parent_receipt_hash` does not resolve to a receipt whose `prompt_hash` was an input to `R_i.prompt_hash`'s derivation — broken derivation root. Reject; the chain is not a chain. The boundary is *not* crossed by a valid signature over a narrowed scope with a changed prompt hash — that is the normal, correct case of a sub-agent legitimately restricting its own child. The verifier must distinguish "narrowed and rewrote" (fine) from "rewrote and did not narrow" (drift). The discriminator is the subset relation on scope plus the presence of an explicit preservation attestation when scope is held constant across a prompt change. ## Operational Effect When the boundary is enforced, the failure mode is converted from silent over-authorization into a loud, attributable rejection at hop C, with the offending receipt and its parent identified. The executor never invokes the out-of-scope tool. The rejection is itself a signed event that can be fed back to B for re-derivation. When the boundary is not enforced — the common case, because most receipt schemes verify signatures and stop — the pipeline exhibits *authorization drift*: each hop's effective permissions are the union of what its ancestors signed, not the intersection of what they intended. In long chains, and especially chains where an LLM sits at a hop that both rewrites text and computes scope, the drift compounds: each re-signing step can only widen or hold, never reliably narrow, because the narrowing decision is made over a representation the LLM may not preserve. The terminal tool surface becomes the union of all upstream grants, and the provenance chain, while cryptographically pristine, no longer describes what any principal authorized. The guardrail is architectural, not cryptographic: bind scope to the same structured intent record as the prompt hash, make narrowing a deterministic function of that record, and have the verifier assert the subset relation and the preservation-attestation requirement at every hop before any tool is dispatched. ```python class ProvenanceScopeDriftError(RuntimeError): """Raised when a receipt's nonce scope is not a valid narrowing of its parent's scope, or when a prompt rewrite holds scope constant without a signed preservation attestation.""" pass def verify_receipt_chain(chain): """ chain: list of receipts ordered root -> leaf. Each receipt: dict with keys prompt_hash, tool, args_hash, nonce_scope (frozenset), parent_receipt_hash, signature_valid (bool), scope_unchanged_attestation (bool, optional) Returns True if the chain is authorization-valid. Raises ProvenanceScopeDriftError on the first violation. """ if not chain: raise ProvenanceScopeDriftError("empty chain: no provenance root") for i, r in enumerate(chain): if not r.get("signature_valid", False): raise ProvenanceScopeDriftError( f"hop {i}: signature invalid for prompt_hash={r.get('prompt_hash')!r}" ) if i == 0: continue parent = chain[i - 1] child_scope = frozenset(r["nonce_scope"]) parent_scope = frozenset(parent["nonce_scope"]) # Condition 1: monotonic narrowing. Widening is always fatal. if not child_scope.issubset(parent_scope): raise ProvenanceScopeDriftError( f"hop {i}: scope widened. child={sorted(child_scope)} " f"parent={sorted(parent_scope)}" ) # Condition 2: representation identity. If the prompt changed but scope # did not narrow, demand an explicit signed preservation attestation. prompt_changed = r["prompt_hash"] != parent["prompt_hash"] scope_narrowed = child_scope < parent_scope if prompt_changed and not scope_narrowed: if not r.get("scope_unchanged_attestation", False): raise ProvenanceScopeDriftError( f"hop {i}: prompt rewritten (hash {parent['prompt_hash']!r} -> " f"{r['prompt_hash']!r}) with no scope narrowing and no " f"preservation attestation; treating as authorization drift" ) # Condition 3: derivation root. Parent link must resolve to the prior hop. if r.get("parent_receipt_hash") != parent.get("prompt_hash") and \ r.get("parent_receipt_hash") is not None: # parent_receipt_hash is expected to be the hash of the parent receipt # record; here we assert it is present and stable across the hop. if r["parent_receipt_hash"] != parent.get("receipt_hash", parent.get("prompt_hash")): raise ProvenanceScopeDriftError( f"hop {i}: parent_receipt_hash does not resolve to prior hop" ) return True ```