Microsoft Agent Framework Security: Tool Permissions, Approval Gates and the Semantic Kernel Migration
Agent Framework 1.0 shipped on April 3, 2026 and put Semantic Kernel and AutoGen into maintenance mode. The safety documentation is unusually honest about what the framework will not do for you, and the tool registration model changed in a way that quietly widens what your model can call.
Direct answer
Microsoft Agent Framework is a well designed SDK with a real safety story, and anyone telling you it is insecure has not read the docs. Microsoft states the position plainly: "Building secure AI agents is a shared responsibility between Agent Framework and application developers", with developers responsible for validating inputs, securing data flows, and configuring tools appropriately. Three documented defaults matter for a security owner. First, "By default, all tools provided to an agent are invoked without user approval", so approval is opt-in per function. Second, "Agent Framework does not manage authentication, encryption, or connection details for these services", because all external calls run through client SDKs you chose. Third, "Agent Framework does not impose constraints on input/output length or request rates, because it doesn't know what is reasonable for your scenario". None of that is a flaw. It is a framework drawing its boundary. Agentshield is the enforcement point you add outside that boundary, when the same policy has to cover several agents, survive a process restart, and be provable to someone who never read the source.
Try it live
Watch Agentshield block an attack in real time.
Pick a scenario and drive the inspection lane yourself. No signup needed.
Run a request
Runs the live engine on your text. Nothing is stored, no account needed.
Inspection lane
INSPECTINGPolicy trace
High-risk action held for approval
Audit trail
- § · → → →
The risk
A team finishes a Semantic Kernel migration in three weeks and it goes well. Six months later an auditor asks which agents in the estate can write to production storage, and who approved the last time one did. In Semantic Kernel there was at least an answer shaped like a list, because a method was only callable by the model if somebody had put a [KernelFunction] attribute on it, and you could grep for the attribute. In Agent Framework you pass a method to the tools parameter and it is a tool. The gate moved from an attribute in the class to an argument at the call site, spread across eleven services, and grep no longer produces the inventory.
How Agentshield handles it
Keep writing the framework controls. Microsoft is right that input validation and tool approval belong close to the function, and nothing here replaces them. What Agentshield adds is the layer those controls cannot reach: route the tool and model traffic from your Agent Framework services through one policy point, declare per-agent tool and data scopes once, and the same policy applies to a .NET service, a Python service and a Copilot Studio agent without any of them being redeployed. Untrusted content, including tool results and retrieved documents, is inspected before it reaches the model. Named irreversible actions pause for a human, persist across a process restart, and expire if nobody answers. Every call is written to an immutable per-action record stating which agent asked, what policy decided, and on whose authority it proceeded.
The controls
The controls that secure every tool call your .NET and Python agents make after the Agent Framework migration.
What changed when Agent Framework 1.0 replaced Semantic Kernel and AutoGen
Microsoft shipped Agent Framework 1.0 on April 3, 2026 and folded two of its most used AI libraries into it. Semantic Kernel and AutoGen both moved to maintenance mode, which means existing projects keep working and new features land elsewhere. If you are running either in production, the decision in front of you is not whether to move but when, and what you rebuild while you are in there.
| Library | Status now | Microsoft's destination | Migration difficulty |
|---|---|---|---|
| Semantic Kernel (.NET and Python) | Maintenance mode since Agent Framework 1.0 | Microsoft Agent Framework, namespaces under Microsoft.Agents.AI | Structurally similar. The kernel, plugin model and connectors map across, and a compatibility shim converts existing KernelFunction instances |
| AutoGen | Maintenance mode, no new features | Microsoft Agent Framework workflows | Harder. The programming model moves from conversation-centric to graph-based. A compatibility layer exists and is itself slated for deprecation |
| Agent Framework | 1.0 shipped April 3, 2026 | Current | Python, .NET and Go, with Go support still catching up on some features |
Microsoft publishes a compatibility path for the Semantic Kernel half. Existing KernelFunction instances, whether built from a prompt template or from a method, convert with the as_agent_framework_tool method, which requires semantic-kernel version 1.38 or higher. That lets you migrate gradually rather than in one commit. It also means a function that was written under one set of assumptions can end up running under another, which is worth a second look during review rather than a rubber stamp.
The security work in a migration is rarely the part people budget for. Controls that lived as framework plumbing get rewritten by hand under deadline pressure, and the version that ships is usually the one without them. We wrote the same warning about the OpenAI Agent Builder shutdown, where a guardrail that used to be a node on a canvas became code in somebody's repository, and Google's ADK 2.0 upgrade does it again by silently bypassing custom overrides of the old run methods. The pattern repeats because the incentive repeats.
Is Microsoft Agent Framework secure? What it enforces and what it leaves to you
Yes, and the safety documentation is one of the more candid in this category. Microsoft names its own boundary rather than implying the framework has you covered. The useful question is not whether controls exist but who writes them, how far each reaches, and what remains true after the engineer who wrote it changes teams.
| Control | What Agent Framework gives you | The documented limit | Who writes it |
|---|---|---|---|
| Tool approval | Per function opt-in. Wrap an AIFunction in ApprovalRequiredAIFunction in .NET, set approval_mode to always_require on the tool decorator in Python, or use tool.ApprovalRequiredFunc in Go | "By default, all tools provided to an agent are invoked without user approval." The run returns a pending request to the caller, and routing, persisting and expiring it is your code | Your developer, per function |
| Harness middleware | A Harness Agent installs approval middleware with queued requests, standing approve rules and optional heuristic auto-approval | The middleware "requires the same AgentSession across approval round-trips". A packaged Go harness is not currently available | Your developer, per service |
| Input validation | Guidance to treat LLM-provided arguments as untrusted input, with allow-listing, type and range constraints, and parameterized queries | Guidance rather than enforcement. Nothing in the framework validates an argument you did not write a check for | Your developer, per tool |
| Message role trust | A documented trust model where system is highest trust and user, assistant and tool roles are all untrusted | "Agent Framework defaults untyped text to user role", so programmatic message construction can still land input in the wrong place | Your developer |
| Transport and credentials | Nothing. This is explicit | "All external service communication is handled by developer-chosen client SDKs. Agent Framework does not manage authentication, encryption, or connection details for these services" | Your platform team |
| Rate and size limits | Nothing by default | "Agent Framework does not impose constraints on input/output length or request rates, because it doesn't know what is reasonable for your scenario" | Your platform team |
| Telemetry safety | OpenTelemetry support, with sensitive data logged only when explicitly enabled | At Trace level the full ChatMessages collection is logged and can include PII. Microsoft says Trace "should never be enabled in production", and EnableSensitiveData should not be enabled there either | Your platform team |
| Session integrity | Sessions serialize for persistence | "Restoring a session from an untrusted source is equivalent to accepting untrusted input." A compromised storage backend could alter roles to escalate trust | Your developer |
Read the "who writes it" column down the page. Seven of eight rows end at a person on your team, working inside one service, shipping policy as code alongside the feature. That is a reasonable framework design and an entirely normal governance problem, and it arrives at a predictable moment: the second agent.
With one agent, in-process controls are excellent. The person who wrote the tool wrote the approval flag, review caught both, and reading one file tells you the policy. With nine agents across four repositories, the policy is the union of nine files nobody reads together, and no artifact states it. We have now written the same finding about Microsoft Foundry, Bedrock AgentCore, Snowflake Cortex and the OpenAI Agents SDK. Every serious platform governs which data an agent may reach. None decides whether the action it just proposed should happen, because that is a business question and the platform does not know your business.
The KernelFunction attribute is gone, and that changes your tool inventory
This is the part of the migration that almost nobody writes about, and it is the one a security reviewer should care about most.
In Semantic Kernel, exposing a method to the model took four deliberate steps. Decorate the method with a KernelFunction attribute in .NET or a kernel_function decorator in Python. Wrap it in a plugin class or build one with the plugin factory. Add the plugin to a Kernel. Pass the Kernel to the agent. The attribute was doing real work beyond registration: it was a marker you could search for. Ask "what can our agents call" and the answer was a grep across the solution.
In Agent Framework the attribute is gone. Microsoft's own migration guide states the change directly, under the heading Tool Function Signatures: Semantic Kernel plugin methods need the attribute, and the solution is that "Agent Framework can use methods directly without attributes". You write a plain function, pass it to the tools parameter, and the function name becomes the tool name while the docstring becomes the description. It is a genuine developer experience improvement and it removes real boilerplate.
It also moves the gate. Exposure is no longer a property of the method, visible where the method is defined. It is a property of the argument list at the call site where the agent is constructed. Both are perfectly auditable in a small codebase. Only one of them survives eleven services and three teams, and it is not the one Agent Framework uses.
If that sounds theoretical, Microsoft has already published the incident that proves the attribute mattered. In May 2026 its security researchers disclosed that a method in the Semantic Kernel SessionsPythonPlugin, DownloadFileAsync, "was accidentally marked with a [KernelFunction] attribute, which officially advertised it to the AI model as a callable tool". An attacker who could land a prompt injection could then have the agent write a payload to the Windows Startup folder and reach full remote code execution. One attribute, applied by accident, on one method, was the entire difference between a private helper and an exposed capability.
Two practical things to do during the port. Build the tool inventory while you are already in the code, as a list of every method passed to a tools parameter and what it can reach, because you will never have a cheaper moment to write it. Then decide which of those need an approval gate before the action runs, and mark them, rather than discovering the list from a postmortem.
The Semantic Kernel RCE advisories and what they mean for your migration plan
On May 7, 2026 the Microsoft Security Blog published research on remote code execution paths in AI agent frameworks, with Semantic Kernel as the named case study. Microsoft describes the library as having over 27,000 stars on GitHub, which is the point: this is not an obscure dependency. Two CVEs came out of it, and both turn a prompt injection into code running on the host.
| CVE | Component | The path | Fixed in |
|---|---|---|---|
| CVE-2026-26030 | In-memory vector store | Unsafe string interpolation in filter functions, turning prompt injection into host-level remote code execution | Version 1.39.4 or higher |
| CVE-2026-25592 | SessionsPythonPlugin | DownloadFileAsync was accidentally exposed to the model as a callable tool, allowing an arbitrary file write to the Windows Startup folder and full RCE | .NET SDK versions from 1.71.0 |
Microsoft's remediation advice is worth quoting in full because of what it implies: "Our primary recommendation is to upgrade immediately. You don't need to rewrite your agent's architecture; the security updates simply remove the AI model's ability to trigger these functions autonomously."
The fix was not to make the functions safer. The fix was to take away the model's permission to call them. That is tool permissioning, applied by the vendor, after the fact, in a patch. Every team running agents makes that same decision continuously, about their own functions, and most of them make it implicitly by never writing it down.
If you are still on Semantic Kernel while you plan the migration, the version check is the urgent item and the port is the important one. Do not let the second delay the first. Prompt injection reaching a shell is the failure mode we built prompt injection blocking on untrusted input for, and the reason it inspects tool results and retrieved documents rather than only the user's message.
Where the Agent Governance Toolkit fits, and when it is all you need
The day before Agent Framework 1.0 shipped, Microsoft released something else that belongs in this conversation and that most vendor pages in our category will not mention, because it competes with them. On April 2, 2026 the Microsoft Open Source Blog introduced the Agent Governance Toolkit, described as "an open-source project released under the Microsoft organization and MIT license that brings runtime security governance to autonomous AI agents".
It is not a Microsoft-only tool. It ships seven packages covering policy enforcement, cryptographic identity, execution rings, SRE practices, compliance verification, plugin management and reinforcement learning governance, in Python, TypeScript, Rust, Go and .NET, and it integrates with LangChain, CrewAI, Microsoft Agent Framework, Google ADK, Dify, LlamaIndex, the OpenAI Agents SDK, Haystack, LangGraph and PydanticAI. Microsoft claims it is "the first toolkit to address all 10 OWASP agentic AI risks with deterministic, sub-millisecond policy enforcement", and is explicit that "it is designed to work with the frameworks developers already use, not replace them".
If you have engineers, an appetite for running your own control plane, and a policy that does not change often, that is a serious answer and it costs nothing in license fees. We would rather tell you that than have you find out after signing something. Microsoft's own caveat applies here as much as anywhere: "No security layer is a silver bullet; defense in depth and ongoing monitoring remain essential."
Separately, for teams already deep in the Microsoft stack, the safety docs point to Agent Security with FIDES for "deterministic, label-based defense against prompt injection and data exfiltration", built as information-flow control middleware that enforces policies before sensitive tools run. That is a stronger primitive than heuristic filtering and worth reading before you buy anything.
So here is the honest split, written the way we would say it on a call.
| Your situation | What we would tell you to do |
|---|---|
| One Agent Framework service, one team, tools that only read | Buy nothing. Use approval_mode on the two functions that write, and move on |
| Still on Semantic Kernel below 1.39.4, or .NET below 1.71.0 | Buy nothing yet. Upgrade today, then plan the port. A patch beats a purchase |
| Engineering-led team that wants to own the control plane | Start with the Agent Governance Toolkit. MIT licensed, framework agnostic, no vendor in the path |
| All-in on Microsoft Foundry and Entra, agents built with Microsoft tooling only | Look at Microsoft Agent 365 first. If the identity and observability story covers you, that is one fewer vendor |
| Agents are internal, low-risk, and nobody is asking for evidence | Buy nothing. Revisit when the first agent touches customer data or money |
| Several agents across .NET, Python and Copilot Studio, one policy expected to cover all of them | This is the case we are built for. One policy point outside the application, applied without redeploying any of them |
| An approval has to survive a process restart, reach a person, and expire if ignored | Talk to us. The framework returns the pending request to your caller and stops there, by design |
| Someone external will ask what each agent was permitted to do, not just what it did | Talk to us. Traces answer the second question well and the first one not at all |
Five of those eight rows tell you to buy nothing from us. That is not modesty, it is the only way a comparison page is worth reading. If your situation is one of the first five, the rest of this page is background and you should go upgrade a package.
FAQ
Common questions about microsoft agent framework security.
Is Microsoft Agent Framework secure?
It is well designed and its safety documentation is candid about its boundary. Microsoft calls agent security "a shared responsibility between Agent Framework and application developers", where the framework supplies abstractions, providers and orchestration while developers validate inputs, secure data flows and configure tools. The gaps are stated defaults, not defects: no built-in rate limits, no credential handling, and no approval unless you ask for it.
Does Microsoft Agent Framework require approval before a tool runs?
Only when you opt in per function. Microsoft states that "By default, all tools provided to an agent are invoked without user approval". You wrap an AIFunction in ApprovalRequiredAIFunction in .NET, set approval_mode to always_require on the tool decorator in Python, or use tool.ApprovalRequiredFunc in Go. The pending request then returns to your code, which must route it to a person.
Is Semantic Kernel deprecated?
It is in maintenance mode rather than formally deprecated. Microsoft shipped Agent Framework 1.0 on April 3, 2026 and both Semantic Kernel and AutoGen moved to maintenance, meaning existing projects keep working while new capability lands in Agent Framework. Microsoft publishes a migration guide and a compatibility path that converts existing KernelFunction instances into Agent Framework tools.
How hard is the Semantic Kernel to Agent Framework migration?
Structurally straightforward for Semantic Kernel and harder for AutoGen. The Semantic Kernel plugin model, connectors and kernel concepts map onto Agent Framework, namespaces move to Microsoft.Agents.AI, Invoke becomes Run, and threads become sessions. AutoGen is the difficult one because the programming model changes from conversation-centric to graph-based, and its compatibility layer is itself slated for deprecation.
What happened to the KernelFunction attribute in Agent Framework?
It is no longer required. Microsoft's migration guide states that "Agent Framework can use methods directly without attributes", so a plain function passed to the tools parameter becomes a tool, with the function name as the tool name and the docstring as the description. It is a real improvement in ergonomics, and it moves the record of what is exposed from the method definition to the call site.
What are CVE-2026-26030 and CVE-2026-25592?
Two Semantic Kernel vulnerabilities Microsoft disclosed on May 7, 2026, both turning prompt injection into remote code execution. CVE-2026-26030 is unsafe string interpolation in in-memory vector store filter functions, fixed in 1.39.4 or higher. CVE-2026-25592 exposed SessionsPythonPlugin DownloadFileAsync to the model, allowing an arbitrary file write to the Windows Startup folder, fixed from .NET SDK 1.71.0.
What is the Agent Governance Toolkit?
An MIT licensed open-source project released under the Microsoft organization on April 2, 2026 that brings runtime policy enforcement to autonomous agents. It ships seven packages across Python, TypeScript, Rust, Go and .NET and integrates with Agent Framework, LangChain, CrewAI, Google ADK, LangGraph and others. Microsoft says it is designed to work with the frameworks developers already use rather than replace them.
Does Agent Framework handle authentication and encryption for my tools?
No, and Microsoft says so directly: "All external service communication is handled by developer-chosen client SDKs. Agent Framework does not manage authentication, encryption, or connection details for these services." Credential handling, transport security and secret storage stay with your platform team, which is the normal split for an SDK but worth confirming before an assessment rather than during one.
Does Agent Framework rate limit agent requests?
No. Microsoft states that "Agent Framework does not impose constraints on input/output length or request rates, because it doesn't know what is reasonable for your scenario", and makes you responsible for input length limits to prevent context overflow or denial of service, output limits through options such as MaxOutputTokens, and rate limiting to prevent cost overruns from concurrent requests.
Do I need an AI agent security product with Microsoft Agent Framework?
Not for a single service owned by one team. Use approval_mode on the functions that write and validate your tool arguments. You need a separate control point when one policy must cover several agents and languages, when an approval has to survive a process restart and reach a person, or when someone needs proof of what an agent was permitted to do rather than a trace of what it did.
More use cases