SharePoint DLP: How Microsoft Purview Data Loss Prevention Works
SharePoint DLP is Microsoft Purview data loss prevention applied to SharePoint sites. A DLP policy scans files for sensitive information, sensitivity labels or retention labels, and when a file matches it can warn the user with a policy tip, block sharing with people outside the organization, or restrict access to the owner, last modifier and site admin. Policies are built in the Microsoft Purview portal and should be tested in simulation mode first.
Published:
Last updated: 2026-12-02
What is DLP in SharePoint?
Data loss prevention (DLP) is the part of Microsoft Purview that detects sensitive content and acts when it is at risk of leaving where it belongs. SharePoint sites and OneDrive accounts are two of the locations a policy can cover, alongside Exchange email, Teams messages, devices and others.
DLP does not replace permissions. It reacts to what a file contains, while SharePoint permissions control who can open it. A file with no sensitive content that is shared with everyone is invisible to DLP, which is why you still need an oversharing report.
How does a SharePoint DLP policy work?
Each policy has a location, one or more rules, and a mode.
| Part | What you choose | SharePoint example |
|---|---|---|
| Location | Which sites the policy covers | All SharePoint sites, or only the Finance and HR sites |
| Conditions | What makes a file match | Content contains credit card numbers; content has the Confidential sensitivity label; content is shared with people outside the organization |
| Actions | What happens on a match | Block only people outside the organization, or block everyone except the owner, last modifier and site admin |
| User notifications | Whether the user is told | A policy tip on the file, and an email to the person who shared it |
| Overrides | Whether the user can proceed | Allow an override with a business justification, which is recorded |
| Alerts and incident reports | Who in IT or compliance is told | An alert to the compliance team when a high-volume match occurs |
A "sensitive information type" is a pattern Microsoft Purview recognizes, such as a credit card number, bank account number or national ID. Purview ships with many built-in types for different countries and regions, and you can create your own.
How do you create a DLP policy for SharePoint?
- Open the Microsoft Purview portal and go to Data Loss Prevention, then Policies, then Create policy.
- Start from a template (Financial, Medical and health, or Privacy, for your country or region) or choose Custom.
- Name the policy so its purpose is obvious, for example "SharePoint: block external sharing of financial data".
- Under locations, turn on SharePoint sites and choose all sites or specific ones. Add OneDrive accounts if you want the same rule there.
- Create a rule. Add the condition Content contains and pick sensitive information types or a sensitivity label. Add Content is shared from Microsoft 365 with people outside the organization if you only want to act on external sharing.
- Add the action Restrict access or encrypt the content in Microsoft 365 locations, then choose to block only people outside the organization or to block everyone.
- Turn on user notifications and policy tips, and decide whether users may override with a justification.
- Choose Run the policy in simulation mode, review the matches, tune the rule, then turn the policy on.
What do users see when DLP matches a file?
- A policy tip. The file shows a warning that it contains sensitive information and explains what is restricted.
- Blocked sharing. If the action blocks external people, existing external access stops working and new external sharing is prevented.
- Restricted access. If the action blocks everyone, only the content owner, the last modifier and the site admin can still open the file.
- An override option, if you allowed one. The justification the user types is recorded.
All DLP-monitored activity is written to the Microsoft 365 audit log and shown in Activity explorer, so you can review matches and overrides later. See searching the SharePoint audit log.
What should you test in simulation mode?
Simulation mode shows what a policy would match without enforcing it. Microsoft recommends planning policies, deploying them in simulation mode and evaluating the impact before running them in more restrictive modes. Use it to check:
- False positives. Order numbers and product codes can look like card or ID numbers. Raise the instance count or confidence level if matches are noisy.
- Volume per site. A site with thousands of matches needs a conversation with its owner before you block anything.
- Who would be affected. Blocking everyone on a busy team's files stops their work.
- Large files. Purview scans the first 2 million characters of extractable text in a file, so sensitive content beyond that point is not evaluated.
What does SharePoint DLP not catch?
| Gap | Why | How to cover it |
|---|---|---|
| Overshared files with no sensitive pattern | DLP matches content, not audience. A salary plan written in prose may match nothing. | Report content open to everyone and organization-wide links |
| Who currently has access | DLP acts on matches; it does not list permissions | Permissions and sharing links reports |
| Files that cannot be scanned | Encrypted files are only processed when labels for files in SharePoint and OneDrive are enabled | Enable sensitivity labels for files; see SharePoint sensitivity labels |
| Existing Anyone links on harmless-looking files | No sensitive information type is present | Remove anonymous sharing links in bulk |
The two controls work best together: fix the sharing first so DLP has less to block, then let DLP catch the sensitive files that slip through.
SharePoint Essentials Toolkit reports sites and content open to everyone, sharing links with their type and expiry, external users, and unlabeled files that are widely shared. Ranger365 (beta) watches the same risks continuously in SharePoint Online.
Which starter DLP policies make sense for SharePoint?
- Financial data shared externally: content contains credit card or bank account numbers and is shared outside the organization. Block external people, show a policy tip, allow override with justification.
- Personal data shared externally: the privacy template for your country or region, with the same actions.
- Highly Confidential label shared externally: content has your top sensitivity label and is shared outside the organization. Block external people with no override.
Start all three in simulation mode on a few sites, then widen the scope.
Frequently asked questions
Does SharePoint have built-in DLP?
Yes, through Microsoft Purview. DLP policies are created in the Microsoft Purview portal and can include SharePoint sites and OneDrive accounts as locations.
Can DLP block external sharing of a SharePoint file?
Yes. A rule can restrict access so that only people outside your organization are blocked, while people inside keep access. It can also block everyone except the content owner, last modifier and site admin.
Can a DLP policy use sensitivity labels?
Yes. A rule's "Content contains" condition can match sensitivity labels and retention labels as well as sensitive information types, so you can act on files labeled Confidential.
Will DLP find overshared files?
Only those that match a rule. DLP evaluates content, so an overshared file with no sensitive pattern or label is not flagged. Use a sharing and permissions report to find oversharing.
Where can I see DLP matches?
DLP activity is recorded in the Microsoft 365 audit log and routed to Activity explorer in the Purview portal. Alerts can also notify your compliance team.
Microsoft sources
This article is part of our Microsoft Purview for SharePoint guide.
Find the oversharing DLP does not see, free
SharePoint Essentials Toolkit Community Edition is free on up to 20 sites per Microsoft 365 tenant. Report content open to everyone, sharing links and external users, then remove links or reset permissions. Get your free Community Edition license key.