witnesskit
v0.0.2
Published
Tamper-evident audit trails for AI agents. v0, experimental.
Downloads
316
Maintainers
Readme
WitnessKit (TypeScript) · v0
Tamper-evident audit trails for AI agents. TypeScript port of WitnessKit; trails are wire-compatible with the Python SDK.
v0, experimental, unaudited. Not yet on npm. Requires Node 22.6+ (runs
.tsdirectly via type-stripping;npm run buildemitsdist/+ types).
Crypto uses Node's built-in Ed25519; canonicalization uses canonicalize (RFC 8785),
byte-identical to the Python SDK's hashing.
Install
Not yet on npm (v0). From source:
git clone https://github.com/major-matters/witnesskit
cd witnesskit/typescript && npm install && npm run buildQuick start
import { Chain, generateKeypair, verifyChain } from "witnesskit";
const { privateKey, publicKey } = generateKeypair();
const trail = new Chain(privateKey, "agent-7");
trail.append("tool_call", { tool: "search", query: "running shoes" });
trail.append("payment", { merchant: "Fleet Feet", amount: 240, currency: "USD" });
const verdict = verifyChain(trail.toJSON(), { trustedKeys: [publicKey] });
console.log(verdict.valid, verdict.reason); // true chain intactSecurity model
Pin the issuer with trustedKeys; without it (or allowUnverifiedIssuer: true)
verification fails closed. verifyChain never throws. Tamper-evident, not
tamper-proof — same model as the Python SDK; see ../SECURITY.md.
Tests
npm testLicense
MIT.
