@aegisys/record
v1.0.0
Published
Sealed, verifiable receipts for AI agent actions — Apache 2.0
Maintainers
Readme
@aegisys/record
Sealed, verifiable receipts for AI agent actions.
npm install @aegisys/recordWhat it does
Your AI doesn't just write code — it does things. It sends the email, charges the card, deletes the row. When one of those goes wrong, you need to prove what happened.
@aegisys/record wraps your agent's actions and produces sealed receipts — cryptographically signed, tamper-evident records that anyone can verify without taking your word for it.
Quick start
import { createWitness } from "@aegisys/record";
const w = await createWitness({
tenantId: "acme-corp",
seedHex: "5d2e...".padEnd(64, "0"), // 32-byte Ed25519 seed
});
// Wrap any async function
const charge = w.wrap("billing.charge", stripe.charge);
await charge({ amount: 2000 });
// → sealed receipt saved automatically
// Get all receipts
const receipts = w.getReceipts();
console.log(receipts[0].signature.value); // Ed25519 signatureVerify a receipt
import { verify } from "@aegisys/record";
const result = await verify(receipt);
if (result.valid) {
console.log("✓ receipt is genuine");
} else {
console.error("✗ tampered:", result.error);
}CLI
# Verify a single receipt
npx aegisys-record verify receipt.json
# Verify a batch (JSONL)
npx aegisys-record verify-batch receipts.jsonl
# Generate Merkle proof for receipt at index 0
npx aegisys-record prove receipts.jsonl 0 > proof.json
# Verify inclusion in Merkle root
npx aegisys-record verify-inclusion receipt.json <root-hash> proof.jsonHow it works
- Wrap —
w.wrap(action, fn)intercepts every call - Seal — Receipt is canonicalized (sorted keys, deterministic) and hashed
- Sign — Ed25519 signature proves the receipt came from you
- Chain — Each receipt links to the previous via
previous_hash - Anchor — Merkle root commits to a batch of receipts
Change one character and the seal breaks. Even you can't fake it.
License
Apache 2.0 — free forever, including commercial use.
