Metadata-Version: 2.4
Name: atb-sdk
Version: 1.0.2
Summary: ATB (Agent Trace Bundle) Python SDK — tamper-evident audit trails for AI agent workflows
Author-email: Paddy Guest <patrickcguest@proton.me>
License-Expression: MIT
Project-URL: Homepage, https://github.com/pcguest/atb
Project-URL: Repository, https://github.com/pcguest/atb
Project-URL: Documentation, https://github.com/pcguest/atb/blob/main/docs
Keywords: audit,ai,agents,tracing,observability
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptography>=42.0.0
Provides-Extra: langchain
Requires-Dist: langchain>=0.1.0; extra == "langchain"
Requires-Dist: langchain-core>=0.2.0; extra == "langchain"
Provides-Extra: llamaindex
Requires-Dist: llama-index>=0.10.0; extra == "llamaindex"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

# ATB Python SDK

The official Python SDK for [ATB (Agent Trace Bundle)](https://github.com/pcguest/atb) — tamper-evident, replayable audit trails for AI agent workflows.

## Installation

```bash
pip install atb-sdk
```

With LangChain integration:

```bash
pip install atb-sdk[langchain]
```

## Quick Start

```python
from atb import Bundle

# Create a new bundle
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

```python
from atb import Bundle
from atb.integrations.langchain 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.
```

## License

MIT
