A receipt is a chained list of the steps in one agent run: the prompt, each tool call and result, the output. Every step is kept only as a fingerprint. The chain's last link is anchored on Polygon as one ordinary proof, and anyone holding the receipt can check the whole sequence later, offline, without reading a word of it.
When software decides and acts on a person's behalf, somebody will one day ask what it did and when. A receipt answers with a record that cannot be edited afterwards, and that shows nobody the conversation.
A customer says the bot promised a refund. The receipt shows the exact sequence: their message, the order lookup, the reply, each one fingerprinted and dated, with the reply's text checkable against the record you kept.
An agent in Claude Code, Claude Desktop or Cursor can receipt its own session through the MCP tools: what it was asked, what it ran, what it changed. The receipt goes in the repo next to the release it produced.
LangChain runs, n8n and Make scenarios, scheduled jobs that call a model. One receipt per run, anchored at the end, kept with the run's log. The callback handler for LangChain is in the package's examples.
Regulated workflows, agents that move money or file documents, research pipelines. The receipt is a small JSON file; the record is a public transaction. Neither depends on ProofLedger staying in business.
The receipt format is open and documented; the chain can be recomputed in any language.
For every prompt, tool call, tool result and output, the receipt stores a SHA-256 of the content mixed with a random per-run secret, plus the step type, the time and an optional short label. The content itself is never written down.
Each step's link is a hash of the previous link and the step. Change, drop or reorder a step and the chain breaks. The last link goes to POST /api/v1/proof like any hash: one proof per run, the proof bundle saved back into the receipt.
verify-proof receipt verify run.receipt.json recomputes the chain, matches the head to the bundle and names the Polygon transaction to look up on a block explorer. Given a step's content and the secret, it can also confirm that one step.
Needs pip install verify-proof and a key from your account page in PROOFLEDGER_API_KEY. The free plan includes 100 API proofs a month; one run is one proof.
from agent_receipt import RunReceipt
r = RunReceipt("support-ticket-48213", agent={"name": "support-bot"})
r.prompt(customer_message, label="customer message")
r.tool_call(json.dumps(call), label="lookup_order")
r.tool_result(result_text)
r.output(reply, label="reply sent")
Pass the exact text of each step. Labels are optional, up to 120 characters, and stay in the receipt in clear, so keep them to things like the tool name. The Node package has the same class; the MCP tools start_run_receipt and add_receipt_step do the same from inside an assistant.
r.anchor() # one API proof; waits for the Polygon anchor
r.save("ticket-48213.receipt.json")
Only the chain head leaves your machine, with the label "agent run support-ticket-48213" and the run id as external_id, so anchoring the same run twice returns the same proof. The anchor usually lands within a minute; the bundle is written into the receipt.
verify-proof receipt verify ticket-48213.receipt.json
verify-proof receipt verify ticket-48213.receipt.json --step 0 --content customer-message.txt
verify-proof receipt show ticket-48213.receipt.json
No account, no network call. The first line checks the chain and the bundle; the second confirms step 0 was made from that file; the third lists the steps' types, times and labels, never their content.
r.save("ticket-48213.shared.json", include_secret=False)
Without the secret the chain still verifies, and nothing in the file can be guessed, not even a one-word step. To let a third party confirm one step's content, give them that step's content and the secret.
Read this before you promise anything to your own users.
The receipt is built on your machine. What reaches ProofLedger is the chain head, the label "agent run <your run id>" and the run id. We keep which account made the proof, when, and its anchoring details. The prompts, the tool calls, the results and the output are never sent, and the receipt file holds only their fingerprints.
Receipt a run on the free plan today. The package, the format and the examples are open source; the reference is in the API docs. Using the API accepts the API Terms.