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.
Release files for witnesskit 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| witnesskit-0.0.2.tar.gz | 13.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| witnesskit-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.8 kB
Release files / witnesskit-0.0.2.tar.gz
| Download URL | witnesskit-0.0.2.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d1d76f98b9a3afef5e12bbfd005078885ffdb415fbd270589aca97ca35ba99b
|
|
BLAKE2b-256 checksum How to use checksums |
ec8ccb0f7c3afc0125b4ec18cd927165283457470c4c4cd65c73ba616d47fe53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / witnesskit-0.0.2-py3-none-any.whl
| Download URL | witnesskit-0.0.2-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f8087ed55c71c10248209ba26f1193b20884edceeea50563d4cad5eba61efdd2
|
|
BLAKE2b-256 checksum How to use checksums |
e21a66929cd91ed2e4ab0055142c6ad74379f3e3fbaa668e666f17fa9bce7304
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|