How do you set up data loss prevention for email in Microsoft 365?
In the Microsoft Purview portal, open Data loss prevention > Policies > Create policy, choose Enterprise applications & devices, pick a template such as U.S. Financial Data or a custom policy, and select only the Exchange email location. Run it in simulation mode first, tune the rules, then turn it on. Exchange DLP is included in Business Premium, E3 and E5.
On this page 9 sections
Most email security work is about what comes in. Data loss prevention (DLP) is about what goes out: Social Security numbers pasted into a reply, a spreadsheet of card numbers attached to the wrong thread, or patient records sent to a personal Gmail account. Microsoft 365 includes DLP for Exchange Online in its business and enterprise plans, and this guide shows how to set it up for email without breaking anyone's day.
What is data loss prevention in Microsoft 365?
Data loss prevention is a set of policies that detect sensitive information in email and files and then warn, block, encrypt or report when someone tries to share it inappropriately. In Microsoft 365 it's part of Microsoft Purview, Microsoft's compliance suite. Microsoft Learn describes it as "deep content analysis - not a simple text scan": keyword matches, regular expressions, internal function validation, supporting evidence near the match, and machine learning.
A DLP policy has three parts:
- What to look for: sensitive information types (SITs) such as Credit Card Number or U.S. Social Security Number (SSN), sensitivity labels, or trainable classifiers.
- Where to look: locations such as Exchange email, SharePoint, OneDrive, Teams and devices. This guide covers Exchange email only.
- What to do: actions such as showing a policy tip, blocking, allowing an override with justification, encrypting, or sending an incident report.
Which Microsoft 365 plans include DLP for email?
At the time of writing (November 2026), Microsoft's Purview service description lists these licenses for DLP in Exchange Online, SharePoint and OneDrive:
- Microsoft 365 E5/A5/G5/E3/A3/G3 and Microsoft 365 Business Premium
- Office 365 E5/A5/G5/E3/A3/G3
- Exchange Online Plan 2, SharePoint Online Plan 2 and OneDrive for Business (Plan 2)
- Microsoft Purview Suite and related suites
Advanced policy tips in Outlook, with extra conditions, advanced classifiers and the oversharing dialog, need Microsoft 365 E5/A5/G5 or an equivalent add-on for each scoped user. Microsoft 365 Business Basic and Business Standard aren't on the list, so check your plan before you start.
To create policies you need one of these role groups: Compliance administrator, Compliance data administrator, Information Protection, Information Protection Admin, or Security administrator (Microsoft Learn).
How is DLP different from mail flow rules and encryption?
DLP isn't the only outbound control in Microsoft 365. Use the right tool for the job.
| Tool | Best for | Detects sensitive data? | Where you manage it |
|---|---|---|---|
| Purview DLP policy | Stopping or warning about sensitive data leaving by email, with user policy tips and alerts | Yes, with sensitive information types, labels and classifiers | Microsoft Purview portal |
| Exchange mail flow rule | Routing, disclaimers, blocking forwarding, simple header or sender conditions | Not its job; DLP policies are created and managed in Purview | Exchange admin center |
| Purview Message Encryption | Protecting a message so only the recipient can read it | No, it protects whatever you encrypt | Outlook, mail flow rules or DLP actions |
| Outbound spam policy | Limiting sending and blocking automatic external forwarding | No | Microsoft Defender portal |
For the other tools, see Microsoft 365 mail flow rules for security, Purview Message Encryption and the outbound spam policy. If you're on Google Workspace instead, the equivalent is content compliance rules.
Which DLP template should you start with?
Microsoft ships predefined policy templates for common regulations. Each template contains preconfigured rules, and you can edit them. What DLP policy templates include lists them all. Common starting points for US businesses:
| Template | Use it if you handle | Example of what it looks for |
|---|---|---|
| U.S. Financial Data | Card and bank details | Credit Card Number, U.S. Bank Account Number and ABA Routing Number shared outside the organization |
| U.S. Personally Identifiable Information (PII) Data Enhanced | Employee or customer identity data | SSN, ITIN, U.S./U.K. passport numbers and U.S. physical addresses, plus HR, tax and invoice classifiers |
| U.S. Health Insurance Act (HIPAA) Enhanced | Patient health information | Identifiers such as SSN, DEA number or full names and medical terms such as ICD-9-CM or ICD-10-CM codes |
| U.S. Gramm-Leach-Bliley Act (GLBA) Enhanced | Consumer financial data at financial firms | Card, bank account, SSN, ITIN, driver's license and passport numbers, plus tax, finance and budget classifiers |
| Custom | A specific business rule | Any SITs, labels and conditions you choose |
The U.S. Financial Data template shows how templates are tuned. It has a low-count rule (1 to 9 matching items shared outside the organization) that sends a notification, and a high-count rule (10 to 500 items) that blocks access, sends a notification, allows an override with a business justification and sends an incident report.
A template is a technical starting point, not a compliance program. If you're covered by HIPAA or the GLBA Safeguards Rule, see HIPAA email security requirements or the FTC Safeguards Rule guide, and talk to your counsel or compliance advisor about what you need.
How do you create a DLP policy for Exchange email?
This procedure follows Microsoft's credit card email scenario, adapted for a common small-business goal: warn and then block when financial data is emailed outside the company. Menu names are current at the time of writing (November 2026).
- Sign in to the Microsoft Purview portal.
- Open the Data loss prevention solution and go to Policies > + Create policy.
- Select Enterprise applications & devices.
- Choose a template (for example U.S. Financial Data), or select Custom in both the Categories and Regulations lists to build your own. Select Next.
- Enter a Name and Description. Write the policy's intent in the description; you'll thank yourself later.
- On Assign admin units, keep the default to apply the policy to everyone. Select Next.
- On the locations page, select only Exchange email and deselect the others. You can include or exclude distribution groups here.
- Keep Create or customize advanced DLP rules selected, then select Create rule (or edit the template's rules).
- Under Conditions, add Content contains > Sensitive info types and pick the types, for example Credit Card Number. Add Content is shared from Microsoft 365 > with people outside my organization if you only care about external mail.
- Under Actions, add Restrict access or encrypt the content in Microsoft 365 locations. Choose to block everyone or only people outside your organization, or choose to encrypt the message.
- Turn on User notifications and Policy tips so senders learn why a message was flagged.
- Under User overrides, decide whether senders can override with a business justification. Overrides give you feedback on false positives during rollout.
- Under Incident reports, set a severity level and turn on admin alerts if you want them.
- Select Save, then Next, choose Run the policy in simulation mode, then Submit.
What does a policy tip look like to the sender?
When a message matches, Outlook shows a banner above the message before it's sent. You can write the text yourself; the rule cmdlet allows up to 256 characters, with no HTML. For example:
Example policy tip text This email appears to contain a card or bank account number and is going outside Example Co. Remove the number or send it through the secure portal. Questions? Contact IT.
How do you create the same policy with PowerShell?
DLP policies are managed in Security & Compliance PowerShell, not Exchange Online PowerShell. Connect with Connect-IPPSSession, then create the policy and rule. This example audits external email containing U.S. Social Security numbers, in simulation mode, with incident reports set to go to a compliance mailbox:
Connect-IPPSSession -UserPrincipalName admin@example.com
New-DlpCompliancePolicy -Name "Email - SSN to external" `
-ExchangeLocation All -Mode TestWithoutNotifications
New-DlpComplianceRule -Name "External SSN" `
-Policy "Email - SSN to external" `
-ContentContainsSensitiveInformation @(@{Name="U.S. Social Security Number (SSN)"; minCount="1"}) `
-AccessScope NotInOrganization `
-GenerateIncidentReport "compliance@example.com" -ReportSeverityLevel High
Watch the -Mode parameter. According to New-DlpCompliancePolicy, Enable is the default, so a policy created without -Mode enforces straight away. The values map to the portal's states:
PowerShell -Mode |
Portal policy state | What happens |
|---|---|---|
TestWithoutNotifications |
Run the policy in simulation mode | Matches are audited; no actions, no user notifications |
TestWithNotifications |
Simulation mode with policy tips | No actions, but users get policy tips and notification emails |
Enable (default) |
Turn it on right away | All configured actions are enforced |
Disable |
Keep it off | The policy is inactive |
When you're ready to block, add -BlockAccess $true to the rule with Set-DlpComplianceRule, and switch the policy with Set-DlpCompliancePolicy -Mode Enable. New-DlpComplianceRule documents every condition and action, including -NotifyPolicyTipCustomText and -NotifyAllowOverride WithJustification.
How should you roll out a DLP policy without disrupting email?
Microsoft's deployment guidance is to take an incremental approach, from simulation mode through full enforcement:
- Keep it off while you design and review the policy with the people who own the process (finance, HR, clinical staff).
- Simulation mode, broad scope. Watch matches in the DLP simulation overview and Activity explorer for a week or two.
- Tune. Raise instance counts, exclude a group that legitimately sends this data (for example payroll to your payroll provider), or refine the sensitive information types.
- Simulation mode with policy tips, scoped to a pilot group. Users see the tips but nothing is blocked. Collect their feedback.
- Turn it on, first with block with override so users can justify legitimate sends, then block once false positives are rare.
Policies generally take effect about an hour after you turn them on. DLP alerts stay in the Purview DLP alerts dashboard for 30 days and in the Microsoft Defender portal for six months.
What are the limits of DLP for email?
DLP is powerful but narrow. Know where it stops:
- It only checks new messages. Microsoft says DLP "does not scan or match previously existing email items" in a mailbox or archive.
- Some content can't be fully scanned. Password-protected attachments and attachments with a lot of extracted text may not be fully inspected. Exchange DLP has conditions for attachments that are password protected, couldn't be scanned, or didn't complete scanning (for example, extracted content over 2 MB), so you can act on those too (DLP policy reference).
- It isn't anti-phishing. DLP won't stop an attacker from emailing your staff or a compromised account from forwarding mail. Block automatic external forwarding separately, and treat unexpected outbound mail as a sign of a compromised account.
- It doesn't replace people. Someone can still describe a secret in plain words or read it out on the phone.
Inbound protection still matters, because most data theft by email starts with a phishing message that steals a login. iBlockSpam adds MX-level filtering in front of Microsoft 365 to catch phishing, spoofing and malware before it reaches the mailbox.
Next steps
- Confirm your licenses include Exchange DLP, and that the admin who will build policies has the right role group.
- Create one email policy from a template in simulation mode today, and review the matches after a week.
- Pair DLP with encryption for data that must leave: see Purview Message Encryption.
- Turn off automatic external forwarding in the outbound spam policy.
- If you want inbound phishing and spoofing filtering on top of Microsoft's, see iBlockSpam for Microsoft 365.
Frequently asked questions
Is DLP included in Microsoft 365 Business Premium?
Yes. At the time of writing (November 2026), Microsoft's Purview service description lists Microsoft 365 Business Premium among the licenses that include DLP for Exchange Online, SharePoint and OneDrive, along with Microsoft 365 and Office 365 E3 and E5 and Exchange Online Plan 2. Advanced policy tips in Outlook need E5-level licensing.
Does Microsoft Purview DLP scan emails already in a mailbox?
No. Microsoft Learn says that in Exchange, new email messages are scanned and DLP does not scan or match previously existing email items stored in a mailbox or archive. If you need to find sensitive data already sitting in mailboxes, that's a search or eDiscovery job, not a DLP policy.
How long does a new DLP policy take to start working?
Microsoft says policies generally take effect about an hour after being turned on. After you create a policy it's stored centrally and synced to Exchange, Outlook and the other locations, and the policy's sync status shows on the DLP Overview page. Send test messages only after the sync has finished.
What is DLP simulation mode in Microsoft Purview?
Simulation mode runs a DLP policy without enforcing its actions. Matches are audited so you can see what the policy would have blocked. A second option, simulation mode with policy tips, also shows users tips and sends notification emails. Microsoft recommends simulating first and tuning before you turn a policy on.
Can a DLP policy encrypt outgoing email instead of blocking it?
Yes. The Exchange actions in Purview DLP include Restrict access or encrypt the content in Microsoft 365 locations with an Encrypt email messages option that applies only to content in Exchange. It lets a message go out encrypted rather than stopping it, which suits teams that must send sensitive data to clients.
Sources
- Microsoft Learn: Learn about data loss prevention
- Microsoft Learn: Create and deploy a data loss prevention policy
- Microsoft Learn: Help prevent sharing credit card numbers through email
- Microsoft Learn: Data Loss Prevention policy reference
- Microsoft Learn: What DLP policy templates include
- Microsoft Learn: Microsoft Purview service description (DLP licensing)
- Microsoft Learn: New-DlpCompliancePolicy
- Microsoft Learn: New-DlpComplianceRule
See how your domain measures up
Run a free Email Health Check: MX, SPF, DKIM, DMARC and transport security in one scan, with the raw records shown. No sign-up.
Keep reading
How do you use Gmail content compliance rules to improve email security in Google Workspace?
Use Gmail content compliance, objectionable content and attachment compliance rules for security: expressions, actions, rule order and three worked examples.
10 min read Setup guidesHow do you encrypt email in Microsoft 365 with Purview Message Encryption?
How Purview Message Encryption works in Microsoft 365: included plans, Encrypt vs Do Not Forward, auto-encrypt rules, what recipients see, revoke and expiry.
10 min read Setup guidesHow do you configure the outbound spam policy in Microsoft 365?
Configure the Microsoft 365 outbound spam policy: recipient limits, block actions, external forwarding, custom policies per group and the PowerShell for each.
10 min read