Skip to main content

Verify an AI Agent's Receipt Yourself in 15 Lines of Python

Recompute the hash, rebuild the canonical bytes, see what tampering looks like, and read the checks a match doesn't cover.

Updated 6 min readMarkdown

If someone sends you a link that says "here's proof of what the AI did," the reasonable response is: proof according to whom? A green checkmark on the sender's own website is just another claim. What you want is to check the record yourself, with your own code, and know exactly what that check does and doesn't tell you.

This guide does that for a Zambo receipt in about 15 lines of Python, using only the standard library. It's for the person receiving AI work: a client, a manager, an auditor, or another agent deciding whether to trust an input. I ran every step on December 1, 2026 against a real receipt from a code review an AI ran earlier that day.

What you need

  • A receipt ID or link of the form zambo.dev/run/<id>. The person or agent who did the work gives you this.
  • Python 3. No packages, no account, no API key.

Step 1: Fetch the receipt

Every receipt has a public verify endpoint:

https://zambo.dev/api/v2/receipt/<id>/verify

It returns the receipt with its canonical_bytes, the exact bytes that were hashed, base64-encoded, and its output_hash. It also returns the server's own check results. You're going to ignore those and redo the main check yourself.

Step 2: Recompute the hash yourself

import base64, hashlib, json, urllib.request

rid = "e7099e9c-15f8-4404-bc9e-4121fc7e9fb6"
url = f"https://zambo.dev/api/v2/receipt/{rid}/verify"
receipt = json.load(urllib.request.urlopen(url))["receipt"]

raw = base64.b64decode(receipt["canonical_bytes"])
mine = "sha256:" + hashlib.sha256(raw).hexdigest()

print("stated  ", receipt["output_hash"])
print("computed", mine)
print("match   ", mine == receipt["output_hash"])

record = json.loads(raw)
print(record["issuer_claims"], record["tool"])

My output:

stated   sha256:45d981be6ef6c48578d99e9a6708d30e6c118346ba6c2a7f87dad3a7be7a12dc
computed sha256:45d981be6ef6c48578d99e9a6708d30e6c118346ba6c2a7f87dad3a7be7a12dc
match    True

The decoded record has six top-level fields: caller (a hashed identifier, not a name), issuer_claims (here "provenance_class": "EXECUTED BY ZAMBO"), output (the actual tool result), receipt_schema_version, side_effects and tool. The output is the full code review: a critical finding about Math.random() session IDs, a high one about a missing Content-Type, and so on.

Step 3: Check the bytes are canonical, not just hashed

A hash only helps if you can rebuild the bytes from the content. In my test, the canonical bytes were exactly the record re-serialised as compact JSON with sorted keys:

rebuilt = json.dumps(record, sort_keys=True, separators=(",", ":"),
                     ensure_ascii=False).encode()
print(rebuilt == raw)   # True

That matters, because now you can check a copy of the output that was emailed or pasted to you, not just the one the server hands back. Rebuild the bytes from the copy you were given, hash them, compare.

Step 4: See what tampering looks like

Say someone forwards you the review but quietly softens the critical finding:

record["output"]["issues"][0]["severity"] = "low"
tampered = json.dumps(record, sort_keys=True, separators=(",", ":"),
                      ensure_ascii=False).encode()
print(hashlib.sha256(tampered).hexdigest()[:16])   # 4b89fb63f5ea09b8

One word changed, a completely different hash, no match. That's the whole value of the receipt: you can tell whether what you were shown is what was recorded.

What the server's own checks add, and what they leave out

The verify endpoint also returns its checks. For this receipt:

commitment_matches         pass         SHA-256 of the exact decoded canonical bytes matches output_hash.
canonical_payload_matches  pass         The stored output and known call context reconstruct the exact canonical bytes.
provenance_binding         pass         ... issuer is not authenticated.
metadata_binding           pass         metadata_hash matches the canonical metadata block.
issuer_authentication      not_checked  A zambo.dev receipt URL does not authenticate the issuer; no pinned signature or trusted issuer key was checked.
signature                  not_checked  No Ed25519 signature or pinned signing key is supplied.
chain                      not_checked  This endpoint does not verify an append-only receipt chain.

Read the not_checked lines as carefully as the pass lines. Here's what you actually know after Step 2:

  • You know: the output you hold is byte-for-byte the output that was recorded.
  • You don't know: that the output is correct. The review in this receipt has a wrong finding in it, and the hash matches anyway.
  • You don't know: who issued it, cryptographically. There's no signature to check, and the endpoint says so.
  • You don't know: the outside time. The record carries timestamps, but nothing independent anchors them.

That's an honest scope, and it's useful: it rules out "the agent's output was edited after the fact," which is the most common way AI work gets misrepresented.

Checking a log of steps done outside the AI

For steps the AI only reported, like "I updated the spreadsheet", Zambo keeps a journal per job, and each entry is chained to the previous one. Its check is also a public GET:

https://zambo.dev/api/journal/<job_id>/verify

For a test job earlier the same day it returned:

{"job_id":"mcp-session-handling","valid":true,"status":"valid","break_at":null,"reason":null}

If an entry had been edited or removed, break_at would point to where the chain broke. Each entry is labelled LOGGED BY AGENT, with the line "Zambo did not run or observe the reported action," so you know you're checking that the log is intact, not that the event happened.

Checking a whole job

A closed job has a workflow page listing every step with its output hash and a combined Merkle root, refused steps included. Here's one from a test job. You can check each listed step with the method above. I couldn't find public documentation for the root's construction (merkle_version: seq-output-v1), and none of the obvious ways I tried reproduced it. So today, check the steps individually and treat the root as Zambo's claim.

What this costs

Nothing, for the person checking. The verify endpoints are public GETs and don't touch any allowance.

The person producing the work uses the free tier or a pass. Each metered tool gets one free call per network per UTC day plus 3 shared continuation calls, and handing a job over has one free wrap-up per network per day, pickup always free. A Day Pass ($0.99 for 24 hours) or Zambo Pass ($29 for 30 days) lifts the standard daily limits. Lifetime is $250 once. Sealing a job into a fixed copy with a PDF needs a pass (pricing).

Copy-paste checklist for clients

  1. Ask for the receipt link of each step you care about.
  2. Run the script above on each one, or open zambo.dev/verify if you'd rather not run code.
  3. If someone pasted you the output, rebuild and hash that copy too.
  4. Read the not_checked lines. A match means "unchanged," not "correct."
  5. For reported steps, check the journal chain.

About the author

  • Trust layer for AI work. Verifiable receipts for every AI tool call. MCP at https://zambo.dev/mcp

No comments yet. Be the first to comment.