PurviewDeep dive

Designing Purview DLP policies: locations, rules, conditions, actions and priority

How a Purview DLP policy is built, how rule and policy priority decide which action wins, and a starter set of policies you can simulate and tune.

Many "DLP isn't working" tickets are design problems: a policy scoped to the wrong group, locations that quietly limit the available conditions, or a rule that never acts because another one wins. In this post I'll take a Microsoft Purview data loss prevention (DLP) policy apart layer by layer, explain how rule and policy priority decide the outcome, and finish with a starter set you can put into simulation.

How this guide is organized: How it works → How priority decides which rule wins → Step-by-step → Verify → Tips and gotchasFlow diagram of the article's sections in reading order: 1. How it works. 2. How priority decides which rule wins. 3. Step-by-step (5 steps: Review the default policies; Templates for regulated data, custom for your own; One purpose per policy; Two tiers of rules; Simulate, then review the order). 4. Verify. 5. Tips and gotchas. Toolbox: Set-DlpCompliancePolicy, Policies › Create policy, ExceptIf, ExceptIfRecipientDomainIs, BlockAccess.1How it works2How prioritydecides which…3Step-by-step4Verify5Tips andgotchas1Review the defaultpolicies2Templates forregulated data, cu…3One purpose perpolicy4Two tiers of rules5Simulate, thenreview the orderTOOLBOXSet-DlpCompliancePolicyPolicies › Create policyExceptIfExceptIfRecipientDomainIsBlockAccessHow this guide is organized: How it works → How priority decides which rule wins → Step-by-step → Verify → Tips and gotchasFlow diagram of the article's sections in reading order: 1. How it works. 2. How priority decides which rule wins. 3. Step-by-step (5 steps: Review the default policies; Templates for regulated data, custom for your own; One purpose per policy; Two tiers of rules; Simulate, then review the order). 4. Verify. 5. Tips and gotchas. Toolbox: Set-DlpCompliancePolicy, Policies › Create policy, ExceptIf, ExceptIfRecipientDomainIs, BlockAccess.1How it works2How priority decides which rule wins3Step-by-step1Review the default policies2Templates for regulated data, custom for yourown3One purpose per policy4Two tiers of rules5Simulate, then review the order4Verify5Tips and gotchasTOOLBOXSet-DlpCompliancePolicyPolicies › Create policyExceptIfExceptIfRecipientDomainIsBlockAccess
At a glance: how this guide is organized · 5 steps · 5 key settings and tools

How it works: the anatomy of a DLP policy#

Designing a DLP policy, from what to protect to enforcementStep 1: Choose what to protect. A template, or your own SITs, labels or trainable classifiers Step 2: Choose locations and scope. Each location scopes differently; on devices, user and device must both be in scope Step 3: Check which conditions remain. Combined locations offer only shared conditions; Teams supports only SITs Step 4: Write the rules. Conditions, exceptions, actions, notifications, overrides and incident reports Step 5: Set rule and policy priority. The first evaluated rule with the most restrictive action is enforced; devices differ Step 6: Simulate, then turn the policy on. Review matches and the rule order in simulation before you enforce1Choose what to protectA template, or your own SITs, labelsor trainable classifiers2Choose locations and scopeEach location scopes differently; ondevices, user and device must bothbe in scope3Check which conditionsremainCombined locations offer onlyshared conditions; Teams supportsonly SITs4Write the rulesConditions, exceptions, actions,notifications, overrides and incidentreports5Set rule and policy priorityThe first evaluated rule with themost restrictive action is enforced;devices differ6Simulate, then turn the policyonReview matches and the rule orderin simulation before you enforceDesigning a DLP policy, from what to protect to enforcementStep 1: Choose what to protect. A template, or your own SITs, labels or trainable classifiers Step 2: Choose locations and scope. Each location scopes differently; on devices, user and device must both be in scope Step 3: Check which conditions remain. Combined locations offer only shared conditions; Teams supports only SITs Step 4: Write the rules. Conditions, exceptions, actions, notifications, overrides and incident reports Step 5: Set rule and policy priority. The first evaluated rule with the most restrictive action is enforced; devices differ Step 6: Simulate, then turn the policy on. Review matches and the rule order in simulation before you enforce1Choose what to protectA template, or your own SITs, labels or trainableclassifiers2Choose locations and scopeEach location scopes differently; on devices, user anddevice must both be in scope3Check which conditions remainCombined locations offer only shared conditions; Teamssupports only SITs4Write the rulesConditions, exceptions, actions, notifications, overridesand incident reports5Set rule and policy priorityThe first evaluated rule with the most restrictive actionis enforced; devices differ6Simulate, then turn the policy onReview matches and the rule order in simulation beforeyou enforce
Figure 1 · Process Designing a DLP policy, from what to protect to enforcement. Answer the policy's questions in this order: the locations limit the conditions you can use, and priority decides which rule acts.

A policy answers four questions: what to protect (a template or your own definitions), where to look (locations and their scope), what to do on a match (rules) and how hard to enforce (simulation or on). You build it in the Microsoft Purview portal under Solutions › Data loss prevention › Policies › Create policy.

Locations and scope#

The main locations are Exchange email, SharePoint sites, OneDrive accounts, Teams chat and channel messages, Devices, cloud app instances, on-premises repositories, and Fabric and Power BI workspaces. Newer locations such as Microsoft 365 Copilot and managed or unmanaged cloud apps are only offered in the Custom template. Each location scopes differently:

  • Exchange: scoped by group membership and effectively by sender. Microsoft's scoping table shows that mail from an out-of-scope sender isn't evaluated even when the recipient is in scope. An exclusion beats an inclusion, and a policy holds at most 50 group inclusions and exclusions.
  • OneDrive: up to 100 individual users or 50 groups. Mix users and groups and DLP applies the policy only to the intersection, so put stray users into a group of their own.
  • SharePoint: up to 100 sites, or the sites in an administrative unit.
  • Devices: the user and the device must both be in scope, otherwise nothing is enforced.

Combining locations narrows what a policy can use. Only the conditions the chosen locations share are offered, and for content definitions a "no" in any location wins: Teams supports only sensitive information types (SITs), so a policy covering SharePoint and Teams can't match on sensitivity or retention labels, while the Copilot location works only with sensitivity labels.

Rules: conditions, exceptions, actions and the rest#

  • Conditions start with Content contains: SITs, sensitivity labels, retention labels or trainable classifiers, grouped with Any of these or All of these. SITs carry a confidence level and instance counts. Location-specific context narrows the match; for email that includes recipient domain, sender group, headers, password-protected attachments and Content is shared from Microsoft 365 with people outside the organization.
  • Exceptions use the same building blocks (the ExceptIf parameters in PowerShell, such as ExceptIfRecipientDomainIs).
  • Actions depend on the location. For email, Restrict access or encrypt the content in Microsoft 365 locations (BlockAccess) blocks everyone or only external recipients, or encrypts; other actions deliver to the hosted quarantine, forward for approval, redirect, add recipients, prepend the subject, apply a disclaimer or set a header. Devices get Audit, Block with override or Block per activity.
  • User notifications and overrides drive policy tips and notification emails, and decide whether users can override a block, with or without a business justification.
  • Incident reports set the severity and whether an alert fires on every match or only when a volume threshold is reached.
  • Additional options set the rule's priority and can stop further rules and policies from being processed after a match.

How priority decides which rule wins#

For Exchange, SharePoint and OneDrive, rules get their priority in the order they're created and are evaluated in that order. When an item matches several rules, the first evaluated rule with the most restrictive action is enforced. Microsoft's example:

RuleActionsWhen all four match
Rule 1Notify onlyEvaluated and logged, not applied
Rule 2Notify, restrict access, allow overrideEvaluated and logged, not applied
Rule 3Notify, restrict access, no overrideEnforced
Rule 4Restrict accessEvaluated and logged, not applied

So reports show more matches than enforced actions, and a notify-only rule at the top doesn't shield content from a stricter rule below it. Policies have their own priority too: 0 is the highest, no two policies share a value, and moving one shifts the others down (Set-DlpCompliancePolicy -Priority).

Devices work differently: endpoint DLP applies the sum of the most restrictive actions per activity across matching policies, so a policy blocking printing plus one blocking USB copies gives both blocks. Policies that are turned on take precedence over policies in simulation, and "no override" beats "allow override".

Step-by-step: a sensible starter set#

1. Review the default policies#

Every tenant gets four default policies: one for credit card numbers in externally shared documents and email, one for Teams, one for devices (audit only, with alerts but no policy tips) and one for the Microsoft 365 Copilot location. Keep, edit or replace them so you don't double up alerts.

2. Templates for regulated data, custom for your own#

Financial, Medical and health, and Privacy templates map regulations to SITs. For account numbers, project codes or customer lists, build a custom sensitive information type or use exact data match.

3. One purpose per policy#

A practical split: email and files shared externally (Exchange, SharePoint, OneDrive), Teams messages, device egress, and labeled content in Copilot (see DLP for Microsoft 365 Copilot). Separate policies keep every condition available.

4. Two tiers of rules#

A low-volume rule that notifies, and a high-volume rule that blocks with override and asks for a justification. Add exceptions, such as a partner domain, only after the data owner agrees.

5. Simulate, then review the order#

Run the policy in simulation (walked through in from simulation mode to enforcement), then confirm the priorities from Security & Compliance PowerShell:

PowerShell
Connect-IPPSSession
Get-DlpCompliancePolicy | Sort-Object Priority | Format-Table Name,Priority,Mode
Get-DlpComplianceRule -Policy "DLP - Customer data" | Sort-Object Priority |
  Format-Table Name,Priority,Disabled,BlockAccess

Verify#

  • Send dummy test data that should hit only the low tier, then enough to hit the high tier: the first shows a tip, the second is blocked with an override option.
  • The audit log and DLP reports record a match for every rule that matched, including the ones whose actions weren't applied.
  • Mode shows Enable for live policies and TestWithNotifications or TestWithoutNotifications for simulations.
  • Email results are covered in email blocked by Purview DLP, and alerts in investigating DLP alerts.

Tips and gotchas#

  • Limits: 600 DLP rules per tenant, 64-character policy and rule names, and 100 KB per policy. DLP scans the first 2 million characters of extractable text and three nesting levels; beyond that it emits a "Document didn't complete scanning" signal, which you can catch with the Any email attachment's content didn't complete scanning condition.
  • Simulation on devices: with policy tips shown in simulation, a device Block action runs as Block with override, so tell pilot users.
  • Noise: tune confidence and instance counts before adding exceptions; see tuning DLP false positives.

References#

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

M365 Subject Matter Expert, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)