Talos Protocol contracts - schemas, types, and helper functions for auditable AI agent security
Project description
Talos Contracts (Python)
Talos Protocol contracts - schemas, types, and helper functions for auditable AI agent security.
Installation
pip install talos-contracts
Features
- Cursor derivation:
derive_cursor(timestamp, event_id)- Generate cursor from timestamp and event ID - Cursor decoding:
decode_cursor(cursor)- Parse cursor to extract timestamp and event ID - Base64url: Strict base64url encoding/decoding (no padding)
- UUIDv7 validation:
is_uuid_v7(id)- Validate UUIDv7 strings - Event ordering:
ordering_compare(a, b)- Compare events by (timestamp DESC, event_id DESC)
Usage
from talos_contracts import derive_cursor, decode_cursor, is_uuid_v7
# Derive a cursor
cursor = derive_cursor(1703721600, "0190a5e0-7c3a-7000-8000-000000000001")
# Decode a cursor
decoded = decode_cursor(cursor)
print(decoded) # {"timestamp": 1703721600, "event_id": "0190a5e0-..."}
# Validate UUIDv7
is_valid = is_uuid_v7("0190a5e0-7c3a-7000-8000-000000000001") # True
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
talos_contracts-1.1.0.tar.gz
(5.8 kB
view details)
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 talos_contracts-1.1.0.tar.gz.
File metadata
- Download URL: talos_contracts-1.1.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cec8945d5c67c32416e08e74c698cadbd23d21c907dcd550e2545646039c7f7d
|
|
| MD5 |
c18fe1010a5fd75635f0656b9c5cbdd8
|
|
| BLAKE2b-256 |
267f2e977fcd67a6dba2128b529cfd0bff972a269fa76aa59c7a6373c3cc9880
|
File details
Details for the file talos_contracts-1.1.0-py3-none-any.whl.
File metadata
- Download URL: talos_contracts-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8283ca31dc085064171cbedd8102a41199c1bd13ede496c5c8ca1439519c7a4a
|
|
| MD5 |
313545181125ce88b66c4ab399c022bf
|
|
| BLAKE2b-256 |
be05b66b208b19aff66a216f9f78ccba1346fab8dee11da921a1fa03eb64042d
|