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

Uploaded Python 3

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

Hashes for talos_contracts-1.1.1.tar.gz
Algorithm Hash digest
SHA256 7d9b2be4249b26659799766ecaa68dfac244bcbeccc843b8eff5f3abf9161587
MD5 890348fec192c373afc1ad812572ab40
BLAKE2b-256 f0988814532026f6642abde9d3384ae552a6b2b4887bd112a511e84129a147f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for talos_contracts-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 978a81027ac3afc73d9429a00863dc76735b3699ce8b2ddf7cb081013e75dd29
MD5 bd451d3279866512caba9edf123b9fdf
BLAKE2b-256 2537b3c75fb14449cee2ea008bafd4e20e02875fdd47f63ae6927d6b310539b6

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