curbi-langchain
A real LangChain LCEL Runnable that checks completed text against your configured Curbi policy. A passing reply returns unchanged; findings raise CurbiBlocked with structured .findings. Invalid responses, timeouts and HTTP errors raise CurbiUnavailable, so unchecked text is not returned.
Install after the reviewed package is published: pip install curbi-langchain==0.1.0. For local evaluation before publication, build and install its wheel.
from curbi_langchain import curbi_guard
guard = curbi_guard(policy={"prices": [{"item": "Pro", "amount": 49}]})
guard.invoke("Pro is $99.") # CurbiBlocked: configured price mismatch
In an existing LangChain application, place the guard after StrOutputParser():
from langchain_core.output_parsers import StrOutputParser
from curbi_langchain import curbi_guard
# model is your existing LangChain chat model; no model is selected or funded here.
checked_chain = model | StrOutputParser() | curbi_guard(policy=your_policy)
reply = checked_chain.invoke("Explain our Pro plan")
# Also supported: await checked_chain.ainvoke(...), batch(...) and abatch(...).
policy must be a JSON dictionary with a non-empty prices, forbid or actions rule collection; empty/no-rule configurations are rejected before networking. Optional api_key goes in the Authorization header; keep it in your own secret store. timeout defaults to 10 seconds (accepted range 0.1–30), used as an absolute response-acceptance deadline, checked after headers, between body chunks and before accepting a result. HTTPX also applies per-phase timeouts. An already-blocked network read may finish later at its phase timeout; this is not a hard wall-clock cancellation guarantee. No automatic retries occur. Each check uses a fresh idempotency key. Managed API usage may be billable under your account's terms.
Data and limits: this is remote HTTP checking, not an embedded local checker. Your complete policy and reply are sent to the fixed https://api.curbi.io/v1/check endpoint. Redirects are refused; text/request/response sizes and verdict/finding spans are validated. Inputs support up to 4,000 UTF-16 code units and 64 KiB JSON; responses up to 256 KiB. Async checking runs the bounded synchronous client in a worker thread. Cancellation does not guarantee that an already-sent HTTP request is cancelled.
This checks completed text, not tokens as they stream; it does not prevent tools/actions already executed by the model. A pass means no configured rule fired. It grants no permission and proves no provider outcome or general truth. The adapter makes no model calls and prints no inputs, keys or provider payloads. LangChain's separately configured tracing may still record your application data.
MIT. Source and issue tracker: https://github.com/Curbi-Inc/curbi-check. Package version 0.1.0 is preparation for registry publication, not evidence it is already listed.
Validated framework version: langchain-core 1.7.4; httpx 0.28.1, Python 3.11. Tests use real framework classes and mocked HTTP, with no paid model or API calls.
The response must explicitly report proof.authorizationGranted: false; missing or contradictory authority metadata is rejected. A passing check never grants execution authority.
Metadata
Release files for curbi-langchain 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 |
|---|---|---|---|---|
| curbi_langchain-0.1.0.tar.gz | 8.1 kB | With provenance | Details for curbi_langchain-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| curbi_langchain-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for curbi_langchain-0.1.0-py3-none-any.whl |
Total release size: 14.6 kB
Release files / curbi_langchain-0.1.0.tar.gz
| Download URL | curbi_langchain-0.1.0.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6418570cad08f1059379348eefa2dce75e05618893a48d1af814e87730bd5ea9
|
|
BLAKE2b-256 checksum How to use checksums |
9db2b4c14ea5cbb114396c47bcdc705fc47d075c0b3639726587d4d2537d132a
|
| 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 2, 2026.
Transparency logRelease files / curbi_langchain-0.1.0-py3-none-any.whl
| Download URL | curbi_langchain-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f4742e4820523a7b5185bc6df41d8fbe144f507e3e8cedcdabe9960f644bba7
|
|
BLAKE2b-256 checksum How to use checksums |
a83c5e1a5a5905316462f4dc1b876a65f59a8cf53946b4e0f426f1e23393c736
|
| 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 2, 2026.
Transparency logSecurity for curbi-langchain 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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for curbi_langchain-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 2, 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.