Python SDK for Wytness — audit logging for AI agents with cryptographic signing and chain integrity
Project description
Wytness Python SDK
Audit logging for AI agents. Every action your AI agent takes is cryptographically signed, hash-chained, and streamed to the Wytness platform for compliance and observability.
Installation
pip install wytness-sdk
Quick Start
from wytness import AuditClient, audit_tool
# Initialize the client
client = AuditClient(
agent_id="my-agent",
human_operator_id="user-123",
)
# Decorate any tool your agent calls
@audit_tool(client=client)
def send_email(to: str, subject: str, body: str):
# Your tool implementation
pass
# Every call is automatically logged, signed, and chained
send_email(to="team@company.com", subject="Report", body="Weekly summary")
Features
- Cryptographic signing — every event is signed with Ed25519
- Hash chaining — tamper-evident chain of events per agent session
- Automatic redaction — secrets in parameters are automatically redacted
- Kafka or HTTP — stream events via Kafka or HTTP API
- File fallback — events are saved locally if the network is unavailable
HTTP Emitter (Recommended)
Send events directly to the Wytness API using your API key:
client = AuditClient(
agent_id="my-agent",
human_operator_id="user-123",
http_endpoint="https://api.wytness.io",
http_api_key="aa_live_...",
)
API
AuditClient(agent_id, **kwargs)
| Parameter | Type | Default | Description |
|---|---|---|---|
agent_id |
str |
required | Unique identifier for the agent |
agent_version |
str |
"0.1.0" |
Version of the agent |
human_operator_id |
str |
"unknown" |
ID of the human overseeing the agent |
signing_key_path |
str |
"./keys/signing.key" |
Path to Ed25519 private key (auto-generated if missing) |
kafka_bootstrap_servers |
str|None |
None |
Kafka bootstrap servers |
kafka_topic |
str |
"wytness-events" |
Kafka topic name |
http_endpoint |
str|None |
None |
HTTP API endpoint URL |
http_api_key |
str|None |
None |
API key for HTTP endpoint |
fallback_log_path |
str |
"./audit_fallback.jsonl" |
Local fallback file path |
@audit_tool(client, task_id="default")
Decorator that wraps a function to automatically log audit events. Captures:
- Function name, parameters (with secret redaction), and return value hash
- Execution duration, success/failure status, and error codes
- Cryptographic signature and hash chain link
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 wytness_sdk-0.1.0.tar.gz.
File metadata
- Download URL: wytness_sdk-0.1.0.tar.gz
- Upload date:
- Size: 41.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8536d5cdc96cd1e24343b9c1b528f6da08e82c568108974e975edcb5b115f787
|
|
| MD5 |
397dfdfe701b3734ed6250c918a2f7a1
|
|
| BLAKE2b-256 |
1f5be94f913db08b544a2f2efde2202abb81b87069e9c40f98a81ed83a8de4b8
|
Provenance
The following attestation bundles were made for wytness_sdk-0.1.0.tar.gz:
Publisher:
publish-python-sdk.yml on imwickkd/wytness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wytness_sdk-0.1.0.tar.gz -
Subject digest:
8536d5cdc96cd1e24343b9c1b528f6da08e82c568108974e975edcb5b115f787 - Sigstore transparency entry: 1302918675
- Sigstore integration time:
-
Permalink:
imwickkd/wytness@b827045df0196b9bbcc3a2811277139ed6cc9391 -
Branch / Tag:
refs/tags/python-sdk-v0.1.0 - Owner: https://github.com/imwickkd
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@b827045df0196b9bbcc3a2811277139ed6cc9391 -
Trigger Event:
push
-
Statement type:
File details
Details for the file wytness_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wytness_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9a7a6940ad9173d09f101b3d88d58a5a163ed7725e995b39268ca00a52cb663
|
|
| MD5 |
3d860d17ae31add934d7517b838a00b5
|
|
| BLAKE2b-256 |
f6b458909a064f7994cd7fd005fa9aa8d4785b983fc9f203d007eb2de4d8343a
|
Provenance
The following attestation bundles were made for wytness_sdk-0.1.0-py3-none-any.whl:
Publisher:
publish-python-sdk.yml on imwickkd/wytness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wytness_sdk-0.1.0-py3-none-any.whl -
Subject digest:
c9a7a6940ad9173d09f101b3d88d58a5a163ed7725e995b39268ca00a52cb663 - Sigstore transparency entry: 1302918754
- Sigstore integration time:
-
Permalink:
imwickkd/wytness@b827045df0196b9bbcc3a2811277139ed6cc9391 -
Branch / Tag:
refs/tags/python-sdk-v0.1.0 - Owner: https://github.com/imwickkd
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-sdk.yml@b827045df0196b9bbcc3a2811277139ed6cc9391 -
Trigger Event:
push
-
Statement type: