Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

witnesskit-0.0.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

witnesskit-0.0.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file witnesskit-0.0.1.tar.gz.

File metadata

  • Download URL: witnesskit-0.0.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for witnesskit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6e236b27d013c390de622a48baad0bb0fb710d9502d15e5b76147ceed03b8d3a
MD5 e88055a5998dfb1a2eac4c3a69fb6cc3
BLAKE2b-256 0184ad82ba4e56a20e4e280760a3825e7fd210c654cf2c158cc6027c455923d5

See more details on using hashes here.

File details

Details for the file witnesskit-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: witnesskit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for witnesskit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9ff33b11c7cd721b45414b3e40bd4cbbb1104873f94915a5279bf8f33534ef6
MD5 598c4d9cb1db2ec0901b732efcf71037
BLAKE2b-256 484c29196ac7508cde01c1272fb6c8d780af8d9f649d2f961953536cf4398b46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page