Verifiable append-only audit logs for Python apps and agents
Project description
Tamperloom
Verifiable append-only audit logs for Python apps and agents.
The problem
Standard logs don't prove integrity. Anyone with access to the file or database can edit, delete, or insert entries and leave no trace.
What this does
Every entry Tamperloom writes is cryptographically linked to the one before it. If anything is changed after the fact, the verifier catches it and tells you which entry broke the chain.
Entries are stored as JSONL — one per line, no database required.
Install
pip install tamperloom
Quick start
from tamperloom import AuditLogger
logger = AuditLogger("audit.jsonl")
logger.log(
event_type="user.role_changed",
actor="admin_42",
action="promote_user",
target="user_18",
metadata={"old_role": "member", "new_role": "moderator"}
)
Verify the log
tamperloom verify audit.jsonl
# chain valid: 1 entries verified
What happens when someone tampers with it
# edit any value in audit.jsonl manually, then run:
tamperloom verify audit.jsonl
# hash mismatch at entry 0 (id: bde6a704-9e85-41bb-ad25-8125e4bc4ccd)
How it works
Each log entry contains a hash of itself plus the hash of the previous entry. This creates a chain — you can't silently edit any entry without breaking every hash that follows it.
The first entry uses a genesis hash of 64 zeros as its prev_hash.
Framework examples
examples/flask_app/— Flask REST API with audit logging on login and delete endpointsexamples/fastapi_app/— Same thing with FastAPI and uvicorn
Use cases
- Admin action logging
- Permission and role changes
- Record deletions
- API key creation and revocation
- AI agent tool calls and policy denials
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tamperloom-0.1.0.tar.gz.
File metadata
- Download URL: tamperloom-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d04212e522694d339dcc173ba1b8d2d06d8f18602e82608cf8d3c62ce1c10d60
|
|
| MD5 |
58eb4e9cf57fb2d43ec1c3c9813fb0a3
|
|
| BLAKE2b-256 |
0342d8bb935c6addb2c88ff26ae28c1912243f1f879c0e1442d3af713a0201f2
|
File details
Details for the file tamperloom-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tamperloom-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eac7ddc5d9b9575828397e6ec7eeaccb2e17601507962dae2aae8eaeed91ba38
|
|
| MD5 |
6485efb410bd8d1867753a28ef866aaf
|
|
| BLAKE2b-256 |
2a412e44a3cc1f1ad9e74bb18a44ab9ddde693ac1caf6b96597fd260fe19e0f9
|