Skip to main content

ATB (Agent Trace Bundle) Python SDK - local-first, tamper-evident audit trails for AI workflows

Project description

ATB Python SDK

The official Python SDK for ATB (Agent Trace Bundle) - local-first, tamper-evident audit trails for AI workflows.

Installation

pip install atb-sdk

Use this package when you need to write or verify bundles from Python code. The Go CLI remains the authoritative CLI path:

go install github.com/pcguest/atb/cmd/atb@latest

The package does not include a standalone ATB CLI. The installed atb command is a compatibility stub that prints Go CLI install guidance and will be removed in a future major release.

With LangChain integration:

pip install atb-sdk[langchain]

Quick Start

from atb import Bundle

# Create a new bundle in Python
bundle = Bundle()

# Append events
bundle.append("dev.session", {
    "date": "2025-01-15",
    "features_built": ["hash chaining", "CLI init"],
    "blockers": ["RFC 8785 library compatibility"],
})

bundle.append("decision", {
    "choice": "Go over Rust for CLI",
    "reason": "Solo founder velocity",
    "alternatives": ["Rust", "Python-only"],
})

# Save to disk
bundle.save("run.atb/bundle.atb")

# Later - reload and verify integrity
b = Bundle.load("run.atb/bundle.atb")
b.verify()  # Raises ATBVerificationError if tampered
print(f"Verified {len(b)} events - chain intact.")

LangChain Integration

from atb import Bundle
from atb.langchain_callback import ATBCallbackHandler
from langchain.chat_models import ChatOpenAI

bundle = Bundle()
handler = ATBCallbackHandler(bundle, auto_save=True)

llm = ChatOpenAI(callbacks=[handler])
# All LLM calls are now automatically recorded in the bundle.

The deprecated shim import path atb.integrations.langchain.ATBCallbackHandler still works for compatibility, but it emits a DeprecationWarning. Use atb.langchain_callback.ATBCallbackHandler for new code.

Licence

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

atb_sdk-1.6.0.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

atb_sdk-1.6.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file atb_sdk-1.6.0.tar.gz.

File metadata

  • Download URL: atb_sdk-1.6.0.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for atb_sdk-1.6.0.tar.gz
Algorithm Hash digest
SHA256 c692b6020fd00a14f0a76e1af37a05c126c2d258b234ef8249c7c989d22c84c7
MD5 aee0ccb6cff248b567977b5450d90225
BLAKE2b-256 3c0bf534eb1a216a82114076586898641cb779012556b6da50784ef864129fd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for atb_sdk-1.6.0.tar.gz:

Publisher: release.yml on pcguest/atb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atb_sdk-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: atb_sdk-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for atb_sdk-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fbb023ee4b4f3fb55e181e1268abb0c32ac8d0586ccac1280b0636ea602a5ca
MD5 abea893c0c4b90ad422d5b8a428d25d9
BLAKE2b-256 4f33b29718006d829d0a7fa16ff72385098d913afab0a8932c1294c79f81e4a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for atb_sdk-1.6.0-py3-none-any.whl:

Publisher: release.yml on pcguest/atb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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