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.1.tar.gz
(10.7 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.1.tar.gz.
File metadata
- Download URL: talos_contracts-1.1.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d9b2be4249b26659799766ecaa68dfac244bcbeccc843b8eff5f3abf9161587
|
|
| MD5 |
890348fec192c373afc1ad812572ab40
|
|
| BLAKE2b-256 |
f0988814532026f6642abde9d3384ae552a6b2b4887bd112a511e84129a147f9
|
File details
Details for the file talos_contracts-1.1.1-py3-none-any.whl.
File metadata
- Download URL: talos_contracts-1.1.1-py3-none-any.whl
- Upload date:
- Size: 10.6 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 |
978a81027ac3afc73d9429a00863dc76735b3699ce8b2ddf7cb081013e75dd29
|
|
| MD5 |
bd451d3279866512caba9edf123b9fdf
|
|
| BLAKE2b-256 |
2537b3c75fb14449cee2ea008bafd4e20e02875fdd47f63ae6927d6b310539b6
|