Tamper-Evident Audit Logging for Agentic AI: Hash Chain, HMAC, and Anchoring

A plain hash chain proves internal consistency, and that's all it proves. Delete the last forty entries and a forward-walking verifier still reports success. This short walks the Node.js pattern: hash each record over its canonical bytes, the previous hash and a monotonic sequence number, sign every entry with an HMAC whose key lives behind a separate signing boundary, and anchor the chain head somewhere the writer can't reach so truncation fails verification. It closes with the obligations the log has to satisfy under the EU AI Act: logging across the system's lifetime, a six-month retention floor, and human oversight recorded as an approval event with a named person and a timestamp rather than a boolean in a UI. Full write-up, including the record schema, the verifier you can run in CI, and the caveats about timelines still in motion: https://hackyjs.com/posts/tamper-evident-audit-logging-for-agentic-ai-a-nodejs-implementation-pattern

nodejsai-agentsaudit-loggingeu-ai-actcompliance

Read the post →