A customer requests a refund for order #84721 — $284.00, purchased 18 days ago. The agent runs its policy logic and calls Claude to make a decision.
# One import change — everything else stays the same
from darkmatter.integrations.anthropic import Anthropic
client = Anthropic(dm_api_key="dm_sk_...")
# Agent calls Claude with policy context
response = client.messages.create(
model="claude-sonnet-4-6",
messages=[{"role":"user",
"content":"Approve refund #84721? $284.00, 18 days old"}]
)
← The wrapper intercepts this call. Before any response is processed, DarkMatter begins constructing a commit record.
▶ Click Next to begin the walkthrough
Claude returns its decision. The agent processes it. At this exact moment — before any action is taken — the wrapper hashes the full interaction and sends it to DarkMatter.
✓ Approved — Refund $284.00
Customer is within the 30-day return window (18 days). No prior refund history on this account. Amount is within auto-approval threshold ($500). Policy criteria met — approve immediately.
# Intercepted — before response reaches your code
payload_hash = sha256(canonical(input + output))
# → e11466b0601e6ec30070a8091a0e0455...
dm.commit(payload, timestamp="now")
# Sending to DarkMatter...
DarkMatter acknowledges the commit. The record is now sealed and independently verifiable. The agent can now proceed to process the refund.
✓ Committed — ctx_1777407029545_d088f4
integrity_hash: "e11466b0601e6ec3..."
chain_position: 1 of 1
chain_intact: true
assurance_level: "L2" # hash-chain verified (L3 adds customer signatures)
verify_url: "darkmatterhub.ai/r/ctx_..."
# Agent can now proceed — refund issued
✓ Refund processed for order #84721
The record existed before the refund was processed. If this decision is ever disputed, the proof was sealed at decision time — not reconstructed after the fact.
The verify URL can be shared with anyone — a regulator, auditor, counterparty, or your own legal team. No account needed to view or verify it.
Who can use this link
✓
Regulators & auditors
No DarkMatter account needed. They open the URL and see the full record, hash chain, and integrity status.
✓
Legal teams
Download the proof bundle (.json) and run the standalone verifier offline. No DarkMatter dependency.
✓
Your own systems
Call GET /api/verify/:id — public endpoint, no auth required. Returns the same integrity check shown above.
Record your own agents
One import change. Every instrumented decision committed, sealed, and verifiable. No infrastructure changes.