Every previous integration with AGF meant hand-rolling HTTP calls to POST /v1/decide — building the request shape, handling retries, parsing REVIEW_REQUIRED responses, verifying webhook signatures. That's a reasonable way to start, but it's boilerplate every team ends up rewriting.
agf-sdk removes that boilerplate. It's on PyPI now:
pip install agf-sdk
What's in it
The package ships four things:
AgentGovernance— a synchronous facade for the common case:agf.authorize(agent_id, action, resource)returns anAuthResultand never raises on DENY or REVIEW_REQUIRED. Good for scripts, notebooks, and simple integrations.AGFClient— an async client built onhttpxfor services that already run an event loop. Same decisions,await-able.- Framework adapters —
agf.langchain(gate tool +AGFGuardedToolper-tool guard) andagf.crewai(AGFCrewAITool), installable as extras:pip install agf-sdk[langchain]orpip install agf-sdk[crewai]. - Webhook verification — HMAC signature checking for the outbound webhooks AGF sends on decision, approval, and quota events.
import os
from agf import AgentGovernance
agf = AgentGovernance(
api_key=os.environ["AGF_API_KEY"],
org_id="org_acme",
)
result = agf.authorize(
agent_id="did:agf:agt_01abc",
action="write:file",
resource="/tmp/report.txt",
)
if result.allowed:
do_the_thing()
else:
print(f"Blocked: {result.reason}")
That's the whole integration surface for a basic authorization check — no manual request construction, no manual signature parsing.
Why a Python SDK first
Most agent frameworks in production today — LangChain, CrewAI, AutoGen, custom orchestration loops — are Python. A typed client that matches those frameworks' existing patterns (tools, wrappers, function maps) gets policy enforcement in front of engineers faster than a raw REST reference ever will. A TypeScript SDK (@agf/sdk) ships alongside it for dashboard and Node-based integrations.
Where to go next
- Add authorization to a LangChain agent →
- Add authorization to a CrewAI crew →
- Add authorization to an AutoGen agent →
- Full quick start guide →
- Full release notes — v0.5.0 →
agf-sdk is open source. Package on PyPI →

