Docs · Python SDK

Three lines. Every action checked.

The Python SDK wraps any tool call your agent makes and asks the BoundaryAI engine whether it should proceed.

1. Install

pip install boundaryai

2. Configure

from boundaryai import Boundary

boundary = Boundary(api_key="bnd_live_...")  # or BOUNDARYAI_API_KEY env var

3. Wrap your tool call

decision = boundary.check(
    action="db.delete_table",
    resource="prod.customers",
    actor={"agent": "support-bot", "user": "agent@acme.com"},
    context={"reason": llm_reasoning, "blast_radius": "high"},
)

if decision.allow:
    db.delete_table("prod.customers")
elif decision.escalate:
    request_human_approval(decision.token)
else:
    raise BlockedByPolicy(decision.reason)

That's it

Every call is logged, replayable, and tamper-evident.

The same SDK pattern works for shell exec, payment APIs, IAM mutations, and outbound LLM calls. See the API reference for the full action catalog and decision schema.