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
Files
- app.py (13 lines)
- audit.py (34 lines)
- compare.py (37 lines)
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.