Tamper-evident audit trails for AI agents. v0, experimental.
Project description
WitnessKit (Python) · v0
Tamper-evident audit trails for AI agents. Every action becomes a signed, hash-chained log entry; any later tamper is detected and located.
v0, experimental, unaudited. Not yet on PyPI — install from source.
Signing uses the vetted cryptography library and RFC 8785 canonicalization;
pure-Python fallbacks keep it runnable with zero deps. The signing key stays local.
Install
Not yet on PyPI (v0). From source:
git clone https://github.com/major-matters/witnesskit
pip install -e witnesskit/python
Or drop the witnesskit/ folder next to your code.
Quick start
from witnesskit import Chain, generate_keypair, verify_chain
key, public_key = generate_keypair()
trail = Chain(key, actor="agent-7")
trail.append("tool_call", {"tool": "search", "query": "running shoes"})
trail.append("payment", {"merchant": "Fleet Feet", "amount": 240, "currency": "USD"})
verdict = verify_chain(trail.to_json(), trusted_keys=[public_key])
print(verdict["valid"], verdict["reason"]) # True chain intact
A tampered entry returns {"valid": False, "broken_at": <index>, "reason": ...}.
Security model
A valid signature proves integrity, not authority — pin the issuer with
trusted_keys; without it (or allow_unverified_issuer=True) verification fails
closed. verify_chain never throws. Tamper-evident, not tamper-proof; see
../SECURITY.md.
Tests
PYTHONPATH=. python3 tests/test_witnesskit.py # unit (no pytest needed)
PYTHONPATH=. python3 tests/test_properties.py # property-based (needs hypothesis)
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 witnesskit-0.0.2.tar.gz.
File metadata
- Download URL: witnesskit-0.0.2.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d1d76f98b9a3afef5e12bbfd005078885ffdb415fbd270589aca97ca35ba99b
|
|
| MD5 |
73582fee77b720de7e3b98708ed25420
|
|
| BLAKE2b-256 |
ec8ccb0f7c3afc0125b4ec18cd927165283457470c4c4cd65c73ba616d47fe53
|
File details
Details for the file witnesskit-0.0.2-py3-none-any.whl.
File metadata
- Download URL: witnesskit-0.0.2-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8087ed55c71c10248209ba26f1193b20884edceeea50563d4cad5eba61efdd2
|
|
| MD5 |
c4b3056d5018776e192658307eee955e
|
|
| BLAKE2b-256 |
e21a66929cd91ed2e4ab0055142c6ad74379f3e3fbaa668e666f17fa9bce7304
|