Skip to main content

AIR SDK for Python

CI Python 3.11+ License: Apache-2.0

Record every AI decision your agents make. One line of code.

AIR SDK connects your Python AI applications to the AIR Blackbox Gateway — giving you tamper-evident audit trails, compliance reporting, and deterministic replay without changing how you write code.

Install

pip install air-blackbox-sdk

With framework extras:

pip install air-blackbox-sdk[openai]      # OpenAI integration
pip install air-blackbox-sdk[langchain]   # LangChain integration
pip install air-blackbox-sdk[crewai]      # CrewAI integration
pip install air-blackbox-sdk[all]         # Everything

Quickstart

OpenAI (3 lines)

from openai import OpenAI
import air

client = air.air_wrap(OpenAI())

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "What is a flight recorder?"}],
)
print(response.choices[0].message.content)
# Every call recorded with tamper-evident audit trail

LangChain (2 lines)

from air.integrations.langchain import air_langchain_llm

llm = air_langchain_llm("gpt-4o-mini")
response = llm.invoke("Explain tamper-evident logging.")
print(response.content)
# Works with chains, agents, and tools

CrewAI (swap one import)

from crewai import Agent, Task, Crew
from air.integrations.crewai import air_crewai_llm

llm = air_crewai_llm("gpt-4o-mini")
agent = Agent(role="Researcher", goal="Find facts", llm=llm)
task = Task(description="Research AI safety", agent=agent,
            expected_output="A brief report.")
crew = Crew(agents=[agent], tasks=[task])
crew.kickoff()
# Every agent LLM call recorded in AIR

Direct Client

from air import AIRClient

with AIRClient() as client:
    # Chat through the gateway
    result = client.chat(
        messages=[{"role": "user", "content": "Hello"}],
        model="gpt-4o-mini",
    )
    print(result["_air"]["run_id"])  # Your audit trail ID

    # Check compliance status
    audit = client.audit(gateway_key="your-key")

    # Export signed evidence for regulators
    evidence = client.export_evidence(gateway_key="your-key")

Configuration

Environment Variable Default Description
AIR_GATEWAY_URL http://localhost:8080 AIR gateway URL
OPENAI_API_KEY (none) Your LLM provider API key
AIR_TIMEOUT 120 Request timeout in seconds

What You Get

When your code runs through AIR, every LLM call automatically gets:

  • Tamper-evident audit trail — HMAC-SHA256 chain, modify one record and the chain breaks
  • Vault-backed content — prompts and completions in your S3/MinIO, not third-party clouds
  • Compliance reporting — 22 controls across SOC 2 and ISO 27001, auto-evaluated
  • Signed evidence export — hand your auditor a single JSON document
  • Deterministic replay — reproduce any AI decision from the audit record

Part of the AIR Ecosystem

This SDK is the developer entry point to the AIR Blackbox Gateway infrastructure:

Component What It Does
python-sdk (this repo) Python integrations for OpenAI, LangChain, CrewAI
gateway Core proxy + vault + audit chain + compliance
air-platform Docker Compose orchestration
agent-episode-store Episode-level audit grouping
agent-policy-engine Risk-tiered autonomy + runtime policy

License

Apache-2.0

Metadata

Release files for air-blackbox-sdk 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for air-blackbox-sdk 0.1.1
File Size Uploaded Provenance
air_blackbox_sdk-0.1.1.tar.gz 13.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for air-blackbox-sdk 0.1.1
File Interpreter ABI Platform
air_blackbox_sdk-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 26.6 kB

Release files / air_blackbox_sdk-0.1.1.tar.gz

Download URL air_blackbox_sdk-0.1.1.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
818688b629d9306ae3f494a80fe2eda80f66e925ba84087e838a5a3e3e0c283b
BLAKE2b-256 checksum
How to use checksums
7164f67ed23f5818f09c73c1d316c5bfb8463c5bd50f055ba7526d46f9f40a78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / air_blackbox_sdk-0.1.1-py3-none-any.whl

Download URL air_blackbox_sdk-0.1.1-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8fb323e815fae5617aa1da408e53dca2a6bde6916b81522d1725a92091bb455e
BLAKE2b-256 checksum
How to use checksums
023b0d3a43c64a4565fdd73b25f30aa00e9010137a721274d3cdb665edfd150f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for air-blackbox-sdk 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page