Trailproof = Trail + Proof. Every event is cryptographically chained — tamper one, and the entire chain proves it.
Why Trailproof?
AI agents make autonomous decisions — approving requests, writing to memory, calling external APIs. Regulators (EU AI Act Article 19) and customers increasingly demand proof that these actions were logged faithfully and that nothing was altered after the fact. Traditional logging can’t provide that guarantee.| Capability | Basic Logging | Trailproof |
|---|---|---|
| Tamper detection | None — anyone with DB access can edit | SHA-256 hash chain; modify one event, every subsequent hash breaks |
| Cross-SDK parity | Manual effort to keep in sync | Python + TypeScript produce identical hashes for same data |
| Dependencies | Often pulls in heavy ORMs or cloud SDKs | Zero runtime deps — stdlib only |
| Provenance | No proof of origin | Optional HMAC-SHA256 proves who created the event |
| Multi-tenancy | Manual tenant isolation | Built-in tenant_id on every event |
| Verification | Manual spot-checks | tp.verify() walks entire chain in one call |
The Trailproof Pipeline
Every event flows through a validation, hashing, optional signing, and append-only storage pipeline. Verification walks the chain backwards to check integrity.Core Pillars
Tamper-Evident Chain
SHA-256 hash chain links every event to the previous one. Modify event 5 in a chain of 100 — events 5 through 100 all fail verification. You can’t silently tamper with history.
Dual SDK Parity
Native libraries for Python and TypeScript with identical behavior. Same canonical JSON algorithm, same genesis hash, same test vectors. Emit in Python, verify in TypeScript.
Zero Dependencies
Stdlib-only in Python (
hashlib, json, uuid), Node.js built-ins only in TypeScript (crypto, fs). No supply chain risk from your audit trail.HMAC Signing
Optional HMAC-SHA256 signatures prove event provenance — that events were created by the holder of a specific secret key. Uses timing-safe comparison to prevent timing attacks.
Quick Example
The 10-Field Event Envelope
| Field | Type | Description |
|---|---|---|
event_id | string | UUID v4, auto-generated |
event_type | string | Namespaced type (e.g., myapp.user.login) |
timestamp | string | ISO-8601 UTC, auto-generated |
actor_id | string | Who performed the action |
tenant_id | string | Tenant/org isolation key |
trace_id | string? | Cross-system correlation |
session_id | string? | Session grouping |
payload | object | Domain-specific data (opaque to Trailproof) |
prev_hash | string | Hash of the previous event |
hash | string | SHA-256 of this event |
signature | string? | HMAC-SHA256 if signer configured |