Metadata-Version: 2.4
Name: nullrun
Version: 0.4.0
Summary: NullRun Python SDK — Enforcement gateway for AI agents.
Project-URL: Homepage, https://nullrun.io
Project-URL: Documentation, https://docs.nullrun.io
Project-URL: Repository, https://github.com/nullrunio/nullrun-sdk-python
Project-URL: Changelog, https://github.com/nullrunio/nullrun-sdk-python/blob/master/CHANGELOG.md
Project-URL: Bug Tracker, https://github.com/nullrunio/nullrun-sdk-python/issues
Project-URL: Organization, https://github.com/nullrunio
Project-URL: Examples, https://github.com/nullrunio/nullrun-examples
Author-email: "nullrun.io" <support@nullrun.io>
License: Apache-2.0
License-File: LICENSE
Keywords: agent,ai-safety,circuit-breaker,llm,nullrun,observability,rate-limiting
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1.0,>=0.27.0
Provides-Extra: agents
Requires-Dist: openai-agents<1.0,>=0.1; extra == 'agents'
Provides-Extra: all
Requires-Dist: anthropic<1.0,>=0.20; extra == 'all'
Requires-Dist: autogen-agentchat<1.0,>=0.4; extra == 'all'
Requires-Dist: autogen-ext[openai]<1.0,>=0.4; extra == 'all'
Requires-Dist: boto3<2.0,>=1.34; extra == 'all'
Requires-Dist: cohere<6.0,>=5.0; extra == 'all'
Requires-Dist: crewai<2.0,>=0.80; extra == 'all'
Requires-Dist: google-genai<2.0,>=1.0; extra == 'all'
Requires-Dist: langchain-core<1.0,>=0.3; extra == 'all'
Requires-Dist: llama-index-core<1.0,>=0.10.20; extra == 'all'
Requires-Dist: mistralai<1.0,>=0.4; extra == 'all'
Requires-Dist: openai-agents<1.0,>=0.1; extra == 'all'
Requires-Dist: openai<2.0,>=1.0; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic<1.0,>=0.20; extra == 'anthropic'
Provides-Extra: autogen
Requires-Dist: autogen-agentchat<1.0,>=0.4; extra == 'autogen'
Requires-Dist: autogen-ext[openai]<1.0,>=0.4; extra == 'autogen'
Provides-Extra: bedrock
Requires-Dist: boto3<2.0,>=1.34; extra == 'bedrock'
Provides-Extra: cohere
Requires-Dist: cohere<6.0,>=5.0; extra == 'cohere'
Provides-Extra: crewai
Requires-Dist: crewai<2.0,>=0.80; extra == 'crewai'
Provides-Extra: dev
Requires-Dist: coverage[toml]>=7.0; extra == 'dev'
Requires-Dist: httpx<1.0,>=0.27.0; extra == 'dev'
Requires-Dist: langchain-core<1.0,>=0.3; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: gemini
Requires-Dist: google-genai<2.0,>=1.0; extra == 'gemini'
Provides-Extra: langchain
Requires-Dist: langchain-core<1.0,>=0.3; extra == 'langchain'
Provides-Extra: langgraph
Requires-Dist: langgraph<1.0,>=0.2.0; extra == 'langgraph'
Provides-Extra: llama-index
Requires-Dist: llama-index-core<1.0,>=0.10.20; extra == 'llama-index'
Provides-Extra: mistral
Requires-Dist: mistralai<1.0,>=0.4; extra == 'mistral'
Provides-Extra: openai
Requires-Dist: openai<2.0,>=1.0; extra == 'openai'
Provides-Extra: opentelemetry
Requires-Dist: opentelemetry-api<2.0,>=1.26.0; extra == 'opentelemetry'
Requires-Dist: opentelemetry-sdk<2.0,>=1.26.0; extra == 'opentelemetry'
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://pypi.org/project/nullrun/"><img
    src="https://img.shields.io/pypi/v/nullrun?style=flat&logo=pypi&logoColor=white"
    alt="PyPI version"/></a>
  <a href="https://pypi.org/project/nullrun/#files"><img
    src="https://img.shields.io/pypi/pyversions/nullrun?style=flat&logo=python&logoColor=white"
    alt="Python versions"/></a>
  <a href="https://github.com/nullrunio/nullrun-sdk-python/blob/master/LICENSE"><img
    src="https://img.shields.io/pypi/l/nullrun?style=flat"
    alt="License"/></a>
  <a href="https://pypi.org/project/nullrun/"><img
    src="https://img.shields.io/pypi/dm/nullrun?style=flat&color=blue"
    alt="Downloads"/></a>
</p>

<p align="center">
  <a href="https://github.com/nullrunio/nullrun-sdk-python/actions/workflows/ci.yml"><img
    src="https://img.shields.io/github/actions/workflow/status/nullrunio/nullrun-sdk-python/ci.yml?style=flat&logo=github&label=CI"
    alt="CI"/></a>
  <a href="https://codecov.io/gh/nullrunio/nullrun-sdk-python"><img
    src="https://img.shields.io/codecov/c/github/nullrunio/nullrun-sdk-python?style=flat&logo=codecov&logoColor=white"
    alt="Coverage"/></a>
  <a href="https://github.com/nullrunio/nullrun-sdk-python"><img
    src="https://img.shields.io/github/stars/nullrunio/nullrun-sdk-python?style=flat&logo=github"
    alt="Stars"/></a>
  <a href="https://docs.nullrun.io"><img
    src="https://img.shields.io/badge/docs-nullrun.io-0A66C2?style=flat&logo=readthedocs&logoColor=white"
    alt="Documentation"/></a>
</p>

# 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](./CHANGELOG.md) on every
> upgrade.

---

## Install

```bash
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.

```python
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.

```python
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:

- 📖 <https://docs.nullrun.io>

## 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