checkpointai
v0.1.0
Published
The control layer for AI agents. Check any agent action before it runs: allow, stop, or escalate.
Downloads
30
Maintainers
Readme
Checkpoint TypeScript SDK
The control layer for AI agents. Check any agent action before it runs, evaluate it against your policy, and decide: allow, stop, or escalate. Every decision is written to a tamper-evident audit log.
Install
npm install checkpoint-sdkQuickstart
import { check, setPolicy, Policy, rule } from "checkpoint-sdk";
setPolicy(
new Policy([
rule("transfer_funds", { when: "amount > 25000", verdict: "escalate", to: "cfo" }),
rule("export_records", { when: "pii_rows > 10000", verdict: "stop" }),
]),
);
async function processPayment(amount: number, recipient: string) {
const verdict = await check("transfer_funds", { amount, recipient });
if (verdict.allowed) {
await transferFunds(amount, recipient);
}
}check() is async and resolves to a verdict. If the action crosses a hard limit it stops (throwing CheckpointStopped); if it needs a human it escalates.
The three verdicts
- allow: within bounds, proceeds.
- stop: crosses a hard limit, execution stops.
- escalate: needs a human, routes to the right person and waits.
Audit log
import { auditLog } from "checkpoint-sdk";
for (const e of auditLog.entries()) console.log(e.logId, e.verdict, e.action);
console.log(auditLog.verify()); // hash chain intactRun the example and tests
npm install
npm run example
npm testNote
This is a reference implementation with a local in-memory engine. In production the SDK forwards verdicts to the Checkpoint service and writes to a hosted audit log. The public API is identical.
License
MIT.
