Call-owning middleware · PyPI 0.1.0 · Alpha · Apache-2.0
agent-framework-acgs for Microsoft Agent Framework.
Provides function and chat middleware plus tool-approval hooks for Microsoft Agent Framework pipelines, with an optional [mcp] extra.
Package Specification · Inspected HEAD 4407316
- Framework maintainer
- Microsoft · learn.microsoft.com
- 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.
Shell · PyPI installation
pip install "agent-framework-acgs==0.1.0"Python · Microsoft Agent Framework integration
src/agent_framework_acgs/middleware.py#L99from 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.
Calls matching no blocking or review rules execute through ACGSFunctionMiddleware.process.
Returns the denial reason as the function result (or raises ACGSToolCallDenied when on_deny='raise').
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_callPrimary 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.
- 01
Raises UngovernedToolsError before calling the model if hosted tools or declaration-only tools that bypass function middleware are attached.
- 02
Install agent-framework-acgs[mcp] when governing local MCP tools within Microsoft Agent Framework.
- 03
In the current
0.1.xadapter series, rule evaluation runs throughacgs-lite'sToolCallGovernorpath. If your workflow requiresSignedReceipt,ExecutionGrant, or SQLiteEffectStorereservations, 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.