Python SDK for AgentBouncr — Governance for AI Agents
Project description
agentbouncr
Governance for autonomous AI agents. Every tool call is checked against your policies before execution.
Works with LangChain, LangGraph, CrewAI, AutoGen — or any framework. Drop-in callback for LangChain users, plain HTTP client for everyone else.
Installation
pip install agentbouncr
For LangChain integration:
pip install "agentbouncr[langchain]"
30-Second Quickstart
from agentbouncr import AgentBouncr
client = AgentBouncr(api_key="sk_live_your_key_here")
result = client.evaluate(
agent_id="my-research-agent",
tool="send_email",
params={"to": "user@example.com"},
)
if result.allowed:
send_email(to="user@example.com")
else:
print(f"Blocked by policy: {result.reason}")
LangChain in 3 Lines
from agentbouncr import AgentBouncr
from agentbouncr.langchain import AgentBouncrCallbackHandler
client = AgentBouncr(api_key="sk_live_your_key_here")
handler = AgentBouncrCallbackHandler(client, agent_id="my-research-agent")
# Your existing agent — only the `callbacks=[handler]` line is new
executor = AgentExecutor(agent=agent, tools=tools, callbacks=[handler])
executor.invoke({"input": "Find the latest AI news"})
Every tool call now passes through AgentBouncr first. Denied calls raise GovernanceDeniedError.
LangGraph works the same way — pass callbacks=[handler] to create_react_agent.
Authentication
Get an API key from your AgentBouncr Dashboard under Settings → API Keys.
client = AgentBouncr(api_key="sk_live_...")
For multi-workspace setups:
client = AgentBouncr(
api_key="sk_live_...",
tenant_id="your-workspace-id",
)
Configuration
client = AgentBouncr(
api_key="sk_live_...",
base_url="https://api.agentbouncr.com", # default
timeout=5.0, # request timeout in seconds
max_retries=3, # exponential backoff for 5xx/429
tenant_id=None, # optional X-Tenant-Id header
)
Error Handling
from agentbouncr import (
AgentBouncrError, # base class
AuthenticationError, # 401
ValidationError, # 400
RateLimitError, # 429 after retries exhausted
ServerError, # 5xx after retries exhausted
TimeoutError, # request exceeded timeout
GovernanceDeniedError, # raised by LangChain handler when policy denies
)
Links
- API Documentation: https://agentbouncr.com/api/docs
- Dashboard: https://app.agentbouncr.com
- Quickstart Guide: docs/quickstart.md
- TypeScript SDK:
agentbouncron npm
License
MIT — see LICENSE.
The AgentBouncr backend is commercial software. The SDK is open source so you can audit, patch, and integrate freely.
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 agentbouncr-0.1.0.tar.gz.
File metadata
- Download URL: agentbouncr-0.1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63661c17ff3346145e994e17cefab52aaca4b58372169ac84f3dd4edd6bfef94
|
|
| MD5 |
fb9abcad2976d97d4f4f63787f6a7c3e
|
|
| BLAKE2b-256 |
b6e803d84501e37346a26d19783ded6f08834fd9a66ad9ae7eb365d4e36c15ea
|
Provenance
The following attestation bundles were made for agentbouncr-0.1.0.tar.gz:
Publisher:
publish-python.yml on agentbouncr/enterprise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentbouncr-0.1.0.tar.gz -
Subject digest:
63661c17ff3346145e994e17cefab52aaca4b58372169ac84f3dd4edd6bfef94 - Sigstore transparency entry: 1474302773
- Sigstore integration time:
-
Permalink:
agentbouncr/enterprise@6dfc97e847e71578ff1518ee063b2e400fe2903b -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/agentbouncr
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@6dfc97e847e71578ff1518ee063b2e400fe2903b -
Trigger Event:
push
-
Statement type:
File details
Details for the file agentbouncr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentbouncr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.3 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 |
efc9a3d38c883ee4f88e3e55012a96fbec0489c355ec94d7a1e1dcc33da2877c
|
|
| MD5 |
339a0ee8a61ec7a73e787ef4ca9e02f4
|
|
| BLAKE2b-256 |
a4be06cc3ce7ed8b3355997805951ca582ce6ea5b136cece3d9b9545ee73c9e0
|
Provenance
The following attestation bundles were made for agentbouncr-0.1.0-py3-none-any.whl:
Publisher:
publish-python.yml on agentbouncr/enterprise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentbouncr-0.1.0-py3-none-any.whl -
Subject digest:
efc9a3d38c883ee4f88e3e55012a96fbec0489c355ec94d7a1e1dcc33da2877c - Sigstore transparency entry: 1474302915
- Sigstore integration time:
-
Permalink:
agentbouncr/enterprise@6dfc97e847e71578ff1518ee063b2e400fe2903b -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/agentbouncr
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@6dfc97e847e71578ff1518ee063b2e400fe2903b -
Trigger Event:
push
-
Statement type: