web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

D365 ERP MCP Agent Bypasses User Security Roles — How to Enforce Permissions?

(3) ShareShare
ReportReport
Posted on by 80

Background: We have added some custom logic in the OOB Copilot for Finance and Operations Agent in Copilot Studio to create and manages routes and in D365 F&O. The agent structure is:

  • OOB "Copilot for Finance and Operations" agent — surfaced in the D365 F&O Copilot sidecar
  • D365 ERP MCP connected as a tool to the OOB agent
  • Custom instructions and knowledge document added to the OOB agent covering route creation steps and business logic
  • Agent correctly uses D365 ERP MCP tools for live data operations 

  •  

Problem: Observed that the D365 ERP MCP does not account for the logged-in user's D365 security roles.

Specifically:

  1. We removed the security role that grants route creation access from a test user
  2. That user cannot manually create routes in D365 F&O (blocked as expected)
  3. However, when the same user uses the Copilot sidecar agent, routes are created successfully bypassing the security restriction entirely

Questions:


  1. What credentials does the D365 copilot agent run under - the logged-in user's session, or a separate service account?

  2. Is there a way to configure the agent to enforce the logged-in user's D365 security roles?

  3. As a workaround, can the agent query SecurityUserRoleV2 or a similar entity to check if the current user has the required role before proceeding with record creation?

  4. Is this a known limitation of the D365 ERP MCP, and if so, what is the recommended approach for enforcing security in agent-driven workflows?

  5.  

Any guidance from the community would be appreciated.

Categories:
I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    306,376 Super User 2026 Season 1 on at
    Hi CuriousMind,
     
    The Sidecar is executing with the users credentials and performs actions with his permissions only. In case you have a child agent, check if this one will be triggered inheriting the user or if the user is fixed for the child agent.
    The MCP server is honoring the permissions of the user that runs the (child) agent. Depending on your version, the MCP is using form interactions, data entities or SQL, based on the entities. In case the user does not have permissions on the forms via the menu items, but it has access via data entities, then it can still create the routes. So, check the security role for permissions on both menu items and data entities. 
  • Suggested answer
    Giorgio Bonacorsi Profile Picture
    3,532 on at

    Hello,

     

    You need to link your MCP to a user with System Administrator credentials in D365FO:

     
     
    Once this is done, for the embedded agent you need to specify in the instructions that the MCP already has authorization, so it does not ask the user to authorize.
    For more details, see this article:https://dax365fo.org/2026/06/25/copilot-studio-troublesoot-error-code-integratedauthenticationnotsupportedinchannel/​​​​​​​
     
    Thank you, 
    Giorgio
  • CuriousMind Profile Picture
    80 on at
    @André Arnaud de Calavon @Giorgio Bonacorsi

    In the Copilot studio agent, when connecting to the Dynamics 365 ERP MCP as a tool, I have configured to use End user credentials (screenshot attached). Authenticate with Microsoft is the authentication setting on the agent (screenshot attached).
    When I test using the test panel in copilot studio, or after publishing the agent, while testing in the copilot sidecar in D365FO, the agent is performing operations that they don't have permissions for. I verified to see the user doesn't have permissions on the menu items (UI) and data entities required for the route operations. Why could this be happening?

    Does it mean the MCP has superior privileges irrespective of what permissions the user using the agent has?

    My understanding was that the agent honors the permissions of the user as configured in D365FO, even while using the agent. 
    Tool_authentication.png
    Agent_authentication.png
  • André Arnaud de Calavon Profile Picture
    306,376 Super User 2026 Season 1 on at
    Hi CuriousMind,

    Have you doublechecked the permissions for the user on data entities? In case the MCP server decides to use data tools, it is not navigating through the forms via menu items.
  • CuriousMind Profile Picture
    80 on at
    @André Arnaud de Calavon Yes, I confirmed that the user has no access to data entities and menu items.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 405 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 374

#3
Martin Dráb Profile Picture

Martin Dráb 218 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans