Skip to main content

ATB Python SDK

The ATB Python SDK writes tamper-evident audit bundles in the same format as the Go CLI; bundles written by the SDK are verifiable with atb verify.

Installation

pip install atb-sdk

Quick example

from atb import Bundle
from atb.event_types import (
    AI_MODEL_INVOKED_EVENT_TYPE,
    AI_REQUEST_RECEIVED_EVENT_TYPE,
)

bundle = Bundle()

bundle.append(
    AI_REQUEST_RECEIVED_EVENT_TYPE,
    {
        "request_id": "req-001",
        "actor_id_hash": "hash-user-01",
        "purpose_tag": "quickstart_demo",
    },
)

bundle.append(
    AI_MODEL_INVOKED_EVENT_TYPE,
    {
        "model_provider": "openai",
        "model_id": "gpt-4o-mini",
        "model_parameters_digest": "sha256-params-abc",
        "prompt_digest": "sha256-prompt-def",
    },
)

path = bundle.save("run.atb/bundle.atb")
print(path)

Supported event types

Event type constant name Event type string
BUNDLE_MANIFEST_EVENT_TYPE atb.bundle.manifest
BUNDLE_ANCHOR_EVENT_TYPE atb.bundle.anchor
BUNDLE_SIGNATURE_EVENT_TYPE atb.bundle.signature
AI_REQUEST_RECEIVED_EVENT_TYPE ai.request.received
AI_RESPONSE_SENT_EVENT_TYPE ai.response.sent
AI_POLICY_DECISION_EVENT_TYPE ai.policy.decision
AI_RETRIEVAL_EXECUTED_EVENT_TYPE ai.retrieval.executed
AI_MODEL_INVOKED_EVENT_TYPE ai.model.invoked
AI_MODEL_OUTPUT_EVENT_TYPE ai.model.output
AI_ACTION_PRECOMMIT_EVENT_TYPE ai.action.precommit
AI_ACTION_EXECUTED_EVENT_TYPE ai.action.executed
AI_ACTION_COMMITTED_EVENT_TYPE ai.action.committed
AI_HUMAN_APPROVAL_EVENT_TYPE ai.human.approval
AI_JOB_SCHEDULED_EVENT_TYPE ai.job.scheduled
AI_JOB_STARTED_EVENT_TYPE ai.job.started
AI_JOB_STEP_EVENT_TYPE ai.job.step
AI_JOB_COMPLETED_EVENT_TYPE ai.job.completed
DATA_EXPORT_PRECOMMIT_EVENT_TYPE data.export.precommit
DATA_EXPORT_EXECUTED_EVENT_TYPE data.export.executed

Profile support

To verify a bundle against a profile, use the Go CLI: atb verify --bundle <path> --profile <profile-id>. The Python SDK does not include a verifier.

LangChain integration

For LangChain middleware guidance, see docs/integrations/.

Licence

MIT.

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.14.5.tar.gz (66.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.14.5-py3-none-any.whl (55.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for atb_sdk-1.14.5.tar.gz
Algorithm Hash digest
SHA256 4e15f4aa403587972448cd668f0f7ae3e9802369bdb1e6a18d59b0e5552ba3c6
MD5 30dbd7ea52ca9b822fd1739d1927f084
BLAKE2b-256 fb0485087babc7a46a05b9e64cd455f17bd3ad3a54f5d38c23a59189963f48a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for atb_sdk-1.14.5.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.14.5-py3-none-any.whl.

File metadata

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

File hashes

Hashes for atb_sdk-1.14.5-py3-none-any.whl
Algorithm Hash digest
SHA256 71ac7bb4ae9742f5c9a727ba7f8ca93f1982b38948fecd6baf2bef628aba2d02
MD5 3b17eee87010e0d2f7c0514177ae6d04
BLAKE2b-256 add486a715923a24e27bf115c6e3351b4af81201c6585d6785aaaffd16b564bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for atb_sdk-1.14.5-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.

Release history Release notifications | RSS feed

This release

1.14.5 This release

2 files

1.14.4

2 files

1.9.0

2 files

1.8.1

2 files

1.8.0

2 files

1.7.3

2 files

1.7.2

2 files

1.7.1

2 files

1.7.0

2 files

1.6.0

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.1.2

2 files

0.1.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page