Agent Governance Foundation

Introducing agf-sdk: the AGF Python SDK Is on PyPI

Agent Governance Foundation
sdkpythonreleaseannouncement

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 an AuthResult and never raises on DENY or REVIEW_REQUIRED. Good for scripts, notebooks, and simple integrations.
  • AGFClient — an async client built on httpx for services that already run an event loop. Same decisions, await-able.
  • Framework adaptersagf.langchain (gate tool + AGFGuardedTool per-tool guard) and agf.crewai (AGFCrewAITool), installable as extras: pip install agf-sdk[langchain] or pip 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

agf-sdk is open source. Package on PyPI →