Agent Governance Foundation

agf-sdk 0.7.0: LangGraph, OpenAI Agents SDK, and a Warm-Container Fix

Agent Governance Foundation
agf-sdkreleasepython

agf-sdk 0.7.0 is out on PyPI. Two additions extend framework coverage; one fix corrects a real bug in the SDK's sync/async bridge. None of it is a security fix — the bug below is a correctness bug, not an authorization bypass — but it's worth understanding if you run AGF anywhere that reuses a client across many calls.

What's new

agf.langgraph — a guard_node decorator for LangGraph's graph-node pattern, complementing the existing AGFGuardedTool (which already worked unmodified inside a LangGraph ToolNode, since it's a standard BaseTool). See the LangGraph integration guide.

agf.openai_agentsguard_function_tool, wrapping an OpenAI Agents SDK FunctionTool's on_invoke_tool directly rather than building on the SDK's native ToolInputGuardrail hook, which collapses every failure into one generic exception type and has no output-side hook to drive accurate outcome reporting. See the OpenAI Agents SDK integration guide.

Both reuse the same guard shape the rest of the SDK already has — client, agent_id, action_type, chain_provider, validate_execution, report_outcome — so nothing new to learn if you've integrated any other framework already.

The fix: a broken sync/async bridge

Before 0.7.0, the internal helper bridging a synchronous guard_tool()/guard_node() call to the SDK's async policy check (_run_async_from_sync()) created a brand-new event loop on every call. A shared AGFClient's pooled httpx connections bind to whichever event loop first touched them — so the second sync-bridged call on a fresh loop crashed with RuntimeError: Event loop is closed. This affected any real server handling more than one request through a shared client: guard_tool(), guard_node(), and guard_action() were all affected; AGFGuardedTool/AGFCrewAITool were never affected, since they already used a correctly-hardened persistent-loop bridge.

0.7.0 fixes the three affected call sites to route through that same correct implementation. This surfaced concretely during live-testing of the new guard_node adapter — reproduced in complete isolation with plain guard_tool() called twice — and turned out to affect a warm Lambda container's second invocation the same way.

If you run agf-sdk anywhere a client instance is reused across calls (a warm Lambda container, a long-running worker, an MCP server handling more than one request), upgrading to >= 0.7.0 is not optional. See the AWS Lambda integration guide for the full warm-container guidance.

Upgrading

pip install --upgrade agf-sdk

No breaking changes to existing APIs — AGFGuardedTool, guard_node (new), guard_function_tool (new), guard_tool, and the core AGFClient interface are all unchanged for existing callers.

Next steps


The AGF Python SDK is open source. GitHub →