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.13.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.13-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: talos_contracts-1.1.13.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.13.tar.gz
Algorithm Hash digest
SHA256 b5a921f48b87fc96511f65cb52bfd7f9009bd7a9062bf219a4f3f5bb18e29ea9
MD5 e84558487e780ffb8964aa8fc16e2926
BLAKE2b-256 cebf8e59c9a71a1fd196e4cc8a35cb770e3488ef3540a4cef74044533f485da6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for talos_contracts-1.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 7035504b56e430f919b91547f1a38b8b80933f5a0b5702f381e344b6cd400b88
MD5 fa1c891e813ada84e90b39db3f21e782
BLAKE2b-256 10614e09d0cdd198fa0b3393af3aa6e32529d60cc945508378e7293a870ff34b

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