The TypeScript SDK.
Apache-2.0. A tamper-evident audit chain, a policy engine, an approval queue and Article 12-shaped bundle export, plus optional memory, reputation-score and payment-rail modules. Free to self-host. Paid options are design-partner pilots and a managed Pro plan. Evidence tooling, not legal compliance.
Install
npm i @mnemopay/sdk
Quick start: record, export, verify
Run against the published 1.15.2 on Node 25.9.0. The full walkthrough, including tampering and limits, is in the how-to.
import { AuditChain, verifyBundle } from "@mnemopay/sdk/governance";
const chain = new AuditChain({ path: "./agent-audit.jsonl" });
chain.emit("action.proposed", { agent: "refund-bot", action: "refund", amountUsd: 40 });
chain.emit("approval.granted", { approver: "ops@example.com" });
chain.emit("action.executed", { txId: "tx-1001", amountUsd: 40 });
const bundle = chain.rollAndExport({ pathOut: "./bundle.json", meta: { system: "refund-bot" } });
console.log(verifyBundle(bundle)); // { ok: true } on an untouched bundle
const forged = structuredClone(bundle);
forged.events[2].payload.amountUsd = 4;
console.log(verifyBundle(forged)); // { ok: false, reason: 'root_mismatch' }
Policy and human approval
Also verified on 1.15.2; see the full example.
import { compilePolicy, evaluateAction, InMemoryApprovalStore, routeVerdict } from "@mnemopay/sdk/governance";
const policy = compilePolicy({ id: "refund-bot-policy", version: 1, rules: [
{ id: "cap", applies_to: ["payment"], hard_cap_usd: 500 },
{ id: "human-above-25", applies_to: ["payment"], approval_threshold_usd: 25 },
]});
const approvals = new InMemoryApprovalStore();
const action = { kind: "payment", target: "refund:A-1002", estimated_usd: 40 };
const routed = routeVerdict(approvals, action, evaluateAction(policy, action));
// { allowed: false, blocker: 'pending', approval_id: '...' } -> a human calls approvals.decide(id, "approve", "ops@example.com")
Modules
governance: audit chain, policy, approvals, risk classification, action ledger, Article 12 bundle writer, anchor-sink interface (mock only; no production deployment anchors on chain yet). recall: persistent agent memory. identity: DIDs and signed bundles. rails: payment-rail adapters (live settlement is verified only against mocks and an opt-in Stripe test-mode test). middleware/*: wrappers for OpenAI, Anthropic, Gemini, Cohere, Mistral. swarm, langgraph, mcp. See the package README for each module’s current API; the examples that used to be on this page referenced names that do not exist in 1.15.2 and have been removed.
MCP server
claude mcp add mnemopay -s user -- npx -y @mnemopay/sdk # approvals + audit export are opt-in: MNEMOPAY_TOOLS=hitl,governance npx -y @mnemopay/sdk
Not in the open-source SDK
Hosted score storage and managed rails are the Pro plan (api.mcp.mnemopay.com). Hands-on integration help is the pilot. Self-hosting everything else is free.
Where it is built in public
Repo: github.com/mnemopay/mnemopay-sdk · Discussions: open · Changelog: CHANGELOG.md