Hash-Chained Audit Trail

Every governance evaluation produces an immutable audit record linked to the previous record via cryptographic hash, creating a tamper-evident chain.

How It Works

Each audit record contains:

  • Agent ID, action type, target, parameters

  • Governance verdict (ALLOW, DENY, ESCALATE, MODIFY, SUSPEND)

  • UCS score

  • All 14 per-dimension scores

  • Which tier decided and the reasoning

  • Timestamp

  • record_hash — SHA-256 hash linking this record to the previous

Hash Chain

Record 1: hash = SHA-256(genesis_seed + record_1_data)
Record 2: hash = SHA-256(record_1_hash + record_2_data)
Record 3: hash = SHA-256(record_2_hash + record_3_data)
...

If any record is modified, deleted, or reordered, the hash chain breaks. Verification walks the chain from any record back to the genesis record, checking each link.

Tamper Evidence

The hash chain provides:

  • Insertion detection — new records between existing ones break the chain

  • Modification detection — changing any field changes the hash

  • Deletion detection — removing a record breaks the chain

  • Reordering detection — records out of order break the chain

Viewing the Audit Trail

CLI

Programmatic

Chain Verification

CLI

API

Programmatic

Export Formats

Audit records can be exported for external analysis:

Compliance Evidence Bundles

Export audit records packaged with governance context for compliance reviews:

Audit Retention

Governance Scorecard Integration

The governance scorecard uses the latest audit record hash as a provenance marker. The scorecard's audit_record_hash field lets auditors verify that the scorecard was generated from an unmodified audit trail.

BehaviorLedger

The audit trail logs what happened. The BehaviorLedger extends this by reconstructing why it happened. Each BehaviorLedgerEntry is a complete, self-contained decision record that captures the full pipeline trace, behavioral state, contract snapshot, semantic context, causal links to previous decisions, and what would need to change for a different outcome. Enable with enable_behavior_ledger=True in RuntimeConfig.

Last updated