curb-sdk (Python)
The enforcement point for tool calls — the thing a proxy fundamentally cannot do.
pip install curb-sdk
You need a running Curb control plane for this to do anything. The fastest way:
docker compose -f docker-compose.release.yml up -d— see the quickstart.
from curb import Curb, PolicyViolation
curb = Curb(base_url="http://localhost:8090", api_key="dev-key")
@curb.guard_tool(name="delete_file", sensitivity="high")
def delete_file(path: str) -> None:
os.remove(path)
with curb.run() as run_id:
# Cost and loops are covered too if your LLM client points at the gateway:
# OpenAI(base_url="http://localhost:8080/v1", default_headers=curb.gateway_headers())
curb.step() # enforces step_limit / time_limit
try:
delete_file("/tmp/x") # ASK → held until a human clicks Approve
except PolicyViolation as e:
print("denied:", e, e.policy_id)
Behaviour that matters
| Decision | What happens |
|---|---|
ALLOW |
the tool runs |
DENY |
PolicyViolation is raised; the tool is never called |
ASK |
execution is held until a human decides (long-poll) |
THROTTLE |
waits retryAfterMs, then runs |
- Fail-safe. If the control plane is unreachable, or an approval runs out of time, the
default is to deny (
fail_mode="closed"). Setfail_mode="open"when availability matters more than protection. run_idpropagates automatically throughcontextvars, so nested tools never need it passed explicitly.
Tests
python -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/python -m pytest -q
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file curb_sdk-0.2.0.tar.gz.
File metadata
- Download URL: curb_sdk-0.2.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
872262f83f8e9f4f28a3cb0888eb07fa73f88d4b08e7a01dc6d1821948b021b5
|
|
| MD5 |
06a7420482a868215878392ea0911267
|
|
| BLAKE2b-256 |
a4cb1c26bd30bafa9f95a618f22f085cb3aeac3786635025b98f205e0c8e5161
|
Provenance
The following attestation bundles were made for curb_sdk-0.2.0.tar.gz:
Publisher:
release.yml on itsnevu/Curb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
curb_sdk-0.2.0.tar.gz -
Subject digest:
872262f83f8e9f4f28a3cb0888eb07fa73f88d4b08e7a01dc6d1821948b021b5 - Sigstore transparency entry: 2418432830
- Sigstore integration time:
-
Permalink:
itsnevu/Curb@cb211de901965ff596a490090bff969b217e912f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/itsnevu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cb211de901965ff596a490090bff969b217e912f -
Trigger Event:
push
-
Statement type:
File details
Details for the file curb_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: curb_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
991d6ad07ea7fefe39adc8348e64ed692ef5235a9c1e4e387e14664dcd973b6d
|
|
| MD5 |
4faf232fd2ca8479d99c4c9d0c3fa220
|
|
| BLAKE2b-256 |
801e9c3d53cd0eceb29f56cc9bf022d8cf92e9b7712efbe448a8fe1e6a590a76
|
Provenance
The following attestation bundles were made for curb_sdk-0.2.0-py3-none-any.whl:
Publisher:
release.yml on itsnevu/Curb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
curb_sdk-0.2.0-py3-none-any.whl -
Subject digest:
991d6ad07ea7fefe39adc8348e64ed692ef5235a9c1e4e387e14664dcd973b6d - Sigstore transparency entry: 2418433214
- Sigstore integration time:
-
Permalink:
itsnevu/Curb@cb211de901965ff596a490090bff969b217e912f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/itsnevu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cb211de901965ff596a490090bff969b217e912f -
Trigger Event:
push
-
Statement type: