[AAASM-3538] ✨ (adapters): Add Microsoft Agent Framework adapter#164
Merged
Chisanan232 merged 8 commits intoJun 22, 2026
Merged
Conversation
Govern Microsoft's unified Agent Framework (PyPI `agent-framework`, module `agent_framework`) by monkey-patching `FunctionTool.invoke` — the single async coroutine through which every function tool executes. This intercepts both `@tool`-decorated callables and direct `FunctionTool(...)` instances without requiring any opt-in framework middleware. `is_available()` probes the importable `agent_framework` module rather than the framework name (`microsoft_agent_framework`), avoiding the AAASM-3528 silent no-op. Deny raises `PolicyViolationError` before the wrapped function runs; allow runs it and records the result; pending waits for approval; unknown verdicts fail closed under enforce. Refs AAASM-3538 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire MicrosoftAgentFrameworkAdapter into the AdapterRegistry builtin set and give it priority 6 (after Google ADK, before the MCP fallback) so `init_assembly()` auto-detects and hooks it whenever `agent_framework` is importable. Refs AAASM-3538 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Prove the adapter genuinely governs rather than no-ops (AAASM-3528): a deny verdict blocks the tool AND prevents its side effect, allow runs it and records the result, pending-then-deny rejects at approval, and unknown verdicts fail closed under enforce / open otherwise. A guarded `importorskip` test drives the REAL `agent_framework.FunctionTool` with a negative control showing the ungoverned call executes the side effect, then deny prevents it. Refs AAASM-3538 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the Microsoft Agent Framework row to the README and compatibility tables, note the `agent-framework` (PyPI) vs `agent_framework` (import) split, the `FunctionTool.invoke` hook point, and the pre-release install caveat (uv needs `--prerelease=allow`). Link the framework-support status row to the new example. Refs AAASM-3538 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
Author
|
Claude Code — review result ✅ Real CI green (SonarCloud not blocking).
Ready to merge. No blocker — the framework installed and hooked cleanly. Merge before examples #153 + a python-sdk release. Full cross-repo review on AAASM-3535. |
Resolve registry + README overlaps after py #160 (Haystack) merged: keep both frameworks' entries/imports/builtins. frameworks.md + compat table auto-merged (both rows present). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…eat/ms_agent_framework_support # Conflicts: # README.md # agent_assembly/adapters/registry.py # docs/compatibility/frameworks.md
…eat/ms_agent_framework_support # Conflicts: # README.md # agent_assembly/adapters/registry.py # docs/compatibility/frameworks.md
…eat/ms_agent_framework_support # Conflicts: # README.md # agent_assembly/adapters/registry.py
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Adds full Python-SDK governance support for Microsoft Agent Framework — the unified MS framework published on PyPI as
agent-framework(importable moduleagent_framework, verified at v1.9.0).The adapter (
agent_assembly/adapters/microsoft_agent_framework/) hooksagent_framework.FunctionTool.invoke— the single async coroutine through which every function tool executes (both@agent_framework.tool-decorated callables and directFunctionTool(...)instances). Patching that one method governs all tool execution without requiring the user to register any opt-in framework middleware.Key points:
is_available()probes the importableagent_frameworkmodule, not the framework namemicrosoft_agent_framework— avoiding the AAASM-3528 silent no-op.PolicyViolationErrorbefore the wrapped function runs (no side effect); allow runs it and records the result; pending waits for approval; an unknown/malformed verdict fails closed under enforce and open under observe/disabled.Type of Change
Breaking Changes
Related Issues
Testing
test/unit/adapters/microsoft_agent_framework/proves real governance, not a no-op:FunctionTooltests verify deny blocks AND prevents the wrapped function's side effect, allow runs + records, pending-then-deny rejects, and fail-closed/open verdict handling.importorskip-guarded test drives the realagent_framework.FunctionToolwith a negative control: the ungoverned call executes its side effect; deny then prevents it; allow runs it and records the result.All 16 new tests pass; the full 304-test adapter suite is green.
ruff check,ruff format, and the configuredmypyare clean on the new files.Checklist
Refs AAASM-3538
🤖 Generated with Claude Code