Backstop
Reference

Compatibility Matrix

Detailed SDK compatibility and optional extras for Backstop.

0.6.0 is published (PyPI backstop-ai, npm backstop-ai, GitHub Release v0.6.0; MIT licensed). The npm package of the same name is a partial TypeScript port, not the Python distribution — see the note below. The SDK ranges below are the tested ranges from .github/workflows/ci.yml — not a claim of universal support. Wrapping an SDK outside these ranges emits a loud UserWarning naming the tested range and proceeds unverified. Enforcement-error propagation (BudgetExceededError catchable by user code, not APIConnectionError) is verified on openai 3.14.0 + anthropic 1.5.0 (current) and openai 2.37.0 + anthropic 0.99.0 (legacy matrix) via tests/test_guardrail_visibility.py. See installation guide for installation limitations.

Python

PythonStatus
3.10Tested in CI
3.11Tested in CI
3.12Tested in CI

Providers

ProviderClientTested SDK rangeVerifiedStatusNotes
OpenAIopenai.OpenAI>=2.37,<42.37.0, 3.14.0, latestSupportedSync wrap; httpx/httpx2 family auto-detected per client
OpenAIopenai.AsyncOpenAI>=2.37,<42.37.0, 3.14.0, latestSupportedAsync wrap; same family detection
Anthropicanthropic.Anthropic>=0.98,<20.99.0, 1.5.0, 1.6.0, latestSupportedOptional dependency via backstop-ai[anthropic]; httpx2 client on >=1.0
Anthropicanthropic.AsyncAnthropic>=0.98,<20.99.0, 1.5.0, 1.6.0, latestSupportedSame as sync

Unsupported: SDKs below the floors (openai<2.37, anthropic<0.98) — their request loop catches every transport exception, including Backstop's BudgetExceededError, and re-raises it as APIConnectionError, so budget enforcement is invisible to user code. The propagate-as-is guard first ships in openai 2.37.0 / anthropic 0.98.0. Older SDKs (openai<1.90, anthropic<0.40) additionally crash against httpx>=0.28, which removed the proxies kwarg. Also unsupported: future majors at/above the ceilings (openai>=4, anthropic>=2 — none released as of 2026-09-18). Backstop.wrap() warns on these but does not refuse; verify with backstop doctor before relying on them.

Optional Extras

ExtraPurpose
backstop-ai[metrics]Prometheus metrics export
backstop-ai[anthropic]Anthropic SDK support
backstop-ai[redis]Shared/distributed budget across replicas
backstop-ai[otel]OpenTelemetry metrics export
backstop-ai[fastapi]Gateway/sidecar mode
backstop-ai[tokenizers]Optional token counting support

TypeScript

backstop-ai on npm is a partial TypeScript port, not a mirror of the Python package. It is published and it is divergent, and the divergence is documented upstream in docs/planning/05-expansion-roadmap.md.

Pythonnpm backstop-ai
ProvidersOpenAI + AnthropicOpenAI only (peerDependencies: { "openai": ">=4" })
Interceptiontransport injection (BackstopTransport)patches client.chat.completions.create
Priorities3: critical, default, background5: critical, high, default, low, bulk
Budget semanticsno priority bypass in the budget pathcritical and high bypass the ceiling
Ledger, price catalog, detectorshippednone
Metrics / OTel / Redis / hierarchical budgetsshippednone
Audit chainHMAC chain + verify() + four sinksHMAC chain + verify(), no sinks
CIfull matrixnone — npm test runs only by hand

Use the Python package when you need the full feature set or Anthropic.


— Edit this page on GitHub

On this page