A unified Azure platform for creating and managing AI models, agents, and applications with built‑in enterprise security, monitoring, and governance
Hello @Luís Teixeira
Thank you for reaching out Microsoft Q&A,
What you are observing is actually expected behavior in Azure AI Foundry when MCP tools are configured with “Agent Identity” authentication.
Azure AI Foundry currently uses two types of identities internally depending on the execution/runtime path:
• Shared project identity (project-wide managed identity) Example: network-new-project-resource-network-new-project-AgentIdentity
• Dedicated per-agent identity Example: network-new-project-resource-network-new-project-network-resolver-AgentIdentity
From your description, the MCP requests are sometimes arriving with: • the dedicated agent identity, and • other times with the broader project-level managed identity.
This behavior is related to how the Foundry runtime resolves authentication context depending on: • the execution path used by the agent runtime, • MCP tool orchestration flow, • project-scoped vs agent-scoped identity behavior, • whether the agent is using the newer object model, • and ongoing backend/runtime updates within the Foundry platform.
In practice: • Legacy/in-development agents may use the shared project identity • Published or newer-model agents may use their own dedicated per-agent identity
Because of this, relying exclusively on a single App ID for validation can lead to inconsistent authorization behavior, which matches what you are currently experiencing.
Recommended approach:
Instead of validating against only one expected App ID, we recommend validating using a trusted allowlist containing: the Agent Identity App ID(s), and the Foundry Project Managed Identity App ID for the corresponding project boundary.
In practice, commonly validate: • audience (aud) • tenant (tid) • issuer (iss) • and a set of approved managed identity object IDs/app IDs rather than assuming a single stable identity path for all MCP invocations.
To avoid continuously changing your configuration, you have two main options:
- Support both identities Update your MCP authorization logic to accept: • the shared project identity, and • the dedicated per-agent identities you trust
- Migrate fully to the newer per-agent identity model If all agents are recreated/published using the newer model, each agent should consistently use its own dedicated identity. This provides: • cleaner isolation, • simpler authorization boundaries, • and more predictable identity behavior.
Also If strict isolation between agents is required, consider:
• implementing additional application-level authorization metadata,
• validating agent-specific claims where available, or introducing per-agent secrets/tokens on top of managed identity validation.
At this time, there have been ongoing platform/runtime improvements in Foundry Agent orchestration, and this likely explains why you are seeing intermittent differences in identity behavior.
We would recommend: temporarily supporting both identities in your MCP authorization logic, and gradually migrating toward the dedicated per-agent identity model if stricter isolation is needed.
Please refer this
Agent identity concepts in Microsoft Foundry https://learn.microsoft.com/azure/foundry/agents/concepts/agent-identity
Agent types during the transition (within the migration article) https://learn.microsoft.com/azure/foundry/agents/how-to/migrate-agent-applications#agent-types-during-the-transition
I hope this helps, do let me know if you have further queries.
Thank you!