- 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
| Data | Source |
|---|---|
| Bot name, description, status | Dataverse |
| Authentication mode | Dataverse (authenticationmode) |
| Access control policy | Dataverse (accesscontrolpolicy) |
| Topics (conversational flows) | Dataverse bot components |
| Actions (automation steps) | Dataverse bot components |
| Language | Dataverse |
| Conversation count (usage) | Dataverse conversation transcripts |
M365 Copilot agents
| Data | Source |
|---|---|
| Agent name, description | Microsoft Graph Agent Registry (beta) |
| Agent type and status | Microsoft Graph Agent Registry (beta) |
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.
| Property | Value |
|---|---|
| Permission type | Application (not delegated) |
| Admin consent required | Yes — Global Administrator or Privileged Role Administrator |
| API | Microsoft Graph (beta) |
| Graceful degradation | If missing, TrustLens skips the Agent Registry. Copilot Studio discovery continues unaffected. |
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
| Permission | Purpose | Notes |
|---|---|---|
| Power Platform Administrator (Azure AD directory role) | Enumerate all Power Platform environments automatically — removes the need to provide the Dataverse URL manually | Requires a one-time management application registration (see Step 5) |
AppCatalog.Read.All | Discover organisation-published Teams apps with bots | Disabled by default |
AiEnterpriseInteraction.Read.All | Export Copilot interaction history for usage analytics | Microsoft Graph application permission; if absent, interaction history will be unavailable |
ActivityFeed.Read (Office 365 Management API) | Read Office 365 audit logs for security event detection | Requires the https://manage.office.com/.default scope; if absent, audit log data will be unavailable |
Step-by-step setup
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
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:
| Permission | Purpose | Required |
|---|---|---|
AgentInstance.Read.All | Discover M365 Copilot agents via Agent Registry | For M365 agents only |
AppCatalog.Read.All | Discover Teams app catalog agents | Optional |
- Click Grant admin consent for [your tenant] — a Global Administrator must approve
- Azure CLI
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
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)
(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.
Configure the integration in TrustLens
Provide the following when creating the M365 Copilot integration:
| Field | Description | Where to find it |
|---|---|---|
| Tenant ID | Azure AD tenant ID | Azure Portal → Microsoft Entra ID → Overview → Directory (tenant) ID |
| Client ID | App registration client ID | App registration → Application (client) ID |
| Client Secret | App registration secret | Copied in Step 1 |
| Dataverse URL | Power Platform environment URL | Power Platform Admin Center → Environments → Environment URL |
Security controls assessed
For each Copilot Studio bot, TrustLens evaluates the following security controls:| Control | What it checks |
|---|---|
| Authentication mode | Whether the bot requires user authentication (None = unauthenticated, risk finding) |
| Access control policy | Whether the bot is restricted to specific users/groups (Any = unrestricted, risk finding) |
| External data source exposure | Number of tools and knowledge sources connected |
| High-risk tool operations | Tool names indicating dangerous operations (e.g., script execution, user management) |
| System instructions | Whether the bot has a defined system prompt |
Known limitations
| Limitation | Details |
|---|---|
| No token or latency metrics | Microsoft does not expose per-request token counts or latency for Copilot Studio bots via Dataverse or Graph. |
| Usage is all-time only | Conversation counts are aggregated across all time (period = all-time). Day, week, month, or year breakdowns are not currently available for this integration. |
| No per-topic usage | Which topics or actions were invoked per conversation is not available via the Dataverse API. |
| Graph Agent Registry is in beta | The AgentInstance.Read.All permission and the /beta/agentRegistry endpoint are subject to change by Microsoft. |
| M365 Copilot licenses required | The Graph Agent Registry endpoint requires M365 Copilot licenses to be active in the tenant. |
| Copilot Admin Catalog unavailable | The /beta/copilot/admin/catalog/packages endpoint currently returns 403 regardless of permissions. TrustLens does not use this endpoint. |
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.
401 Unauthorized on Dataverse API
401 Unauthorized on Dataverse API
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.