Skip to main content

Python SDK for AgentBouncr — Governance for AI Agents

Project description

agentbouncr

PyPI version Python versions License: MIT

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://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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentbouncr-0.1.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentbouncr-0.1.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file agentbouncr-0.1.1.tar.gz.

File metadata

  • Download URL: agentbouncr-0.1.1.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

Hashes for agentbouncr-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7b64abe31f66150893437e176f828f01ca2dd5b460cb279372a11aa5f0f4a140
MD5 e4dc229aec2f8259106398d471eaa84c
BLAKE2b-256 c8020f497ed5147647f39f0f1171a3fbd23999c8178465bab057baa57a920f36

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentbouncr-0.1.1.tar.gz:

Publisher: publish-python.yml on agentbouncr/enterprise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentbouncr-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: agentbouncr-0.1.1-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

Hashes for agentbouncr-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3382796251b01197e81c8632393ac0c69d6fa5a5ae4396a8f162e0f559333eb1
MD5 c3e23e25de97ab5cd70ef3241e7197c3
BLAKE2b-256 4ec08aab2bf84f35fddd3e3ca2f470099b332dcd1d6e00a19f2cc112fb3ae7ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentbouncr-0.1.1-py3-none-any.whl:

Publisher: publish-python.yml on agentbouncr/enterprise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page