AEAP Composition Boundary Adapter for the Microsoft Agent Framework.
A thin wrapper that attaches the AEAP Runtime Decision Point (RDP) to the Microsoft Agent Framework's middleware chain and workflow nodes. Consequential actions produce independently verifiable Execution Receipts. The adapter composes with the framework's own middleware, telemetry, session, and tool machinery.
pip install aiyoplane-microsoft-agent-frameworkMicrosoft's current Agent Framework — the successor to AutoGen and Semantic Kernel — explicitly includes middleware for intercepting agent actions as a first-class architectural primitive. That middleware primitive is architecturally adjacent to the AEAP Composition Boundary, which makes this one of the cleanest adapter integrations in the Wave 1 set. AEAP sits in the middleware chain; the agent gets independently verifiable authorization for every consequential action without application code changes.
The framework also positions workflows around explicit execution paths — nodes with declared pre- and post-conditions. AEAP's second integration surface in this adapter is the workflow-node wrapper.
See the AEAP specification §9 for the Composition Boundary primitive this adapter realizes.
from agent_framework import Agent
from aiyoplane_mcp_authz import create_aiyo_mcp_authz, create_local_rdp
from aiyoplane_microsoft_agent_framework import (
AiyoAgentMiddleware,
BlockedByPolicy,
EscalationRequired,
)
policy = {
"rules": [
{"action_type": "payment", "amount_max": 1_000, "effect": "allow"},
{"action_type": "payment", "amount_max": 10_000, "effect": "escalate"},
{"action_type": "payment", "effect": "block"},
]
}
authz = create_aiyo_mcp_authz(
rdp=create_local_rdp(policy=policy),
tool_config={
"transfer_funds": {"aiyo_gated": True, "action": {"type": "payment"}},
},
)
aiyo_mw = AiyoAgentMiddleware(
authz=authz,
intent_builders={
"transfer_funds": lambda payload: {
"type": "payment",
"amount": payload["amount"],
"target": payload["to_account"],
},
},
)
agent = Agent(
name="banker",
instructions="Help the user manage their accounts.",
middleware=[aiyo_mw, ...],
)The middleware pattern: AEAP runs before every action matching an entry in intent_builders. Non-registered actions pass through unchanged (explicit opt-in).
For workflow nodes defined as plain callables, use wrap_action:
from aiyoplane_microsoft_agent_framework import wrap_action
async def deploy(target: str, artifact_hash: str) -> str:
return actually_deploy(target, artifact_hash)
guarded_deploy = wrap_action(
deploy,
authz=authz,
tool_name="deploy",
intent_builder=lambda kwargs: {
"type": "deploy",
"target": kwargs["target"],
"artifact": kwargs["artifact_hash"],
},
)
# Register with your workflow the usual way.For each gated action:
- Intent construction.
intent_builder(action_payload)produces an AEAP Intent payload. - RDP evaluation. Via
aiyoplane-mcp-authz's AiyoAuthz middleware. - Verdict composition.
- ALLOW → action proceeds to the next middleware / inner function; receipt attached to context.
- ESCALATE →
EscalationRequiredis raised. - BLOCK →
BlockedByPolicyis raised; the action never executes.
- Fail-closed default on every ambiguous condition.
from aiyoplane_mcp_authz import create_local_rdp, create_hosted_rdp
# Development:
authz = create_aiyo_mcp_authz(rdp=create_local_rdp(policy=policy), tool_config={...})
# Production:
authz = create_aiyo_mcp_authz(
rdp=create_hosted_rdp(api_key="aiyo_live_..."),
tool_config={...},
)Middleware class. Register in the agent's middleware chain. Hook: before_action(context, action).
Convenience factory for AiyoAgentMiddleware.
Function-level wrapper for workflow nodes or direct function invocations outside the middleware chain.
AiyoMSAgentFrameworkError— base classAdapterConfigError,BlockedByPolicy,EscalationRequired
Apache License 2.0.
- AEAP specification: https://github.com/aiyoplane/aeap
- Underlying implementation:
aiyoplane-mcp-authz - Node sibling:
@aiyoplane/microsoft-agent-frameworkon npm - Trust surface: https://aiyoplane.com/trust
- Issues: https://github.com/aiyoplane/microsoft-agent-framework-python/issues
Microsoft, Microsoft Agent Framework, AutoGen, and Semantic Kernel are trademarks of Microsoft Corporation. This package is an independent AEAP Composition Boundary Adapter and is not affiliated with or endorsed by Microsoft Corporation.
Verify First. Execute Second.