learning-it by example

Back to the video

Audit Logs for AI Apps: Tamper-Evident Logging in Python

I edited one line of my own audit log. It noticed. Then I edited the last line.

Video #98 ยท AI security and governance

Steps in the video

  1. 0:00 I edited one line of my own log, and it noticed
  2. 0:26 The idea
  3. 0:55 Setup
  4. 1:16 The log
  5. 1:42 The assistant
  6. 2:06 Check the log
  7. 3:02 What this does not show
  8. 3:33 Mistakes to avoid
  9. 4:00 My take and next steps
  10. 4:30 Recap

Files

  • app.py (13 lines)
  • audit.py (34 lines)
  • compare.py (37 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

A pretend assistant with no model, six requests, one log file on one disk. The chain does not catch an edit to the last line, lines deleted from the end, or a rewrite of the whole file, unless the latest hash is kept somewhere else. No timestamps, so that the output repeats; one email pattern is not full masking of personal data; hashes are cut to 12 characters.

Sources

Learning IT by Example.