Call-owning middleware · PyPI 0.1.0 · Alpha · Apache-2.0

agent-framework-acgs for Microsoft Agent Framework.

Package Specification · Inspected HEAD 4407316

Upstream repository
microsoft/agent-framework
PyPI release
agent-framework-acgs==0.1.0
Python requirement
>=3.10
Framework constraint
agent-framework-core>=1.20.0,<2
Governance engine pin
acgs-lite>=3.0.1,<4
Integration mechanic
Call-owning middleware (wraps tool call)
Hook entry point
ACGSFunctionMiddleware.process · ACGSToolCheck.process

01 · Local Setup & Quickstart

Attach governance to one tool-calling agent.

Install the pinned release from PyPI alongside acgs-lite>=3.0.1,<4. Rule evaluation uses deterministic keyword and regex matching locally in Python—no external model or network call is made by the governance check.

Caveat: Independent community package; not affiliated with or endorsed by Microsoft.

Shell · PyPI installation

pip install "agent-framework-acgs==0.1.0"

Python · Microsoft Agent Framework integration

src/agent_framework_acgs/middleware.py#L99
from agent_framework import Agent
from agent_framework_acgs import ACGSGuard

guard = ACGSGuard()
agent = Agent(
    client=client,
    tools=[send_email],
    middleware=guard.middleware,
)

02 · Verdict & Review Mapping

How ACGS-Lite verdicts map to Microsoft Agent Framework.

When a tool call is proposed, the adapter formats the tool name and arguments via format_tool_call and evaluates them against the configured Constitution. Blocking rules always take precedence over review rules.

Verdict.ALLOW

Calls matching no blocking or review rules execute through ACGSFunctionMiddleware.process.

Verdict.DENY

Returns the denial reason as the function result (or raises ACGSToolCallDenied when on_deny='raise').

Verdict.REVIEW

Pauses the run as a function_approval_request item and re-verifies against blocking rules upon approval.

03 · Public API Surface

Exported symbols and source entry points.

Each adapter keeps its public surface minimal and re-exports the shared GovernanceDecision, Verdict, and ToolCallFormatter types alongside the framework-specific hook or middleware class.

__all__ exports · agent-framework-acgs

src/agent_framework_acgs/middleware.py#L99 ↗
ACGSGuardACGSFunctionMiddlewareACGSToolCallDeniedACGSConfigurationErrorAPPROVAL_PROPERTIES_KEYDECISION_METADATA_KEYGovernanceDecisionToolCallFormatterVerdictformat_tool_call

Primary hook surface: ACGSFunctionMiddleware.process · ACGSToolCheck.process. Custom ToolCallFormatter functions may be supplied if your tool arguments require custom canonical serialization before rule matching.

04 · Scope & Bypass Boundaries

What this adapter does and does not cover.

Verify these framework-specific boundaries when integrating agent-framework-acgs into an evaluation workflow.

  1. 01

    Raises UngovernedToolsError before calling the model if hosted tools or declaration-only tools that bypass function middleware are attached.

  2. 02

    Install agent-framework-acgs[mcp] when governing local MCP tools within Microsoft Agent Framework.

  3. 03

    In the current 0.1.x adapter series, rule evaluation runs through acgs-lite's ToolCallGovernor path. If your workflow requires SignedReceipt, ExecutionGrant, or SQLite EffectStore reservations, wire those contracts explicitly at the tool executor boundary.

Put one real workflow under your control.

Choose one tool. Define what it may do. Inspect what happens when a request crosses the boundary.