NullRun Python SDK — Enforcement gateway for AI agents.
Project description
nullrun
Enforcement gateway for AI agents.
Stop runaway agents before they burn the budget. NullRun sits between your code and your LLM calls, tracking cost and tool usage so a single agent can't take down your account.
⚠️ Status: alpha. The public API may shift between minor versions. Pin your dependency and read the CHANGELOG on every upgrade.
Install
pip install nullrun
Quick start
Wrap any function that calls an LLM with @protect and you're done — cost
and tool calls are tracked automatically.
from nullrun import protect
@protect
def my_agent(prompt: str) -> str:
return call_my_llm(prompt)
Or drop in zero-code auto-instrumentation for the LLM libraries you already use. Pass your API key once at startup; supported vendors are detected automatically.
import nullrun
import openai
nullrun.init(api_key="nr_...")
client = openai.OpenAI()
client.chat.completions.create(...) # tracked, no other changes needed
Configuration
Two environment variables cover almost every setup:
| Variable | Default | Purpose |
|---|---|---|
NULLRUN_API_KEY |
— | Your NullRun API key. Required. |
NULLRUN_API_URL |
https://api.nullrun.io |
Backend base URL (override for self-hosted). |
Everything else — batching, transport tuning, mTLS, vendor-specific options — lives in the docs:
- 📘 Full configuration reference: https://docs.nullrun.io
Examples
A growing set of runnable examples (LangGraph, OpenAI Agents, raw OpenAI, Anthropic, multi-agent) is maintained in a separate repo so you can copy and adapt without cloning the SDK source:
- 🧪 Examples repo: https://github.com/nullrunio/nullrun-examples
Documentation
Concept guides, integration recipes, and the full Python API reference:
Project & organisation
This SDK is one part of the NullRun platform.
- 🏢 Organisation: https://github.com/nullrunio
- 🐛 Issues: https://github.com/nullrunio/nullrun-sdk-python/issues
- 📝 Changelog: https://github.com/nullrunio/nullrun-sdk-python/blob/master/CHANGELOG.md
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
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 nullrun-0.4.0.tar.gz.
File metadata
- Download URL: nullrun-0.4.0.tar.gz
- Upload date:
- Size: 112.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d3f9aacffef4a6c32299236e20170d4c89a19bcf7bfea31522bab31540bc1de
|
|
| MD5 |
cd809fe1d3ff1a1789059248802698d5
|
|
| BLAKE2b-256 |
528d370eb54b85c3b43fc200c5052397be748925849c34cea3b8a9f94468ca18
|
Provenance
The following attestation bundles were made for nullrun-0.4.0.tar.gz:
Publisher:
publish.yml on nullrunio/nullrun-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nullrun-0.4.0.tar.gz -
Subject digest:
9d3f9aacffef4a6c32299236e20170d4c89a19bcf7bfea31522bab31540bc1de - Sigstore transparency entry: 1868891393
- Sigstore integration time:
-
Permalink:
nullrunio/nullrun-sdk-python@a3a72c008b2d1db7d6c745b16592228f943269a9 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/nullrunio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a3a72c008b2d1db7d6c745b16592228f943269a9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file nullrun-0.4.0-py3-none-any.whl.
File metadata
- Download URL: nullrun-0.4.0-py3-none-any.whl
- Upload date:
- Size: 111.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
084dd0e86ab438384d86c86cabd9b5294c6cd54bb8af51d8b491aeee989103cd
|
|
| MD5 |
1ab8c36879a02dccee1b108f5aa5494a
|
|
| BLAKE2b-256 |
82c2360e15e339d47341fe7788caca022b31e57c0e8d2e2abf0e3c93c929c872
|
Provenance
The following attestation bundles were made for nullrun-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on nullrunio/nullrun-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nullrun-0.4.0-py3-none-any.whl -
Subject digest:
084dd0e86ab438384d86c86cabd9b5294c6cd54bb8af51d8b491aeee989103cd - Sigstore transparency entry: 1868891492
- Sigstore integration time:
-
Permalink:
nullrunio/nullrun-sdk-python@a3a72c008b2d1db7d6c745b16592228f943269a9 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/nullrunio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a3a72c008b2d1db7d6c745b16592228f943269a9 -
Trigger Event:
workflow_dispatch
-
Statement type: