- Copilot Studio bots — via the Dataverse API (authoritative source)
- M365 Copilot agents — via the Microsoft Graph Agent Registry (beta)
- Teams app catalog agents — via Microsoft Graph (optional, disabled by default)
What TrustLens discovers
Copilot Studio bots
M365 Copilot agents
Usage metrics
TrustLens counts conversations per bot by reading Dataverse conversation transcripts. For each bot,total_runs equals the number of transcript records linked to it.
Token counts, latency, and per-user metrics are not available for Copilot Studio bots. Microsoft does not expose this data via Dataverse or the Graph API at the individual bot level.
Required permissions
The minimum viable setup requires only the Dataverse configuration below. The Graph permission is needed only if you also want to discover M365 Copilot agents (distinct from Copilot Studio bots).Copilot Studio bots (Dataverse) — always required
Dataverse — System Customizer role (as Application User) The service principal must be registered as an Application User in your Power Platform environment and granted the System Customizer security role. This role provides read access to thebot, botcomponent, and conversationtranscript Dataverse tables that TrustLens queries.
System Administrator is not required and grants excessive permissions. System Customizer is the correct minimum role for this integration.
https://org1234567.crm4.dynamics.com
M365 Copilot agents (Graph Agent Registry) — for M365 agent discovery only
Microsoft Graph application permission —AgentInstance.Read.All
Required only to discover M365 Copilot agents via the Graph Agent Registry (beta). If you only need Copilot Studio bot discovery, you can skip this permission — the integration will still work via Dataverse.
If
AgentInstance.Read.All is not granted and the integration returns a 403 or 404 from the Graph Agent Registry endpoint, this is expected when skipping M365 agent discovery. Only Dataverse-sourced bots will appear.Optional permissions
Step-by-step setup
1
Create an app registration
- Go to Azure Portal → App registrations
- Click New registration
- Name:
neuraltrust-trustlens(or any name you prefer) - Supported account types: Single tenant (This organization only)
- Click Register
- Note the Application (client) ID and Directory (tenant) ID
- Go to Certificates & secrets → New client secret, set an expiry, and copy the value immediately
2
Add Microsoft Graph API permissions
- In the app registration, go to API permissions → Add a permission
- Select Microsoft Graph → Application permissions
- Add the following permissions:
- Click Grant admin consent for [your tenant] — a Global Administrator must approve
- Azure CLI
3
Register the service principal as a Dataverse Application User
The service principal must be added as an Application User in your Power Platform environment and granted the System Customizer security role.
- Power Platform Admin Center
- Admin API
- Go to Power Platform Admin Center
- Select Environments → click your environment → Settings → Users + permissions → Application users
- Click + New app user
- Select your app registration
- Assign the System Customizer security role
- Click Create
4
Find your Dataverse URL
- Go to Power Platform Admin Center
- Select Environments → click your environment
- Copy the Environment URL (e.g.,
https://org1234567.crm4.dynamics.com)
5
(Optional) Register as Power Platform management application
Required only if you want environment auto-discovery. This is a one-time operation that must be performed by a Global Admin or Power Platform Admin user account (not the service principal itself).Then assign the Power Platform Administrator directory role to the service principal:
- Azure CLI
- PowerShell
Directory role assignments can take up to 60 minutes to propagate.
6
Configure the integration in TrustLens
Provide the following when creating the M365 Copilot integration:
Security controls assessed
For each Copilot Studio bot, TrustLens evaluates the following security controls:Known limitations
Security considerations
- The service principal has read-only access to Dataverse and the Graph API. It cannot create, modify, or delete bots, users, or any other resources.
- The client secret should be rotated regularly. Update the integration when you rotate it.
- All credentials are encrypted at rest.
- The System Customizer role in Dataverse is the minimum required. Do not assign System Administrator as it grants unnecessary write access.
Troubleshooting
403 Forbidden on Power Platform environments endpoint
403 Forbidden on Power Platform environments endpoint
- The service principal has not been registered as a Power Platform management application (Step 5). This is required in addition to the directory role assignment.
- The Power Platform Administrator directory role assignment may not have propagated yet — wait up to 60 minutes.
- This error only affects environment auto-discovery. If you provide the Dataverse URL manually, the integration works without this role.
Copilot Studio bots not appearing
Copilot Studio bots not appearing
- Verify the Application User exists in your Dataverse environment: Power Platform Admin Center → Environment → Settings → Users + permissions → Application users.
- Verify the Application User has the System Customizer security role.
- Verify the
dataverse_urlprovided is correct and corresponds to the environment where your bots are deployed.
Usage metrics showing zero for all bots
Usage metrics showing zero for all bots
- Verify the Application User has access to the
conversationtranscriptentity — this is covered by the System Customizer role. - Bots must have actual user conversations to generate transcript records. Bots with no usage correctly show zero.
Duplicate agents appearing
Duplicate agents appearing
- If you see more agents than expected, the Dataverse connection may not be working (missing URL, inaccessible, or Application User misconfigured). Without a working Dataverse connection, TrustLens cannot filter duplicate entries from the Agent Registry.
- Verify the Dataverse URL and Application User configuration.