The Microsoft Purview DLP detector sends each turn to your Microsoft Purview tenant and lets your Purview DLP policies decide. TrustGuard says who the end user is and what the turn contains; Purview evaluates it against the policies you already manage. Nothing is configured in TrustGuard about what is sensitive — that lives in Purview.
How it works
TrustGuard calls the Microsoft Graph Purview APIs for AI as one Entra app in your tenant. That app is also the protected app your DLP policy targets.- TrustGuard asks Purview which policies cover the end user for that app
(
protectionScopes/compute). The answer is cached for an hour. - If a policy covers the user, TrustGuard sends the new turn — never the conversation
history — to
processContentand waits for the verdict. - If Purview returns a block, the detector raises a finding and your TrustGuard policy rule applies its action.
Before you start
You need:- Global Administrator (or Privileged Role Administrator) in your Entra tenant, to grant admin consent to Microsoft Graph application permissions.
- Owner or Contributor on an Azure subscription in the same tenant, for Purview pay-as-you-go billing. Reader is not enough.
- Compliance Administrator (or equivalent) in Purview, to create the DLP policy.
- The Exchange Online PowerShell module, to create the policy (the Purview portal cannot target Entra-registered apps yet).
1. Register the app in Entra
1
Create the app registration
In the Microsoft Entra admin center go to
App registrations → New registration.
- Name: anything, for example
NeuralTrust DLP. - Supported account types: Accounts in this organizational directory only (single tenant).
- Redirect URI: leave empty.
2
Create a client secret
Certificates & secrets → New client secret. Copy the Value column right away
— Entra shows it only once. The Secret ID is not the secret.
2. Grant Microsoft Graph permissions
In the app registration open API permissions → Add a permission → Microsoft Graph → Application permissions and add:
Then click Grant admin consent for <your organization>. Every row must show
Type: Application and a green Granted status.
3. Licensing
Purview only processes content for users whose tenant has a Purview data security license. The end users whose traffic TrustGuard evaluates need one of:- Microsoft 365 E5 (or A5 / G5), or
- Microsoft 365 E3 plus the Microsoft Purview Suite add-on (formerly Microsoft 365 E5 Compliance).
403 with code InsufficientServicePlans and the detector
reports license_required. This is not a permissions problem: adding permissions does
not fix it.
Microsoft is changing how Purview protections for Entra-registered AI apps are
licensed (see the Purview service description, which mentions Microsoft 365 E7 and
Agent 365). Check the current requirements with your Microsoft account team.
4. Pay-as-you-go billing
Purview protections for AI apps other than Microsoft 365 Copilot are billed pay-as-you-go, on top of the license.- In the Azure portal, make sure you are Owner or Contributor on the subscription (Subscriptions → your subscription → Access control (IAM) → View my access) and create a resource group for the billing resource.
- In the Microsoft Purview portal go to Settings → Account and link the Azure subscription and resource group under Azure resource links (pay-as-you-go billing). The resource must show Active.
402 and the detector reports
payment_required.
5. Create the DLP policy for the app
The Purview portal cannot target an Entra-registered app yet, so create the policy in PowerShell.Location is the Application (client) ID from step 1.
-Mode Enableenforces the policy. A policy in simulation never blocks.- Swap
Credit Card Numberfor the sensitive information types you care about. - Policies you created in the Purview portal for other locations (Exchange, Endpoint,
Edge…) do not apply to the app. Check a policy targets it with
Get-DlpCompliancePolicy | Format-List Name, Mode, EnforcementPlanes, *Location*. - Wait until the policy shows Sync completed. TrustGuard caches policy scopes for an hour, so a change can take up to an hour to show.
6. Create the detector in TrustGuard
Open Detectors → Catalog → Microsoft Purview DLP and fill in the Configuration tab:
When you save, TrustGuard asks Entra for a token with these credentials and refuses the
save with Entra’s error if they are wrong (
AADSTS7000215 wrong secret,
AADSTS700016 unknown app). The secret is stored encrypted and never shown again.
Then reference the detector from a policy rule on
Input with Monitor or Block.
End-user identity
Purview applies the policies of the user whose identity TrustGuard sends, so TrustGuard only uses an identity it can vouch for — never one a caller simply claims.
For
/v1/evaluate, set trusted_identity: "true" on the collector only if your
application authenticates its end users, and send:
User.ReadBasic.All. Users must belong to the detector’s
tenant.
The console’s Test tab tests as the user named in Extra parameters
(attributes.user.id or attributes.user.email) or, if none, as you.
Check the setup
- Run a policy Test with a prompt containing a test card number such as
4111 1111 1111 1111. - With the policy from step 5, the finding should come from Purview with a block.
Troubleshooting
To confirm what Graph itself answers, call it with the app’s credentials: get a token
from
https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token (client
credentials, scope https://graph.microsoft.com/.default), check that its roles claim
lists the permissions from step 2, and call
POST https://graph.microsoft.com/v1.0/users/<object-id>/dataSecurityAndGovernance/protectionScopes/compute.
A 200 means Entra, licensing and billing are in place.