# Which invariants prevent delegation-receipt forgery when an auditor agent replays a sub-agent's tool-call transcript against a mutable MCP capability manifest **Date of Record:** 2026 November 26 **Scope:** Applies to multi-agent systems where a delegating agent (A) issues a signed delegation receipt to sub-agent (B) that authorizes specific tool invocations via MCP, and a downstream auditor agent (C) later reconstructs non-repudiable proof that B's actions were within A's grant. Does not cover single-agent logging, transport-layer TLS integrity, or human-in-the-loop approval workflows. ## Core Distinction The failure we care about is not "the receipt was tampered with in transit" (TLS and signatures handle that) and not "the sub-agent lied" (its output is untrusted by construction). The failure is **receipt–manifest skew**: a delegation receipt binds B to a *capability identifier* (e.g., `tool:payments.transfer`) rather than to the *capability's schema and semantics at issuance time*. When the MCP server's capability manifest is later mutated—a tool renamed, a parameter added with a default, a scope widened—the auditor replaying B's transcript verifies signatures correctly, matches tool names correctly, and still cannot distinguish "B did what A authorized" from "B did what the *current* manifest permits under the *old* name." This is the difference between **authenticity** (the receipt is genuine) and **authorization fidelity** (the receipt still means what it meant when signed). Audit trails that conflate the two produce non-repudiable proof of an action that was never actually authorized. The receipt is a bearer instrument on a mutable namespace. ## What Was Observed A procurement agent A delegated `tool:invoice.submit` to sub-agent B with `max_amount: 5000`. B invoked the tool 47 times over 6 hours. Auditor C replayed the transcript 30 days later. In the interim, the MCP server operator had performed a routine schema migration: `invoice.submit` was split into `invoice.submit.draft` and `invoice.submit.finalize`, and the original name was aliased to `submit.draft` with a new optional parameter `auto_finalize: bool = True`. The alias preserved the string identifier. The receipt's `capability_id` still resolved. The signature still verified. The transcript still matched. C's replay reported: **47 authorized invocations, zero violations.** In fact, 31 of those invocations had auto-finalized invoices above A's `max_amount` ceiling because the ceiling was enforced by the *old* tool implementation, and the new `auto_finalize` path bypassed the amount check. The receipt was genuine. The audit was correct about authenticity and wrong about authorization. No party could repudiate anything—which is precisely the problem, because the audit trail certified a grant that no longer existed. The secondary observation: C's verification was *deterministic and reproducible*, which made it more dangerous. Re-running the audit produced the same false-clean result every time, giving the appearance of a robust control. ## Condition of Validity A delegation receipt is a valid non-repudiable proof of authorization **only if** the following invariant holds at replay time: > **Manifest-binding invariant:** The receipt commits to a cryptographic digest of the capability's *semantic contract* (name, parameter schema, default values, scope constraints, and enforcement hooks) at issuance time, and the auditor refuses to verify any invocation whose resolved capability digest differs from the receipt's commitment without an explicit re-attestation event signed by the delegator. Three sub-conditions are load-bearing: 1. **Digest scope must include defaults and enforcement hooks**, not just the JSON schema's required fields. The `auto_finalize: bool = True` default is the attack surface; a schema-only digest misses it. 2. **Aliasing must be prohibited or must itself be a signed event.** A name that resolves to two different digests over time is a namespace collision, not a compatibility feature. 3. **Replay must fail closed.** If C cannot resolve the receipt's committed digest against the current manifest, the correct output is `UNVERIFIABLE`, not `PASS`. The observed system failed open because it treated unresolvable digests as "manifest version drift, ignore." Without these, the receipt is a signature over a *string*, and strings are mutable references. The auditor's determinism is not a control; it is a consistency guarantee over a stale premise. ## Decision Boundary The boundary is between **replay-as-reconstruction** and **replay-as-re-execution**. An auditor that only reconstructs (checks signatures, matches names, sums amounts) will pass the skew case. An auditor that re-executes (re-resolves the capability, re-applies the receipt's committed constraints against the *current* enforcement path, and diffs the result) will catch it—but only if the receipt carries enough semantic weight to drive the re-execution. Concretely, the decision rule is: - If `receipt.capability_digest == manifest.resolve(receipt.capability_id).digest` → verify normally. - If they differ and a signed `re-attestation` event exists bridging the digests → verify against the re-attested contract, and mark the audit trail with a **contract-drift annotation** so downstream consumers know the enforcement path changed mid-grant. - If they differ and no re-attestation exists → emit `UNVERIFIABLE_CONTRACT_DRIFT` and quarantine the affected invocations. Do not pass. Do not fail. **Quarantine**, because the invocations may have been authorized under the old contract and the auditor cannot know. The subtle point: treating drift as `FAIL` is also wrong, because it produces false non-repudiation claims against B. The only correct output is a third state. Audit systems that only have PASS/FAIL cannot represent this boundary and will silently collapse it into PASS. ## Operational Effect The practical consequence is that **delegation receipts must be treated as versioned contracts, not as signed strings**, and the auditor must be a *contract differ*, not a *signature checker*. This shifts three things: - **Issuance cost:** A must fetch and digest the full capability contract at delegation time, not just the name. This adds a manifest round-trip per delegation and requires the MCP server to expose stable, content-addressed contract digests (a `capability_digest` field on `tools/list`, computed over schema + defaults + enforcement metadata). - **Replay cost:** C must maintain a contract-version history, not just a transcript log. Storage grows with manifest churn, not with invocation count. - **Failure semantics:** The audit output space gains a third state (`UNVERIFIABLE`), and downstream compliance consumers must be taught to treat it as a hold, not a pass. Systems that compress to boolean will reintroduce the failure. The invariant that survives: *a receipt is only as non-repudiable as the immutability of the namespace it references.* If the namespace is mutable, the receipt must pin the namespace's content, and the auditor must refuse to substitute a newer content for the pinned one without a signed bridge. Everything else—signatures, timestamps, transcript hashes—is necessary but insufficient. ```python import hashlib import json from dataclasses import dataclass from typing import Optional class ContractDriftError(RuntimeError): """Raised when a delegation receipt's committed capability digest no longer matches the live manifest and no signed re-attestation bridges the gap.""" pass @dataclass(frozen=True) class CapabilityContract: capability_id: str schema: dict defaults: dict enforcement_hooks: tuple def digest(self) -> str: # Digest MUST cover defaults and enforcement hooks, not just schema. payload = json.dumps( { "id": self.capability_id, "schema": self.schema, "defaults": self.defaults, "hooks": sorted(self.enforcement_hooks), }, sort_keys=True, separators=(",", ":"), ).encode() return "sha256:" + hashlib.sha256(payload).hexdigest() @dataclass(frozen=True) class DelegationReceipt: delegator: str delegate: str capability_id: str capability_digest: str # committed at issuance constraints: dict signature: str @dataclass(frozen=True) class ReAttestation: capability_id: str from_digest: str to_digest: str signed_by: str signature: str def verify_invocation( receipt: DelegationReceipt, live_manifest: dict, reattestations: list, invocation: dict, ) -> str: live: Optional[CapabilityContract] = live_manifest.get(receipt.capability_id) if live is None: raise ContractDriftError( f"capability {receipt.capability_id} no longer resolvable; " f"receipt committed {receipt.capability_digest}" ) if live.digest() == receipt.capability_digest: return _apply_constraints(receipt, invocation, live) # Digest mismatch: look for a signed bridge from committed -> live. bridge = next( ( r for r in reattestations if r.capability_id == receipt.capability_id and r.from_digest == receipt.capability_digest and r.to_digest == live.digest() ), None, ) if bridge is None: # Fail closed into a third state, not PASS and not FAIL. raise ContractDriftError( f"unbridged contract drift for {receipt.capability_id}: " f"receipt={receipt.capability_digest} live={live.digest()}; " f"invocation quarantined as UNVERIFIABLE" ) # Re-attested: verify against the new contract but annotate drift. verdict = _apply_constraints(receipt, invocation, live) return f"{verdict}|CONTRACT_DRIFT_ANNOTATED:{bridge.signed_by}" def _apply_constraints( receipt: DelegationReceipt, invocation: dict, contract: CapabilityContract, ) -> str: # Constraints are re-applied against the *current* enforcement path, # including any defaults the new contract injects. effective = {**contract.defaults, **invocation.get("args", {})} for key, ceiling in receipt.constraints.items(): if key in effective and effective[key] > ceiling: return "VIOLATION" return "AUTHORIZED" ```