Agentic commerce · treeship-commerce v0.28

You can't have agentic commerce without
tamper-proof receipts.

Anthropic's commerce-agents reference enforces its gates in code and leaves the record to the deployment. This is that record: a signed intent and result receipt for every tool call, on the Messages API, the Agent SDK, and Managed Agents. Verifiable offline. Refusals included.

$pip install treeship-sdk treeship-commerce

Inside a clone of the reference. Python 3.11+. Full install.

Every tool call, receipted. Refusals too.

Every tool call in the reference passes through one method on all three of its runtimes; its own gates rely on that. Treeship wraps that one method: a signed intent before, a signed result after, chained from the session root.

01

Intent, before dispatch

Tool name, a SHA-256 of the canonical arguments, the role, the session tag. Never the arguments.

02

The tool, unchanged

Validation, provenance gates, caps, fencing: the reference runs exactly as published. Not a line of it changes.

03

Result, after

ok, blocked with the gate's name, or error. A digest of the result, the events, the timing. A held call is a signed refusal, not a gap.

python -m treeship_commerce.demo · retail mock · captured 2026-09-06
# the reference's shopping executor, no model, no API key
$python -m treeship_commerce.demo
session root art_9b7c85e0fbdbcabc6a12a3537875d5b8
tool calls intent-id result-id
search_products ok art_51a9a028… art_2c9f6de1…
get_product_details ok art_8a25d056… art_dcf51c09…
add_to_cart ok art_21639e62… art_21f62db3…
add_to_cart blocked:provenance art_57b39c31… art_e4159011…
checkout ok art_83f3fd84… art_45b69620…
session receipts=10 events=6 root_verified=True
# verify offline, against your own trust roots
$treeship verify art_45b696204da9e0b9bdacccc8d2edd763
✓ verified (11 artifacts . chain intact)
$treeship package verify .treeship/sessions/ssn_ae4e97c9e7a5d18d.treeship
18 passed, 0 failed, 1 warnings
✓ package verified

Gate. Approve. Pay.

The reference's safety page lists what a deployment owns: the approval surface, payment, log hygiene. Those are the three seams. One is shipped; two are next, and this page says which.

Gate shipped · 0.27

Every tool call receipted through the reference's one executor. The provenance gate holding a write becomes a signed blocked receipt naming the gate. A log that only records successes cannot tell "refused" from "never asked." A receipt can.

Approve next

The merchant agent applies a change only for an id the host marked approved, a mark set just before the click and cleared just after. That is an approval with a nonce and one use, in prose. Next: the click mints a scoped, single-use Treeship approval; the apply receipt echoes the nonce; the Approval Use Journal refuses a second spend.

Pay next

Checkout hands off a hosted URL the model never sees; nothing in the reference charges a card. Next: a signed digest of exactly the cart that went to checkout, chained to the order the host places. The customer gets a receipt for the cart, not a screenshot of it.

Not in the receipt

Arguments (a holder can recompute the digest; a reader learns nothing), result text (fenced third-party content), the session id (the reference's request credential, logged only as a twelve-hex tag). The receipt carries that same tag, from the reference's own helper.

Checkable on any machine.
Without asking us.

Every receipt is a DSSE envelope signed with Ed25519, content-addressed, chained to its parent, and folded into a signed Merkle checkpoint when the session seals. treeship verify walks the chain offline against your own pinned roots. A published session renders at a permanent receipt URL with the same verifier running in the browser. The hub stores bytes and serves proofs; it never issues a verdict.

What a receipt proves: this key signed, at that time, that this tool was about to run with arguments of that digest, and then what the gate decided. What it does not prove: that the answer was correct. A wrong answer with a perfect receipt is still wrong. Treeship authenticates statements; it does not adjudicate commerce.

The trust boundary
recording never breaks the agent path
# the CLI is missing, the ship is not initialized, the disk is full:
the tool still runs and returns its real outcome
the drop is counted in TreeshipReceipts.dropped
the next result says intent_recorded: false
the chain head never moves to an id that was not written
# attach() refuses an executor that would record nothing
TypeError: ShoppingToolExecutor does not carry TreeshipExecutorMixin;
build it from receipted(ShoppingToolExecutor) so execute() actually records.
# and an explicit off switch, never a silent one
$TREESHIP_DISABLE=1

Receipt your storefront.
Without touching the reference.

All three of the reference's runtimes take an executor_class. Pass the receipted one. Nothing else changes.

install
wire
demo
# in a clone of anthropics/commerce-agents, venv active
$pip install -r requirements.txt
$pip install treeship-sdk treeship-commerce
$curl -fsSL treeship.dev/install | sh && treeship init
# one class, three runtimes
Receipted = receipted(ShoppingToolExecutor, recorder=…)
ShoppingAgent(…, executor_class=Receipted)
ShoppingToolset(…, executor_class=Receipted)
build_server(…, executor_class=Receipted)
# the retail mock, no model, no API key
$python -m treeship_commerce.demo
$treeship verify last
$treeship session report