Developers

The open-source foundation for portable execution receipts.

sar-sdk is the public TypeScript implementation of SAR, available on GitHub and npm. It has been validated against the published fixtures and shared in the SAR proposal discussion. xMandate Control Plane builds policy, issuance, and verification services above it.

sar-sdk
import
{ signReceipt, verifyReceipt }
from
'sar-sdk'
;
const
receipt =
await
signReceipt(core, { privateKey });
await
verifyReceipt(receipt, keyResolver);
// ✓ INDEPENDENTLY VERIFIED
Open Source

sar-sdk

$npm install sar-sdk

An independent TypeScript SAR implementation, available on GitHub and npm. Sign, verify, and integrate cryptographic execution receipts in any runtime.

  • Published on npm — install and use today
  • Portable cryptographic receipts
  • Deterministic receipt identity (SHA-256)
  • Validated against published SAR fixtures
  • Offline verification — no callback required
  • Node.js 20+, Cloudflare Workers, Deno, Vercel Edge

The Receipt Primitive

What is SAR?

A Settlement Attestation Receipt records what happened, under what policy context, with what verdict, and signed by whom.

SAR is to execution what a signed receipt is to a transaction — portable, tamper-evident, and independently verifiable.

The 6 core fields are JCS-canonicalized (RFC 8785), hashed to a deterministic receipt_id via SHA-256, and signed with Ed25519. Extension fields are excluded from the signed core.

SarCore
task_id_hashsha256:a4b9...e2f1
verdictPASS
confidence0.95
reason_codeSPEC_MATCH
ts2026-03-14T10:32:00Z
verifier_kidxmandate-ed25519-01
SarReceipt (signed envelope)
receipt_version0.1
receipt_idsha256:9d2e...4a7b
sig_algEd25519
sigbase64url:8f3a...c9d1

Developer Flow

From constraints to verified proof.

Define what is allowed, sign a receipt when it happens, verify it independently downstream.

01Define constraints
scope agent:billing-service
actions stripe.charge, stripe.refund
max $10,000
require receipt
02Sign receipt
import { signReceipt, hashTaskId }
from 'sar-sdk';
const receipt = await signReceipt({
task_id_hash: hashTaskId('order-12345'),
verdict: 'PASS',
confidence: 0.95,
reason_code: 'SPEC_MATCH',
ts: new Date().toISOString(),
verifier_kid: 'xmandate-ed25519-01',
}, { privateKey });
03Verify downstream
import { verifyReceipt, resolveKidFromWellKnown }
from 'sar-sdk';
await verifyReceipt(receipt, (kid) =>
resolveKidFromWellKnown(origin, kid),
);
✓ policy COMPLIANT
✓ signature VALID
✓ status VERIFIED

Implementation Surface

Guard as a live trust surface.

xMandate Guard is one concrete trust surface that enforces execution policy and emits receipts. It demonstrates how policy rules become actionable governance signals through the receipt primitive.

Policy Rule
idadr-012-db-access
nameNo direct DB access from API layer
actionblock
messageViolates ADR-012. Use DataService.
Pass Receipt
verdictPASS
confidence0.98
reason_codePOLICY_COMPLIANT
receipt_idsha256:7f3a...b2c1
Fail Receipt
verdictFAIL
confidence1.00
reason_codeADR_012_VIOLATION
receipt_idsha256:2b8c...d4e9

Any trust surface — browser, API gateway, agent runtime, CI pipeline — can emit receipts through the same primitive.

From Primitive to Platform

Start with the primitive. Scale with the control plane.

The OSS foundation handles receipt signing and verification. Trust surfaces enforce policy at execution boundaries. The control plane centralizes governance above both.

Control Plane
xMandate Control Plane
Centralize policy, issuance, and verification.
Trust Surfaces
Guard · API gateways · Runtime hooks
Emit receipts at any execution boundary.
OSS Foundation
sar-sdk
Sign and verify receipts today. No infrastructure required.