What the chain proves
Ordering and integrity within a chain, and that the pinned recorder signed each event.
AI agents now initiate payments, change records, and call tools across third-party systems at machine speed. The evidence available when those actions are disputed is usually an application log: mutable, debugging-oriented, and controlled by the party that owns the system. Sheaf closes that gap with an out-of-process recorder that captures MCP tool calls at the boundary, signs them with Ed25519 keys the agent never holds, links them into a hash chain, and anchors Merkle epoch roots on Base L2. A portable .sheaf bundle can then prove a specific action to an auditor, issuer, or counterparty through selective disclosure — without exposing the rest of the chain and without trusting Sheaf's servers. This document also states what Sheaf does not prove (section 07).
Application logs are built to help engineers debug software. They are not built to survive an adversarial review. A log line can be edited at the source, rewritten in a database, dropped by a retention policy, or reconstructed from a different model version. Even an honest operator usually cannot prove that the log it presents is the same log its systems produced at execution time.
Observability platforms improve search and retention, but they preserve the same trust model: the operator owns the pipeline, the timestamps, and the storage. An auditor who receives a screenshot or a CSV export is still asked to trust the party whose conduct is in question. For high-value disputes, that is not evidence. It is a narrative with better formatting.
Regulation and payments are moving the same way. EU AI Act Article 12 requires high-risk AI systems to technically allow the automatic recording of events (logs) over their lifetime. In card payments, agent-initiated transactions are still disputed under the existing chargeback reason codes; the networks have not published a binding agent-specific dispute rule. That puts the burden on evidence: a merchant increasingly has to show what the customer authorised the agent to do, not merely that a checkout session completed. A mutable order log answers neither question.
Sheaf records execution, not intention alone. The recorder sits outside the agent process and observes the same JSON-RPC messages the agent exchanges with an MCP server. Each event is signed, chained, batched, and anchored. The result is a receipt that another party can verify with a pinned public key and a Base RPC.
A transparent MCP proxy wraps the underlying server. When the agent sends tools/call, the proxy captures the tool name, arguments, and the result returned by the server. It also captures resources/read and sampling/createMessage where configured. Argument and result payloads are hashed; raw payloads are not sent to the recorder by default. The interception point is the boundary itself, not a vendor API and not the agent's own instrumentation.
For runtime enforcement, the same boundary evaluates a policy document before the call is forwarded. An ALLOW is recorded and forwarded. A BLOCK or REQUIRE_APPROVAL is recorded with result: "blocked" and returned to the agent as a structured JSON-RPC policy error; the underlying server never sees the call. The audit trail therefore contains both the actions that ran and the actions that were stopped. REQUIRE_APPROVAL currently blocks; a signed-approval flow is not built yet.
@sheafhq/mcp-recorder 0.4.0 on npm enforces sheaf.policy/1 (ALLOW, BLOCK, REQUIRE_APPROVAL with constraints) and writes a local signing ledger with wrap --local. The reference simulation still pins 0.3.0 and its earlier sheaf-policy/1 allow/deny format; it will move to sheaf.policy/1.The recorder co-signs each event with Ed25519. The agent never holds the private key, and the wrapped MCP server does not need to be modified. The signed payload is the RFC 8785 (JCS) canonicalization of {v, event, chain}, which makes the signature deterministic across languages and platforms. The recorder's signature establishes that the event was observed and chained by the recorder whose key is pinned in the verifier. It says nothing about who the agent is: the envelope's signatures.actor field is not part of the signed payload or the chained hash, and verifiers ignore it.
Every event carries a chain identifier and a sequence number. Its prev_hash is the hash of the previous envelope, excluding signatures. Changing an earlier event changes every later prev_hash, so an edit cannot be hidden by rewriting one record. The recorder periodically batches the events it has received into an epoch and computes a Merkle root over the event leaves. The root commits to the whole batch with a single 32-byte value; any individual event can later be proven against it with a logarithmic-size path.
The epoch root is written to Base L2 in the anchor transaction calldata. The transaction's block is the upper time bound: the root, and every event under it, existed by that block, and no one can change those events afterwards without the proof failing. Verification pins the expected anchorer address and network, reads the transaction from a Base RPC, and checks that the calldata root matches the Merkle root in the bundle. Sheaf's database is not part of the verification path.
Ordering and integrity within a chain, and that the pinned recorder signed each event.
The epoch root, and so each event under it, existed on a public chain by a specific block, independent of Sheaf's servers.
A merchant should not have to hand over an entire agent history to prove one transaction. Sheaf uses Merkle-path disclosure: the bundle contains the selected event's signed envelope, its leaf hash, its Merkle inclusion path, and the epoch root. The verifier recomputes the root from the leaf and sibling hashes, then checks the root against the Base anchor. The rest of the epoch stays private.
For a contiguous range, the bundle also includes the events immediately before and after the window. These boundary references prove that the disclosed set is a contiguous slice of the chain and that no event was silently omitted from the middle. Payloads are separately hash-bound: the bundle can include the arguments or result needed to evaluate a claim, or only their hashes when the dispute does not require the raw content.
The result is a portable artifact that supports a narrow claim — “this agent called this tool with these arguments and received this result” — without exposing unrelated customers, tools, or sessions. The same primitive carries the Dispute Bundle's mandate, delegation, consent, execution, and policy evidence (sheaf.dispute-bundle/1, 14 checks).
Verification is local and zero-dependency. The browser verifier at /verify is a single HTML file with the verification code inlined; it does not load a CDN, a framework, or a Sheaf API. The Node verifier, @sheafhq/verify, exposes the same checks as a library and CLI, and its output is byte-identical to the browser's. In offline mode it validates the hash chain, signatures, Merkle paths, bundle hash, payload hashes, and evidence documents without a network request. In online mode it additionally reads the anchor transaction from a Base RPC and confirms the root, anchorer, and block.
Trust is pinned, not discovered. The verifier ships with the recorder public keys and the authorised Base anchorers for its release. A bundle cannot introduce a new key by claiming a URL; the verifier never fetches public_key_url. Rotating a recorder key or anchorer therefore requires a new verifier release, and an old verifier fails closed on a bundle signed by a key it does not know. The --trust <path> option exists for tests and local ledgers, not as a production rotation mechanism.
Offline mode proves integrity, not anchor presence. The anchor_on_base check is reported as unconfirmed, and the CLI exits non-zero unless the caller explicitly accepts an unconfirmed anchor. Online mode is the stronger claim: the record was anchored on Base and has not been altered since.
subject.claims. Those are the author's statements. The verifier re-reads each value from the signed event or the payload it cites and fails with CLAIM_MISMATCH if they differ. The mandate's scope is checked only against those derived values; if the mandate caps an amount and the amount is not in the signed payload, the result is EVIDENCE_GAP.sheaf.dispute-bundle/1 with any unknown top-level field fails, so content a verifier does not understand can never be silently ignored.The architecture is exercised end to end by a reference simulation that runs on a single machine with no cloud services. A buyer agent is told to purchase a €200 dataset and, if that fails, a €100 one. A policy firewall at the MCP boundary blocks the €200 call before it reaches the merchant and allows the €100 purchase. Both decisions, the denial as well as the sale, are signed by the recorder Worker running locally, hash-chained, and anchored on a local EVM chain (anvil) standing in for Base.
An independent notary then audits the exported evidence bundle offline. It has only the bundle, the pinned recorder key and anchorer, and an RPC for the anchor chain. It re-checks every signature, Merkle path and anchor, proves the session is complete rather than a selected subset, and re-evaluates the policy against the disclosed inputs to confirm each recorded decision. The same run feeds the notary six forged variants of the bundle (a hidden denial, a dropped close event, a rewritten decision, an altered amount, a substituted policy, an unset enforcement flag), and every one must be rejected.
git clone https://github.com/sheafhq/sheaf.git
cd sheaf
npm install && npm run sim
Requirements: Node.js 22.12+ and Foundry (anvil). The run prints a Notary Certificate and exits 0 only if the honest bundle is accepted and every forgery rejected. It has been tested from a fresh clone on Linux (including WSL); Windows and macOS launchers are included. Details: simulation/README.
event.actor is a label supplied by the client, not an authenticated identity. Sheaf proves what crossed the boundary it recorded, not who was on the other side.event.ts is client-supplied. The trustworthy bound is the anchor block: the event existed no later than that.dispute-verify.html from the source or use the CLI.Sheaf is a Developer Preview. The recorder, verifier and simulation are open source and usable today; formats may still change, and versioned format changes are made so that old bundles keep verifying.
Sheaf is designed with the following in mind. None of this is a certification or a conformance claim; read it as design intent.
This document describes protocol behaviour. It is not legal advice, and it does not replace a regulator's or card network's assessment of a specific dispute.
← Back to Home