AUD-2.0: audit and evidence integrity
Append-only events, payload reconstruction, cryptographic chaining, retention, legal hold and periodic integrity verification.
How to interpret this document
This content describes technical and methodological behavior that is implemented or explicitly planned in the product. When a control depends on configuration, a provider, a secret, a contract or legal approval, that dependency must remain visible.
Primary store
ComplianceAuditEvent is the primary AUD-2.0 evidence entity. The older AuditLog remains as legacy history, not the primary integrity chain.
Append-only model
Events are written through backend service-role flows. Ordinary users and administrators do not receive generic update or delete authority over the evidence chain.
Hashes
Each event persists payload_hash, previous_hash and event_hash. Verification reconstructs stored payload fields and recalculates the hash instead of blindly trusting the persisted value.
Chain mode
The baseline uses SHA-256 over previous_hash + payload_hash. When COMPLIANCE_HMAC_SECRET is configured, new events can use HMAC-SHA256.
Sanitization
Sensitive key patterns such as password, secret, token, authorization, api_key, cookie, session, prompt, response, content and email are excluded from generic compliance snapshots.
Retention
The active policy defines retention_days and each event receives retention_until. The current technical baseline is 2555 days, approximately seven years, without claiming that this is universally required by law.
Legal hold
Legal hold preserves evidence when investigation, litigation or another preservation obligation applies. Applying and removing a hold should itself be governed.
Verification
Periodic checks record events checked, broken links, hash mismatches and the first invalid event when integrity fails.