Compare
MentorAgent and Agent Governance Toolkit
Two tools to govern AI agents in .NET, at two different levels. The Agent Governance Toolkit (AGT, microsoft/agent-governance-toolkit), by Microsoft, checks every action of an agent against policy. MentorAgent governs inside your application: which of its methods the agent may call, for which signed-in user, and after which confirmation. They complement each other.
In short
Agent Governance Toolkit
An open-source project by Microsoft, under the MIT license: "Policy enforcement, identity, sandboxing, and SRE for autonomous AI agents" (README (external site)).
It intercepts every tool call, message and delegation of an agent and checks it against policy before it runs, in the application's own process (architecture (external site)).
It has SDKs for Python, TypeScript, .NET, Rust and Go. The .NET package is Microsoft.AgentGovernance, for .NET 8 and later (NuGet (external site)).
MentorAgent
A .NET 10 library under the Apache License 2.0, built on Microsoft Agent Framework 1.27.0.
It turns the C# methods of your application into the agent's tools. On each one you declare which roles may use it and whether the user confirms it first.
The same rules hold in the Blazor widget, on the SignalR hub, over SSE, MCP and A2A (how governance works).
What each one governs
The same questions, answered by each tool. The links in the toolkit's column go to its sources, those in the MentorAgent column to its documentation.
| Agent Governance Toolkit | MentorAgent | |
|---|---|---|
| Where it acts | Around the agent: every tool call, message and delegation is checked against policy before it runs (README (external site)). | Inside your app: the C# methods the agent may call, checked before each call runs. |
| Whom the rules are about | The agent: an identity for each agent, trust scores and execution rings (README (external site)). | The person using your app: the roles of their sign-in, from ASP.NET Core (roles from your sign-in). |
| How you write the rules | YAML policies; the .NET package also loads OPA (Rego) and Cedar policies (NuGet (external site)). | Attributes on your C# methods, plus your own rules in C# for each record (action policies). |
| A person approves | A policy rule can require approval, naming the approvers (README (external site)). | An action that changes data asks the signed-in user by default, in a box with the call's real data (confirmation). |
| Record of decisions | An append-only audit log of the decisions (architecture (external site)). | Every decision goes to an observer of yours: the action, who asked, who confirmed, the channel (audit). |
| Microsoft Agent Framework | Works as middleware in Agent Framework, with a companion package in public preview (NuGet (external site)). | Built on Agent Framework 1.27.0: it configures the agent for you, or takes an AIAgent you build (model providers). |
| MCP | Policy checks for an MCP server built with the C# SDK, and scanning of tool definitions (NuGet (external site)). | Serves your actions to MCP clients with the same roles; actions that need a confirmation are not published (MCP server). |
| Languages and license | Python, TypeScript, .NET, Rust and Go; MIT license (README (external site)). | .NET 10; Apache License 2.0. |
Where they meet, and where they differ
Both act before an action runs, both can make a person approve it, and both keep a record of what was decided.
They answer different questions. The toolkit's README notes that OAuth scopes and IAM roles "control which services an agent can reach, not what it does once connected" (README (external site)): the toolkit fills that gap with policies about agents, shared by many agents and languages.
MentorAgent answers a narrower question, inside one .NET application: may this user, signed in right now, have the agent run this method of the app, and has the user seen and confirmed what it will do?
Using them together
Use the Agent Governance Toolkit for the rules about agents: which agents may run, which tools and servers they may reach, how often, in which sandbox, with policies shared across your agents and languages.
Use MentorAgent for the rules about your users and your data: which methods of your app the agent may call for each user, the confirmation in the chat, and the same rules on every channel.
In MentorAgent the rule sits on the method it protects. This one is offered only to supervisors, and runs only after the user confirms it:
public class CaseActions(ICaseStore store)
{
// Offered only to signed-in users with the Supervisors role,
// and run only after the user confirms it in the chat.
[MentorAction(
Description = "Closes a case",
RequiredRoles = ["Supervisors"],
RequiresConfirmation = true)]
public Task CloseCase(string caseNumber)
=> store.CloseAsync(caseNumber);
}MentorAgent takes an Agent Framework AIAgent that you build yourself (`Agent`), so the two can live in the same application. We have not yet tested an agent built with the toolkit's middleware there: try it in your app before you rely on it.
Sources
Every statement about the Agent Governance Toolkit on this page comes from its public sources, checked on 13 November 2026:
- README of the repository (external site)
- Architecture (docs/ARCHITECTURE.md) (external site)
- Microsoft.AgentGovernance on NuGet (external site)
- Microsoft Agent Framework examples (external site)
If something here is out of date, tell us on GitHub (external site). The names are those of their owners; this page is not endorsed by Microsoft.
