Regulated enterprises (banking, healthcare, defense manufacturing) require non-repudiable, tamper-evident audit trails of autonomous agent decisions for SOX, OCC, HIPAA, and EU AI Act audits. Standard relational audit tables can be silently altered (UPDATE / DELETE) by a compromised service credential or privileged DBA.
EventLedger (src/aegis/ledger/) combines three cryptographic mechanisms over SQLite WAL:
canonical_json) and hashed alongside monotonic seq and prev_hash (H_0 = "0" * 64).event_hash is signed with an Ed25519 private key (cryptography C/Rust backend), preventing an attacker with write access to the SQLite file from recomputing a valid hash chain after modifying a historical row.SHA256(0x00 || leaf) and internal nodes use SHA256(0x01 || left || right), with odd trailing nodes promoted directly without self-duplication—preventing both second-preimage interior-node collisions and CVE-2012-2459-style duplicate-leaf attacks.generate_inclusion_proof) for external auditors; immediate detection of single-byte SQLite tampering (RT-12).threading.RLock), bounding single-file append throughput to ~5,000–10,000 events/sec (sufficient per node; horizontally sharded by tenant_id at fleet scale).