Audit Trail
Every stage of the control path emits an immutable event to the audit trail powered by Trailproof. This produces a complete forensic record for every memory operation — from the moment it is received through to its final committed or blocked state. Trailproof provides SHA-256 hash chains, HMAC signing, query, and verification out of the box. Memproof delegates all audit trail responsibilities to Trailproof so you get tamper-evident logging without managing event storage internals.Event Types
Events are namespaced undermemproof.pipeline.*:
TrailEvent Structure
Each event is a TrailproofTrailEvent with the following fields:
- Python
- TypeScript
The
metadata field carries the operation_id, tenant_id, project_id, and any stage-specific payload. Querying by operation_id within metadata returns the full lifecycle trace for a single operation.Storage Backends
Trailproof provides two storage backends:In-Memory Store
Default. Events are stored in memory. Fast and zero-dependency, but events are lost on process restart. Suitable for development and testing.
JSONL Store
Durable persistence using append-only JSONL (JSON Lines) files. Each event is written as a single line to disk. Suitable for production deployments.
Configuring the Storage Backend
- Python
- TypeScript
HMAC-SHA256 Signing
For tamper-evident audit trails, provide a signing key. Trailproof signs each event with HMAC-SHA256 and includes the signature in theTrailEvent:
- Python
- TypeScript
Hash Chain Verification
Trailproof links every event to its predecessor via SHA-256 hashes, forming an append-only chain. If any event is tampered with, the chain breaks and verification fails. Use theverify_audit_trail() / verifyAuditTrail() method to validate the entire chain:
- Python
- TypeScript
Querying the Audit Trail
Use thequery_audit_trail() / queryAuditTrail() method to search events with filtering:
- Python
- TypeScript
Retrieving a Full Operation Trace
To get every event for a single operation in chronological order, filter byoperation_id in the metadata:
- Python
- TypeScript