roadbed-sdk
The capture SDK of Roadbed. It wraps OpenAI and Anthropic clients. It records each model call and each reviewer verdict. It pseudonymises the data in your process, before anything is stored or sent.
This is version 0.1. The format can change before 1.0.
Install
You need Python 3.12 or newer.
pip install roadbed-sdk
pip install 'roadbed-sdk[redact]' # optional: Presidio for names in free text
Capture to a local folder
init_local writes to JSONL files in a folder. It needs no URL, no token and no network.
import os
import roadbed_sdk
from openai import OpenAI
roadbed_sdk.init_local(
"events", # folder for the JSONL files
os.environ["ROADBED_TENANT_KEY"], # 16 bytes or more. It stays in this process.
"profile@v1",
model="claims-triage",
keep=("route",), # string fields of the model output
)
client = roadbed_sdk.wrap_openai(OpenAI())
with roadbed_sdk.capture(subject="claimant-123", slices={"line": "auto"}) as cap:
client.chat.completions.create(model="gpt-4o", messages=messages)
roadbed_sdk.verdict(cap.interaction_id, "fix", {"route": "complex", "severity": 3},
reason_code="underestimated_injury")
roadbed_sdk.flush()
Put each string field of the model output in keep. Use short lowercase slice values. The SDK turns other strings into tokens, and the build then quarantines the row.
Then build the eval assets from the folder. Run it inside the asset that roadbed new made.
roadbed evals build --events ../events --as-of 2026-11-26T00:00:00Z --holdout-out ../vault --objects ../objects
VerdictIn has no reviewer id. A correction test that comes from local events gets created_by: unattributed.
Send to a control plane
init sends the same data to a Roadbed control plane. The control plane is part of the paid platform.
roadbed_sdk.init("https://roadbed.example.eu", token, tenant_key, "profile@v1", model="claims-triage")
init and init_local are the only calls that raise (ConfigError, ProfileRequiredError). Capture, verdict, outcome, reconcile and flush never raise into your app.
Pseudonymisation
Pseudonymisation is on by default.
- The tenant key stays in your process. The SDK records only its key id.
- Free text becomes an HMAC token. The stored input has no readable text.
- Values that you pass in
pii=and patterns such as email, phone and IBAN become placeholders. - A field in
keepand a slice label keep a short lowercase label value. - Two kinds of value stay as raw text: dict keys in lowercase snake_case, and the label values of the keys in
keep. Thus a key named after a person, such asjane_doe, goes into the event files unless you give that name inpii=.
With text="redact", Presidio replaces the names that it finds. Install the redact extra and a spaCy model first. Tokens cannot find near-copies of a holdout input. Use text="redact" for text that goes to training.
Reference
See docs/sdk.md for each call. The source and the issue tracker are at github.com/roadbedai/roadbed.
Metadata
Release files for roadbed-sdk 0.1.0
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 |
|---|---|---|---|---|
| roadbed_sdk-0.1.0.tar.gz | 26.4 kB | With provenance | Details for roadbed_sdk-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| roadbed_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for roadbed_sdk-0.1.0-py3-none-any.whl |
Total release size: 57.2 kB
Release files / roadbed_sdk-0.1.0.tar.gz
| Download URL | roadbed_sdk-0.1.0.tar.gz |
|---|---|
| Size | 26.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52fe434751e6d8dedbd9e1fad5d9a9676fed2a4196ec54794000a94cdf3260e7
|
|
BLAKE2b-256 checksum How to use checksums |
765d7b783bbd52089719117014c47dfce1ebba1fc2413fbb2f0a777b6d363f08
|
| 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 Nov 26, 2026.
Transparency logRelease files / roadbed_sdk-0.1.0-py3-none-any.whl
| Download URL | roadbed_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 30.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33148b74df4f3d8f097f04325c183e37f5b0e82d63da47bead22b6adcc5388a7
|
|
BLAKE2b-256 checksum How to use checksums |
909c9640137e3f196f7e51b355a2c6a5ef18f6d0ab367a8e9e840349c6658106
|
| 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 Nov 26, 2026.
Transparency logSecurity for roadbed-sdk 0.1.0
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
Both files in this release have been uploaded with provenance metadata.
Attestation for roadbed_sdk-0.1.0.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 Nov 26, 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.