Skip to main content

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.15.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

talos_contracts-1.1.15-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file talos_contracts-1.1.15.tar.gz.

File metadata

  • Download URL: talos_contracts-1.1.15.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

Hashes for talos_contracts-1.1.15.tar.gz
Algorithm Hash digest
SHA256 7f6af85f741ee7011f90ce8b9b23377a52cfe12d2bdfd1f1298e2a363fc0a95f
MD5 e39470b525d737ec410392698d346aad
BLAKE2b-256 73f6fa07db30789bc65c8f1ea70acfb88c65a59a664e443289daac64555b985e

See more details on using hashes here.

File details

Details for the file talos_contracts-1.1.15-py3-none-any.whl.

File metadata

File hashes

Hashes for talos_contracts-1.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 a13f0366c51c11373675e198697cc9ad66afb34b952f2b3331c48c76d0ae4d31
MD5 6d34ccd0e8b6651ceb9f5daddb716adf
BLAKE2b-256 8f6bfaf4d83fe6531b0f95140664d0f8d2e93f62e1553ebabeb1fbd9201cbf74

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