Skip to content

Agent 365 and API Management for MCP tool governance

Ihor SeleznovUpdated 7 min readAnnouncements

On 21 October we dropped the author list from the sign-in on our own MCP server. Now any TechFabric employee can connect their AI agent to our website and draft a post under their own name.

We made that call for one server. Microsoft's pairing of Agent 365 with Azure API Management, in public preview, makes it for every server a company runs. An MCP server is the connector an AI agent uses to read from a business system or act in it, and most software vendors now ship one. When every employee wires those connectors into their own AI tools, nobody can say which of the company's systems each agent may touch. With Agent 365, an administrator decides in one console which of those tools the company's agents may use. API Management enforces the decision on a gateway in the company's own Azure subscription, so access is granted or refused in one place instead of in each person's AI tools. That starts to matter once a company's agents reach more connectors than anyone reviews.

It costs you an API Management instance, plus a tier still in preview if you want to block single tools. One server behind the gateway is a safe place to start.

Ours, at www.techfabric.com/mcp, lets anyone search and read the site and lets our engineers' agents write blog drafts. Until 21 October only the people on the site's list of authors, a file in our repository, could sign in to write. Now Microsoft's sign-in decides who works here, and our server decides on every call what that person may do. It re-checks whose byline a draft carries, refuses anyone whose access was withdrawn, and never lets the display name in a token claim another author's byline, because a display name can read "Preetham Reddy". Those checks live in the server's own code. We haven't run Agent 365 or API Management's MCP features. Still, what we built by hand shows what the gateway takes over and what it leaves with each server.

What we built into one server

Our sign-in came together between 19 and 21 October, and each decision in it is a job the gateway would have to do for every server behind it.

Decision on our server Why Where Agent 365 and API Management would do it
Microsoft Entra ID, TechFabric's tenant only Our mail is on Office 365, so everyone already has the account validate-azure-ad-token at the gateway
Members only: a token without the claim that marks a member, rather than a guest, is refused A guest account in our tenant isn't an employee Gateway policy, written by you
Ask Microsoft for openid, profile and email, nothing more The server needs to know who you are, never your mailbox The app registration behind the gateway
Reading needs no sign-in; writing asks for it with a 401 at the first write Search shouldn't need an account Gateway policy per operation, written by you
Every write re-checks the byline and a list of revoked addresses Access can be withdrawn without waiting for a token to expire Not covered: the server still owns what a call may change

The last row is the one the gateway doesn't take off your hands. A gateway can refuse a call. It can't know that a draft belongs to someone else.

What the gateway adds

API Management can front an MCP server somebody else wrote. You point it at the server's base URL, pick a transport and give the tools a base path, and the server has to conform to MCP version 2025-06-18 or later, with Streamable HTTP or SSE transport, and either no authorization or a compliant authorization protocol. We built ours on 19 October on the newest MCP revision, so that floor was never a question for us. For a server a vendor shipped a year ago, it's the first thing we'd check.

Agent 365 then finds the API Management resources in the tenant and the servers and tools behind them, and an admin can block a whole server from one console. That's the part a company running dozens of servers can't build by hand, and it only works for agents that go through the gateway.

Agent

API Management gateway

MCP server checks its own rules

Agent 365 admin console

Managed policy on the gateway

Agent wired straight to a server

Agent 365 decides and API Management enforces; an agent wired straight to a server skips both, and the server still decides what a call may change.

Identity still needs gateway policy

Agent 365 doesn't carry a user's identity to the server behind it. Inbound, the gateway validates the Entra token, and the validate-azure-ad-token policy names the tenant and the client application IDs you accept. Outbound is where a naive setup goes wrong. Headers are forwarded to tool calls automatically with some exclusions, so a setup can work by accident and stop when an exclusion bites. To do it on purpose, forward Authorization yourself with set-header, or use credential manager, which fetches a token for the backend with get-authorization-context. Across many servers we'd pick credential manager, because the other option is one copy of the same token-forwarding snippet per server.

Tool-level blocking sits in a preview tier

The v2 tiers give a server inventory and block or unblock a whole server; the AI Gateway tier, itself in preview, adds blocking of individual tools, tool activity observability and tool threat protection. Turning a server off is crude when nineteen of its twenty tools only read and one deletes things. The tool-level control fixes that, but it needs each server to declare a static list of allowed tools. So we'd ask of every vendor server whether its tool surface is fixed or changes under you.

A blocked call returns HTTP 200 with a JSON-RPC body carrying isError=True, a ToolNotAvailable denial code, a correlation ID and text telling the agent not to retry. Retry logic that keys off status codes reads that as success. Our own server answers a write without a sign-in with a 401 that tells the client to sign in. The gateway does it differently enough that we'd test every agent against it.

Granting the A365 MCP Gateway Policy Operator role, once, at tenant level, lets Agent 365's own identity read and write policies on the gateway and discover resources in current and future subscriptions. For many companies that's a fair trade against a parallel approval process. It's still a standing grant, so we'd record who approved it.

Where it stops

The gateway governs the call, and in the AI Gateway tier it can also inspect what a tool returns and withhold an unsafe result before it reaches the agent (tool threat protection). What it can't do is decide which rows a given person may see. Where an agent reads governed data, the row and column rules belong in the data platform, and a tool is only as governable as the table under it. That's why we'd start with getting ERP or CRM data into a governed platform. And it won't fix an agent with too many tools. Deciding which tools an agent gets is design work, the same work as our server's split between reading for anyone and writing for employees.

Both the integration and the tier with tool-level blocking are in public preview, and their features, regions and limits can change before general availability. We wouldn't put a compliance commitment on tool-level blocking this quarter.

What we'd test first

Put one MCP server behind API Management, block one of its tools from Agent 365, and call that tool from the agent you already run. Watch whether the agent explains the denial or retries, and whether the signed-in person's identity reaches the server. If both hold, list the agents still reaching tools without the gateway, because those are the ones it doesn't govern.

Frequently asked questions

Does Agent 365 work with MCP servers that aren't behind Azure API Management?

Not through this integration. Agent 365 discovers Microsoft.ApiManagement resources in your tenant and the MCP servers and tools they expose, so a tool reached by any other path gets no gateway enforcement from it.

Which MCP servers can API Management front for Agent 365?

Servers that conform to MCP version 2025-06-18 or later, over Streamable HTTP or SSE, with either no authorization or a compliant authorization protocol. API Management can also expose a REST API you already manage as an MCP server, with its operations as tools.

How does an MCP server know which signed-in person is calling it?

It has to be told, by the gateway or by the server's own sign-in. Behind API Management you validate the Entra token with validate-azure-ad-token and forward identity with set-header or credential manager. Our own MCP server signs people in with Entra itself and re-checks who they are on every write.