Share via

Foundry Agent App ID keeps changing

Luís Teixeira 25 Reputation points
2026-05-12T10:00:36.1366667+00:00

Hello

We have a dotnet solution exposing an MCP.
The Foundry Agent we have has the MCP Tool with Agent Identity as it's authentication:
User's image

We are validating the authentication when the Agent calls our MCP with it's Audience + its App ID so we know its a valid and authenticated Agent created by us.

However we have noticed that sometimes the Agent is calling the MCP with its own agentIdentity, in the case:
network-new-project-resource-network-new-project-network-resolver-AgentIdentity

But sometimes with the actual project Identity of where the Agent is, in this case:
network-new-project-resource-network-new-project-AgentIdentity

Its this supposed to be happening, or are there changes going on?
Because we keep having to change our configuration to control which agents call our MCP.

Microsoft Foundry
Microsoft Foundry

A unified Azure platform for creating and managing AI models, agents, and applications with built‑in enterprise security, monitoring, and governance


1 answer

Sort by: Most helpful
  1. SRILAKSHMI C 19,100 Reputation points Microsoft External Staff Moderator
    2026-05-12T10:46:42.5966667+00:00

    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:

    1. Support both identities Update your MCP authorization logic to accept: • the shared project identity, and • the dedicated per-agent identities you trust
    2. 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!

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.