Skip to main content

Briefcase AI SDK

License: Apache-2.0

Open-source decision tracking for AI.

Install

pip install briefcase-ai

Quick Example

import briefcase

briefcase.observe("console")          # send records to stderr (or "memory" / "runs.jsonl")

@briefcase.capture(decision_type="classify_text")
def classify(text: str) -> str:
    return text.upper()

classify("hello world")               # a decision record is emitted

capture works immediately — no briefcase.init() required. Call init() only when you use the native runtime features (storage backends, snapshots). Without a call to briefcase.observe(...) (or briefcase.setup(exporter=...)), @capture records decisions but has nowhere to send them.

Exporters. briefcase.observe(...) accepts "console", "memory" (records collected on exporter.records), a "*.jsonl" path, or any briefcase.exporters.BaseExporter instance — subclass BaseExporter to ship records to your own backend.

Evaluations and RL

Two bridges emit decision records from work that is not a single function call. Both use the exporter you already configured.

from briefcase.integrations.evals import EvalRun, from_inspect_log, replay

with EvalRun("gsm8k", model="claude-opus-5") as run:   # one eval.case per case,
    run.log_case("q1", inputs=q, outputs=a, passed=a == target)   # one eval.run
print(run.summary()["pass_rate"])

replay(from_inspect_log("logs/2026-08-12_gsm8k.eval"))  # inspect-ai .json/.eval

The parsers are stdlib only and never import the eval framework, so a log can be replayed on a machine that has neither installed. See examples/eval_runs/.

from briefcase.integrations.gym import GuardrailGymEnv, capture_episodes

env = GuardrailGymEnv(guardrail, tasks, injections)  # a guardrail as a gym.Env
env = capture_episodes(env)                          # rl.step / rl.episode records

Needs pip install briefcase-ai[gym]. See examples/rl_gym/.

capture_episodes exports on a background thread by default, since step capture is on the hot path. A script that exits right after close() can lose its records; pass capture_episodes(env, async_capture=False) in short runs. EvalRun already defaults to async_capture=False for that reason.

Logging

The library is silent by default (it installs only a NullHandler). Turn on visible logs explicitly:

import briefcase
briefcase.enable_logging("DEBUG")     # or set BRIEFCASE_LOG_LEVEL=DEBUG

Using with AI tools (Cursor, Claude Code, Codex, …)

This repo ships machine-readable usage guidance: llms.txt / llms-full.txt, an AGENTS.md, and copy-paste editor rules under docs/llm/. An MCP server is available via pip install briefcase-ai[mcp] then briefcase-mcp.

Extras

Extra Description
replay Deterministic replay engine for recorded decisions
drift Drift scoring and cost calculation for model outputs
sanitize Built-in PII redaction utilities
otel OpenTelemetry helpers
storage Rust-backed SQLite storage engine
validate Prompt validation engine
guardrails Guardrail framework, wrappers, and registries
rag Versioned embedding pipeline and instrumented retrieval
correlation Workflow and trace correlation helpers
external External data snapshot tracking
events Structured event type and emitter interface
routing Router protocol, agent router, versioned policy registry
lakefs lakeFS versioned storage client
vcs VCS client base protocol
gym Gymnasium bridge: guardrail env adapter and RL episode capture
evals Eval-harness bridge: EvalRun logger, inspect-ai / lm-eval parsers (adds zstandard for .eval archives on Python < 3.14)
bitemporal Bitemporal evidence store, as-of views, append-only corrections
bitemporal-iceberg pyiceberg-backed bitemporal store (any supported catalog)
compliance Examiner bundles joining decision, evidence, and policy version
mcp MCP server (briefcase-mcp) exposing the SDK to AI agents
dev Dev tooling: pytest, mypy, flake8
all Installs every optional extra listed above

Most features are native- or pure-Python-backed and ship with the base package — their extras (replay, drift, sanitize, storage, routing, bitemporal, compliance, …) are convenience groupings that pull in no additional dependencies. Only otel, lakefs, bitemporal-iceberg, gym, evals, and mcp install third-party packages.

Enterprise features

The OSS SDK ships everything needed to run the end-to-end walkthrough, persist evidence to SQLite or Iceberg, and pass an internal audit. The following features require the commercial briefcase-ai-sdk-enterprise package:

Feature OSS Enterprise
In-memory, SQLite, pyiceberg backends
kdb+ backend (pykx client) stub only
Managed-catalog connectors (Glue, Snowflake Horizon, Databricks Unity, Confluent Tableflow)
Licensed market data ingest (Bloomberg BPIPE, Refinitiv, ICE)
Signed content-hash envelopes (AWS KMS, GCP KMS, YubiHSM)
WORM retention integration (S3 Object Lock, Azure Blob immutable, MinIO)
Multi-tenant PolicyRegistry with RBAC and approvals
Cross-region evidence replication, DR runbooks
Regulator-format bundle exporters (SEC SDR, FCA, OCC, FINRA)
SOC 2 Type II / FedRAMP attestations, 24/7 SLA support

Contact sales@briefcasebrain.com for enterprise access.

Telemetry

The SDK can report anonymous usage metrics (SDK version, OS, architecture, backend type) to help prioritize development. No personal data or decision content is ever collected. Telemetry is only transmitted when a collection endpoint is configured via BRIEFCASE_API_URL (it defaults to localhost, i.e. a no-op), and you can disable it entirely at any time:

export BRIEFCASE_TELEMETRY=0   # also accepts: false, no, off (case-insensitive)

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

briefcase_ai-4.0.1.tar.gz (238.8 kB view details)

Uploaded Source

Built Distributions

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

briefcase_ai-4.0.1-cp39-abi3-win_amd64.whl (7.5 MB view details)

Uploaded CPython 3.9+Windows x86-64

briefcase_ai-4.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

briefcase_ai-4.0.1-cp39-abi3-macosx_11_0_arm64.whl (7.7 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

briefcase_ai-4.0.1-cp39-abi3-macosx_10_12_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file briefcase_ai-4.0.1.tar.gz.

File metadata

  • Download URL: briefcase_ai-4.0.1.tar.gz
  • Upload date:
  • Size: 238.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for briefcase_ai-4.0.1.tar.gz
Algorithm Hash digest
SHA256 8e95c3238e95787d727bb6da536d403732fbf7a09eeb60aef06adc24f712d150
MD5 1899ff2fa150ed2d9ca950f754f81375
BLAKE2b-256 290f7cb28f524e61b23f5cd95976b33a21805ad3cc7d4f0f8055d30a40fb9c88

See more details on using hashes here.

Provenance

The following attestation bundles were made for briefcase_ai-4.0.1.tar.gz:

Publisher: publish.yml on briefcasebrain/briefcase-ai-sdk

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

File details

Details for the file briefcase_ai-4.0.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: briefcase_ai-4.0.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 7.5 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for briefcase_ai-4.0.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e90ec6eb29ed47cfc059bb16027aac219084f8d74d6c41bd33b19e244e2cc47a
MD5 7e94e852324efca6403777515c05f254
BLAKE2b-256 2d6b2b576707b5933e03e2872e4227414d1e1b59d8d09b16a489ccae6f9b39c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for briefcase_ai-4.0.1-cp39-abi3-win_amd64.whl:

Publisher: publish.yml on briefcasebrain/briefcase-ai-sdk

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

File details

Details for the file briefcase_ai-4.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for briefcase_ai-4.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e33cd4d77f3dde34eed73a2381e440c30d1574eda8f706642b90944ec28e3fb2
MD5 beae97d9ed55ad4be43795c27b04a308
BLAKE2b-256 f7d7d893371d4967d93c885113e8c2c591cba3bafca874299fe19f505500e2e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for briefcase_ai-4.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on briefcasebrain/briefcase-ai-sdk

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

File details

Details for the file briefcase_ai-4.0.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for briefcase_ai-4.0.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9cbb69fb6ceb3e54f56569d01660592f42b39c23da6ddff89a1039befc23434
MD5 38b1785ee7a83ddb13db336b8f749c2a
BLAKE2b-256 a667e6f18a988be14fdede6186ea51a8f24a9cf31d91f30ac6d04ffdfa7fd048

See more details on using hashes here.

Provenance

The following attestation bundles were made for briefcase_ai-4.0.1-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on briefcasebrain/briefcase-ai-sdk

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

File details

Details for the file briefcase_ai-4.0.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for briefcase_ai-4.0.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 280962416ff758eb5fde6faf460df44cc2b05b38b9f4919582117c28f769295b
MD5 91a5e1f4870e673b6075cd6379c90d7c
BLAKE2b-256 dd24e2413e5973ba212f19e3e6fecc30c7311150fd25e22db23fc950edbadcaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for briefcase_ai-4.0.1-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: publish.yml on briefcasebrain/briefcase-ai-sdk

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 Sentry Error logging StatusPage Status page