agr-sdk
Python SDK for AGR (Agentic Governance Runtime) — a drop-in governance layer for AI agent tool calls. Every action your agent takes is evaluated against your org's policies before it runs.
Install
pip install agr-sdk
Quickstart — zero-touch guard
import agr
agr.configure(
base_url="https://api.agr.dev", # or your self-hosted AGR instance
api_key="agr_sk_xxx",
agent_id="my-agent",
)
@agr.guard(action="execute_sql", resource="prod_db")
def run_query(sql: str) -> str:
...
Calling run_query(...) now evaluates the action against your AGR policies first. If policy denies it, AGRDeniedError is raised instead of the query running. If policy requires human approval, the call blocks (or raises AGRApprovalTimeoutError) until a human decides.
Quickstart — wrap existing tools
import agr
agr.configure(base_url="https://api.agr.dev", api_key="agr_sk_xxx", agent_id="my-agent")
tools = agr.wrap_tools(my_langchain_tools) # LangChain BaseTool instances, plain callables, or async callables
Quickstart — raw client
from agr import AGRClient
client = AGRClient(api_key="agr_sk_xxx", base_url="https://api.agr.dev")
result = client.evaluate(agent="my-agent", action="deploy", resource="production")
if result.allowed:
...
elif result.denied:
...
elif result.requires_approval:
...
An AsyncAGRClient with the same shape is available for async code.
Framework integrations
- LangChain —
agr.wrap_tools()auto-detectsBaseToolinstances. - CrewAI / LangGraph — see
agr.plugins.crewai/agr.plugins.langgraph.
License
MIT
Release files for agr-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agr_sdk-0.1.0.tar.gz | 17.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agr_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.6 kB
Release files / agr_sdk-0.1.0.tar.gz
| Download URL | agr_sdk-0.1.0.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f267700ac86ad799a0f5f4fa3408333e7095c30070aad556957d3f69047df07
|
|
BLAKE2b-256 checksum How to use checksums |
9f294b43a7c7a8e4b220564ea11a0963864d2e6fafd2d17f7c8df48cd14a724c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / agr_sdk-0.1.0-py3-none-any.whl
| Download URL | agr_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
748de1e1078baa59cd15a165ae50131511cda36833d7444cae8e0cfeb2e79945
|
|
BLAKE2b-256 checksum How to use checksums |
391b3a8a90dd7229bf95e9903b922798e1be1670138d92fff73c86bd75919c16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|