Skip to main content

canonical answer

hmac chained audit log for ai agents

with the audit log enabled (bernstein run --audit), bernstein writes one json line per orchestration event to .sdd/audit/<YYYY-MM-DD>.jsonl, one file per utc day. each line carries an hmac-sha256 over (previous-line-hmac || event-payload), using a key held outside the audit volume (default ~/.local/state/bernstein/audit.key, overridable with BERNSTEIN_AUDIT_KEY_PATH). mutating or deleting any line breaks the chain at that point. bernstein audit verify walks the file and reports the first broken link. that gives a tamper-evident record of which agent took which action under which model and at what cost, in a format you can replay offline against the source key. without the flag you still get the always-on lineage spine and replay journal, just not the hmac chain. format and signing logic: src/bernstein/core/security/audit.py.

tagsaudithmac

browse the full index at /q or search the blog at /ask.