Briefcase AI SDK
Compliance monitoring, auditing, and evaluating third-party artificial intelligence systems and models.
Enforce controls, record context, replay later.
Install
pip install briefcase-ai
TypeScript consumers install the focused runtime packages:
npm install @briefcase-ai/controls @briefcase-ai/runtime
@briefcase-ai/runtime exposes only explicit subpaths:
@briefcase-ai/runtime/integrity, /lakefs, /connectors, and /trace.
Quick Example
import briefcase
briefcase.observe("console") # send records to stderr (or "memory" / "runs.jsonl" / an https:// URL)
@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, an https:// URL (JSON
batches via the stdlib-only HTTPExporter; pass HTTPExporter(url, token=...)
for auth), or any briefcase.exporters.BaseExporter instance — subclass
BaseExporter to ship records to your own backend. The exporter classes are
also importable from the top level (briefcase.JSONLFileExporter, …).
Delivery. Records are exported on a background thread through a bounded
queue (10,000 records by default; briefcase.configure_export(...) tunes the
bound, retries, and timeout). If the exporter cannot keep up, new records are
dropped, counted in briefcase.export_stats(), and reported at WARNING. Queued
records are drained at interpreter exit for up to 5 seconds, with no explicit
call; use briefcase.shutdown(timeout=...) (or briefcase.flush()) to drain
earlier, or before os._exit.
What gets captured. @capture works on functions, coroutines, generators,
and async generators (a generator emits one record when it finishes, with the
collected chunks as output). Cancelled or timed-out async calls are recorded
with status: "cancelled". Records carry a schema_version, plus
workflow_id / trace_id when a briefcase.correlation workflow or an
OpenTelemetry span is active. capture(sample_rate=0.1) records a fraction of
calls.
Content rule. Briefcase records prompt, completion and tool content only
where someone chose to record it. Every automatic path (briefcase.auto()
for frameworks and provider SDKs, briefcase-ai exec, connect and the
receiver, eval records) records none until you opt in with
capture_content="full" (or "hash"), --capture-content / --keep-content,
or BRIEFCASE_CAPTURE_CONTENT=full. @capture on your own function is itself
that choice: it records the function's arguments and return value (pass
capture_content="hash" or "none" to keep them out).
import briefcase does not require the compiled core: the pure-Python surface
(capture, exporters, controls, events, routing) works from a source checkout,
and native-backed names raise a clear ImportError only when used.
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-ai-mcp.
Plug-and-play integrations
Connect the coding tools on your machine in one command. Nothing to configure by hand:
briefcase-ai connect # detects Claude Code, Codex, Cursor, VS Code Copilot, ...; shows a diff; asks once
briefcase-ai receive # local OTLP receiver: their telemetry becomes briefcase decision records
connect writes each tool's telemetry and MCP settings as key-level edits with
a backup, and briefcase-ai connect --undo removes exactly what it wrote.
Prompts, responses, tool input, e-mail addresses and host paths are redacted
unless you opt in (--capture-content / --keep-content). Claude Code and
Cursor work on a bare install; Codex and VS Code Copilot send protobuf, which needs
pip install 'briefcase-ai[receiver]'. briefcase-ai mcp link cursor prints a
one-click install link for the MCP server. Per-tool details:
docs/integrations/.
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 |
rag-chroma / rag-pinecone / rag-weaviate |
Vector-store adapters (each adds its client) |
correlation |
Workflow and trace correlation helpers |
external |
External data snapshot tracking |
events |
Structured event type and emitter interface |
kafka / webhook / gcp-logging |
Event transports and the Cloud Logging exporter (webhook is stdlib) |
routing |
Router protocol, agent router, versioned policy registry |
opa |
OPA HTTP router with cached decisions and internal-router fallback (adds httpx) |
lakefs |
lakeFS versioned storage client, branch manager, lineage, staged commits |
vcs |
VCS client base protocol plus DVC, Nessie, Pachyderm, ArtiVC, DuckLake, Iceberg, and git-LFS adapters |
vcs-dvc / vcs-pachyderm / vcs-ducklake / vcs-iceberg |
Per-provider VCS clients (the rest are HTTP/subprocess based) |
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) |
bitemporal-glue |
AWS Glue catalog auth for the Iceberg backend (adds boto3) |
kdb |
kdb+ bitemporal backend (adds KX-licensed pykx; excluded from all) |
compliance |
Examiner bundles joining decision, evidence, and policy version |
compliance-kms |
KMS-signed examiner bundles against your own AWS KMS key (adds boto3) |
controls |
Gateway, quota, throttle classification, and retry (no extra dependencies) |
integrity |
Tamper-evident hash chains, canonical JSON, Ed25519 signing over digests and JSON manifests (signing adds pynacl) |
langchain / crewai / llamaindex / autogen / ag2 / pageindex / openai-agents |
Framework auto-instrumentation via briefcase.auto (each adds its framework) |
mcp |
MCP server (briefcase-ai-mcp) exposing the SDK to AI agents |
run |
gRPC client for the briefcase-ai evaluation-run CLI (adds grpcio, grpcio-reflection, protobuf) |
engine |
gRPC client for briefcase-ai engine, graph and env against the licensed Briefcase engine (adds grpcio, protobuf, cryptography; Briefcase AI operates the proprietary engine) |
receiver |
OTLP/protobuf decoding for briefcase-ai receive (adds opentelemetry-proto; OTLP/JSON needs no extra) |
budgets-redis / budgets-postgres / budgets-mysql |
Shared stores for briefcase.budgets (each adds its client: redis, psycopg, pymysql) |
dev |
Dev tooling: pytest, mypy, flake8, moto (not part of all) |
all |
Installs every optional extra listed above except kdb and dev |
Most features are native- or pure-Python-backed and ship with the base package.
These extras are convenience groupings that pull in no additional
dependencies: replay, drift, sanitize, storage, validate,
guardrails, rag, correlation, external, events, webhook, routing,
vcs, bitemporal, compliance, and controls. The extras that install
third-party packages are otel, kafka, gcp-logging, opa, lakefs,
rag-chroma, rag-pinecone, rag-weaviate, vcs-dvc, vcs-pachyderm,
vcs-ducklake, vcs-iceberg, gym, evals, bitemporal-iceberg,
bitemporal-glue, kdb, compliance-kms, integrity, langchain, crewai,
llamaindex, autogen, ag2, pageindex, openai-agents, mcp, run,
engine, receiver, budgets-redis, budgets-postgres, and budgets-mysql.
all installs every one of those except kdb; dev is the test tooling and is
not part of all.
Managed platform
The free SDK captures decisions, enforces controls, and supports local replay and storage on your own infrastructure. The proprietary engine runs in Briefcase AI’s managed service. A paid entitlement grants access to the service. Engine binaries and images stay with Briefcase AI.
Request managed engine access. If you previously installed a local engine, follow the migration guide before stopping it.
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
- Docs: briefcaseai.io
- GitHub: github.com/briefcasebrain/briefcase-ai-sdk
- Contributing: CONTRIBUTING.md
Metadata
Release files for briefcase-ai 6.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| briefcase_ai-6.0.2.tar.gz | 993.8 kB | With provenance | Details for briefcase_ai-6.0.2.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| briefcase_ai-6.0.2-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details for briefcase_ai-6.0.2-cp39-abi3-win_amd64.whl |
| briefcase_ai-6.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details for briefcase_ai-6.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| briefcase_ai-6.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details for briefcase_ai-6.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| briefcase_ai-6.0.2-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details for briefcase_ai-6.0.2-cp39-abi3-macosx_11_0_arm64.whl |
| briefcase_ai-6.0.2-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details for briefcase_ai-6.0.2-cp39-abi3-macosx_10_12_x86_64.whl |
Total release size: 46.1 MB
Release files / briefcase_ai-6.0.2.tar.gz
| Download URL | briefcase_ai-6.0.2.tar.gz |
|---|---|
| Size | 993.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ef8bfd94979fcde8d30d087fc6225e7bb01f4cef1e02b162010241e75555ce9
|
|
BLAKE2b-256 checksum How to use checksums |
9e9816c5ca79bfd823d1b3b1e25fcba7a80a046c286e6196ae25e3967a196d89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / briefcase_ai-6.0.2-cp39-abi3-win_amd64.whl
| Download URL | briefcase_ai-6.0.2-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 8.6 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0bbab3b5196516f013c5f008b59f2810046d8f117d491e96bd5b830bf4d3189a
|
|
BLAKE2b-256 checksum How to use checksums |
745bba8f18eeab795d707699f13ac82d8716b638adb606e70facff561e7d2580
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / briefcase_ai-6.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | briefcase_ai-6.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 9.3 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
d0004731fc86790e9d8c72c68c85eda9bce625ebdc36ce50809c1c11b2a02b9f
|
|
BLAKE2b-256 checksum How to use checksums |
80012bc581013b52b9f3719dba63f0e547c638d98e86f31b01d442b999140119
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / briefcase_ai-6.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | briefcase_ai-6.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 9.4 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
43b22b86cc82f93bcf87ffa40c25b02ddfa6c3e28d330c58510c72355bcd4915
|
|
BLAKE2b-256 checksum How to use checksums |
15c62aebb3c0a6f88170671e197fa844418a8df5134bbf64322d51497aa59d8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / briefcase_ai-6.0.2-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | briefcase_ai-6.0.2-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 8.9 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7b8c520fca0f8310ffe0f2baba37eba3f7a3216bb015c1983aee00a2c931eaee
|
|
BLAKE2b-256 checksum How to use checksums |
988898a38187d1401fdab8b6955531a4d3ec0b463a542773bfca6176fb2b60d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / briefcase_ai-6.0.2-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | briefcase_ai-6.0.2-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 9.0 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
a49b3896d5feb34fb61dd651e2377a20f67bd78cdbe9efbe17cbf012472c7df2
|
|
BLAKE2b-256 checksum How to use checksums |
65fcf16cc13f538695c1d8873fbd4c9d7d4e311e1bcdead0eb9bdef5e8f82bfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for briefcase-ai 6.0.2
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.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for briefcase_ai-6.0.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA 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.