Attesta supports pluggable audit backends. The default is a built-in SHA-256 hash-chained JSONL logger (described below). You can also use TrailProof as an alternative backend for enhanced features like HMAC signing and multi-tenancy. See the TrailProof Integration Guide for details.
Hash Chain Mechanism
Each audit entry contains achain_hash computed from the previous entry’s hash and the current entry’s canonical JSON:
"0" * 64 (64 zeros) as its previous_hash.
Canonical JSON means keys are sorted alphabetically, no extra whitespace, and consistent encoding. This ensures the same data always produces the same hash regardless of serialization order.
Storage Format
The audit trail is stored as JSONL (JSON Lines) — one JSON object per line, one line per entry. This format is:- Append-only — New entries are appended, never inserted
- Streamable — Can be processed line-by-line without loading the entire file
- Grep-friendly — Standard text tools work out of the box
AuditEntry Fields
Each entry in the audit trail contains these fields:Usage
Chain Verification
Theverify_chain() method walks the entire log from the genesis entry and recomputes every hash. If any entry has been modified, inserted, deleted, or reordered, the verification fails.
What Verification Catches
CLI Verification
The Attesta CLI provides a convenient command for chain verification:Rubber-Stamp Detection
Thefind_rubber_stamps() method returns all entries where min_review_met is false — meaning the operator responded faster than the minimum review time for their challenge type.
Example Audit Entry
Challenge System
How challenges generate the audit data
CLI Audit Commands
Verify and query audit trails from the command line
TrailProof Integration
Switch to TrailProof for HMAC signing and multi-tenancy
Production Deployment
Best practices for audit logs in production