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

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.0.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.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

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

Hashes for agentbouncr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 63661c17ff3346145e994e17cefab52aaca4b58372169ac84f3dd4edd6bfef94
MD5 fb9abcad2976d97d4f4f63787f6a7c3e
BLAKE2b-256 b6e803d84501e37346a26d19783ded6f08834fd9a66ad9ae7eb365d4e36c15ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentbouncr-0.1.0.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.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

Hashes for agentbouncr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 efc9a3d38c883ee4f88e3e55012a96fbec0489c355ec94d7a1e1dcc33da2877c
MD5 339a0ee8a61ec7a73e787ef4ca9e02f4
BLAKE2b-256 a4be06cc3ce7ed8b3355997805951ca582ce6ea5b136cece3d9b9545ee73c9e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentbouncr-0.1.0-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