Python: [Breaking] Add MCP tool approval callback for Azure AI Agent - #14210
Merged
SergeyMenshykh merged 2 commits intoJul 28, 2026
Merged
Conversation
Add an agent-level callback for Azure AI MCP tool approval requests and use it when submitting tool approvals from thread actions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3e190979-228b-4a82-8e63-5ad14bd4879f
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an Azure AI Agent–level callback that decides whether to approve each pending MCP tool call when Azure AI Foundry requests tool approvals, defaulting to deny when no callback is configured.
Changes:
- Introduces
MCPToolApprovalRequestandMCPToolApprovalCallbackfor per-call approval decisions. - Routes MCP tool approval handling in
AgentThreadActionsthrough shared helpers (non-streaming + streaming). - Adds unit tests covering approval/denial, callback errors, and per-call decisions.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| python/semantic_kernel/agents/azure_ai/agent_thread_actions.py | Adds shared helpers to build/resolve MCP tool approvals and wires them into invoke + streaming paths. |
| python/semantic_kernel/agents/azure_ai/azure_ai_agent.py | Adds mcp_tool_approval_callback to the agent model and constructor with documented deny-by-default behavior. |
| python/semantic_kernel/agents/azure_ai/mcp_tool_approval.py | Introduces the approval request dataclass and callback type alias. |
| python/semantic_kernel/agents/init.py | Re-exports the MCP approval callback/request types from the agents package. |
| python/tests/unit/agents/azure_ai_agent/test_mcp_tool_approval.py | Adds unit coverage for approval resolution and end-to-end invoke handling. |
| python/samples/concepts/agents/azure_ai_agent/azure_ai_agent_mcp_streaming.py | Updates sample comments to reflect the new approval-callback behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3e190979-228b-4a82-8e63-5ad14bd4879f
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Jul 28, 2026
SergeyMenshykh
enabled auto-merge
July 28, 2026 09:02
Giles Odigwe (giles17)
approved these changes
Jul 28, 2026
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.
Summary
Testing