@piposlabs/praxa-verify
v0.2.0
Published
Offline verifier for Praxa audit-trail hash chains. Zero dependencies. Verify your AI compliance evidence without trusting Praxa's servers.
Maintainers
Readme
@piposlabs/praxa-verify
Offline verifier for Praxa audit-trail hash chains. Zero runtime dependencies. Single file. ~150 lines of audited code.
If you use Praxa to log your AI agent compliance evidence, this is the tool
that lets you prove Praxa never tampered with your audit trail — without
trusting Praxa's servers. Export your chain, run praxa-verify, get an
independent cryptographic confirmation.
Why this exists
Compliance auditors (SOC 2, EU AI Act, NIST AI RMF) increasingly want evidence that AI agent decisions are immutable. Praxa achieves this via a SHA-256 hash chain: every event references the hash of the prior event, so any tampering anywhere in the chain breaks all hashes from that point forward.
The chain is only as trustworthy as the code that verifies it. Rather than ask auditors to take our word for it, we publish the verifier as MIT-licensed zero-dependency code. Read it. Audit it. Run it on your own exported events.
Install
npm install -g @piposlabs/praxa-verify
# or invoke without install
npx @piposlabs/praxa-verify chain-export.jsonUsage
CLI
# Export your chain from Praxa (https://praxa.piposlab.com/dashboard/agents/<id>/export)
# then verify locally:
praxa-verify chain-export.json
# Pipe from stdin
curl -H "Authorization: Bearer $PRAXA_KEY" \
https://praxa.piposlab.com/api/v1/agents/<id>/export \
| praxa-verify --stdinExit codes:
| Code | Meaning |
| ---- | -------------------------------- |
| 0 | Chain verified |
| 1 | Tampering detected |
| 2 | Usage / file error |
| 3 | JSON parse error or wrong shape |
Library
import { verifyChain } from "@piposlabs/praxa-verify";
const result = verifyChain(events);
if (result.ok) {
console.log(`Chain OK — ${result.chain_length} events, head=${result.head_hash}`);
} else {
console.error(`Tampered at position ${result.tampered_position}: ${result.reason}`);
process.exit(1);
}Algorithm (v1, locked 2026-05-19)
For each event in chronological order:
entry_hash = SHA-256( canonicalize({
payload: { ...event_without_previous_hash_and_entry_hash },
previous_hash: <parent_entry_hash> or "" at chain root
}) )Where canonicalize is deterministic JSON serialization with:
- Object keys sorted alphabetically at every nesting level
- Arrays preserved in insertion order
undefinedvalues dropped,nullvalues kept literal
A chain is valid iff:
- Position 0 has
chain_position=0andprevious_hash=null|"" - Every position N's
previous_hashequals position N-1'sentry_hash - Every position N's
entry_hashmatches the recomputation from its payload
Known-answer test vector
If your build of praxa-verify doesn't reproduce this exact hash, something
is wrong — either with your install or with this code. Don't trust it.
Input payload:
{
"occurred_at": "2026-01-01T00:00:00.000Z",
"model": "claude-test",
"input_payload": { "a": 1, "b": 2 },
"output_payload": { "ok": true },
"triggered_by": "test",
"downstream_effects": [],
"chain_position": 0
}
previous_hash: null
Output entry_hash:
376f167cc23d397e93d7598cd259d4fc831ef31013eba59ee4cfd63417cb1b1bRun praxa-verify fixtures/known-answer.json after install to confirm
this verifier reproduces the exact same hash on your machine.
What about Praxa itself?
praxa-verify is the verifier. The full Praxa platform (auth, billing,
dashboards, retention, webhooks) lives at
praxa.piposlab.com — that part is closed
source. The hash chain itself is described in our public
algorithm spec and verified
by the code in this package.
License
MIT — see LICENSE.
Pipo Lab LLC · [email protected]
