modelcontextprotocol icon indicating copy to clipboard operation
modelcontextprotocol copied to clipboard

[Proposal] Verifiable tamper evident receipts for tool calls

Open quantova-inc opened this issue 1 month ago • 4 comments

Problem

MCP has no standard way to prove what a tool did. A server runs a tool and returns a result, and afterward nothing binds that result to the call in a way a third party can check. A log can be edited after the fact and nothing detects it. For regulated use, for agent audit, and for any setting where a tool call has consequences, there is no verifiable, tamper evident record.

I am aware of gateway style signing in the wider ecosystem. This proposal is narrower and is about one protocol level capability, an optional receipt a server can attach to a tool result that a holder verifies later, rather than a transport specific gateway.

Proposal

An optional tool call receipt. When a server opts in, a tool result can carry a receipt that commits to the call and the result. The receipt is a signed commitment, not the data itself, so the server can keep the arguments and the output private and still let a holder prove the call happened in one exact form at a point in time.

Shape of the idea, kept minimal.

  • The receipt commits to a canonical form of the tool name, the arguments and the result, through a digest. Only the digest and the signature travel, so the content stays with the holder.
  • The signature is algorithm agile. It should allow the NIST post quantum signature algorithms, ML-DSA under FIPS 204 and SLH-DSA under FIPS 205, so a receipt that vouches for a call outlives the arrival of a quantum computer. Classical algorithms stay allowed for the transition.
  • Verification is offline against the record the holder keeps, so a verifier needs no live service.

Why optional and additive

A server that does not opt in behaves exactly as today. A client that does not understand receipts ignores the field. This adds a capability without changing the existing tool call flow.

Reference prototype

Your process asks for a working prototype before a spec proposal. I built one. It wraps a tool handler so each call is fingerprinted and anchored, the call data stays private, and anchoring never breaks the tool. Source and tests are at https://github.com/quantova-inc/mcp-qstamp, and the verification is reproducible offline in Go and in Python through the qstamp libraries in the same organisation.

What I am asking

Is the project interested in a standard, optional tool call receipt along these lines. If so I will write it up as a full SEP with the canonical form, the receipt schema and conformance vectors, and keep the prototype in step with the design.

quantova-inc avatar Oct 30 '26 12:10 quantova-inc

Three suggestions for scope:

  1. Bind more than the call arguments and the result. Include a hash of the tool definition the client actually saw (name, description, inputSchema). Tool definitions can change between listing and calling, so a receipt that only names the tool can't show which version was invoked.
  2. Say plainly in the threat model what a server-signed receipt proves. It proves what the server attests, not what the tool really did. That makes it tamper evidence for the record, not proof of behaviour.
  3. Include key discovery and rotation. A holder needs a way to get the server's key months later, after it has changed. Without that, old receipts quietly become unverifiable.

Sultan57git avatar Oct 31 '26 03:10 Sultan57git

Please start with relevant working and interest groups in Discord before opening a SEP, as outlined in our SEP guidelines.

localden avatar Oct 31 '26 06:10 localden

The receipt proves the call ran in exactly this form, but nothing in it says what authorized it, so when a signed call later turns out to be a bad write the record shows what happened and not who approved it, or whether the arguments that ran were the ones that were approved. I'd allow an optional authorization reference in the committed form, an approval id plus the digest of the arguments as approved, so a verifier can check approved against executed offline from the same receipt.

I keep that binding in a small SQLite schema here: https://gist.github.com/renezander030/ad81c7a805a09a844983f881e2c487e5

renezander030 avatar Oct 31 '26 11:10 renezander030

Sharing a working reference implementation of an external, out-of-band receipt and lineage format for anyone prototyping the hook-based approach here.

One design lesson we hit while building this: if the agent runtime emits and stores its own logs, you still have to trust the runtime not to drop or smooth over missing approvals. Separating the receipt store from the execution path—and letting an independent verifier recompute hashes from canonical bytes—helps keep that boundary clean.

What our current format (governed-run-v2) does:

  • Canonical serialization & hash-bound lineage: 26 immutable fields, ASCII-sorted JSON keys, SHA-256 over UTF-8 bytes, with parent_receipt_id / parent_receipt_hash / chain_depth so multi-agent or cross-tool handoffs stay linked.
  • Independent trust bundle: ES256 issuer signature, Merkle batch inclusion, RFC 3161 external timestamp token, and DNS key pinning.
  • Explicit gap preservation: Missing approvals or unestablished claims remain visibly flagged (Authority: not established) rather than inferred as green.

Live examples you can inspect or recompute without credentials:

  • Cross-vendor Work Record check (PromptKing + watsonx): https://www.promptking32.com/record/AWIR-0002/check
  • Signed & timestamped trust bundle: https://www.promptking32.com/verify/trust/6aeaa1a7-fbdf-4ce2-8c6d-ce625613db2b
  • Verification spec: https://www.promptking32.com/verify/spec

Happy to share test vectors or compare notes on aligning hook payloads with the draft-sharif-agent-audit-trail / ComplianceCallbackHandler schemas.

ShazadMirza avatar Nov 28 '26 04:11 ShazadMirza