Auto-labeling policies label content where it lives: files at rest in SharePoint and OneDrive, and email while Exchange Online sends or receives it. They don't depend on anyone's app version, but they also act without anyone's confirmation, so a careless rule can label, or encrypt, a lot of content fast. This post goes beyond the basics in rolling out sensitivity labels: how simulation really behaves, what a policy may overwrite, the limits, and how to monitor results.
Errors this guide fixes
No matching database is available.Purview portal (saving auto-labeling policy)
How it works#
Purview has two automatic labeling methods, and they complement each other:
| Behavior | Label setting (Office apps) | Auto-labeling policy (service-side) |
|---|---|---|
| Depends on app version | Yes | No |
| Recommend a label, user decides | Yes | No |
| Simulation mode | No | Yes |
| Locations, exceptions, nested AND/OR/NOT rules | No | Yes |
| PDF files | No | Yes |
| Check Exchange attachments, label incoming email | No | Yes |
| Replace a manual, lower-priority label | No | Configurable |
| Visual markings | Yes | Email only |
For Exchange, a policy labels mail in transit, never mail already in mailboxes. For SharePoint and OneDrive, it labels supported files at rest (.docx, .xlsx, .pptx and, once PDF support is enabled, PDFs), whether they existed before the policy or not.
Prerequisites#
- An E5-tier license such as Microsoft 365 E5 or E5 Compliance. E3 and Business Premium include manual labeling but not auto-labeling; check Microsoft's licensing guidance for your plan.
- Auditing turned on (simulation depends on it), sensitivity labels enabled for Office files in SharePoint and OneDrive, and PDF support enabled if you want PDFs labeled. Without it, PDFs are skipped unevaluated.
- A label that isn't a parent label, scoped to Files & other data assets and/or Emails as needed. For SharePoint or OneDrive, an encrypting label must use Assign permissions now with User access to content expires set to Never.
- Compliance Administrator or Compliance Data Administrator to turn a policy on, and the Data Classification Content Viewer role to preview matched content.
Microsoft warns that missing any of these typically leaves a policy running without labeling anything, and without an error.
Step-by-step#
1. Start narrow#
In the Microsoft Purview portal, go to Solutions › Information Protection › Policies › Auto-labeling policies, select + Create auto-labeling policy and choose to apply a label. Start from a template or a custom policy and target one SharePoint site instead of All; a site must be indexed before you can add it. Sensitive information types only evaluate content created or modified after the type was created or last changed, so run on-demand classification for older files.
PowerShell does the same and makes the scope explicit; add the conditions afterwards with New-AutoSensitivityLabelRule:
Connect-IPPSSession
New-AutoSensitivityLabelPolicy -Name "Finance pilot" `
-SharePointLocation "https://contoso.sharepoint.com/sites/Finance" `
-ApplySensitivityLabel "Finance Confidential" -Mode TestWithoutNotificationsTestWithoutNotifications simulates silently, TestWithNotifications simulates and sends notifications, and Enable labels for real.
2. Run and read the simulation#
- A policy can't label anything until it has run at least one simulation. Allow about 12 hours; a notification goes to the account configured for activity alerts.
- Open the policy and select Summary › View details. The matched count is an estimate from sampling, at most 100 items per site are displayed, and CSV exports stop at 50,000 records.
- With more than 20,000,000 matched files, the policy can't be turned on; narrow it and rerun.
- Simulation still fires alert policies on matching activity, so scope or pause them for the run.
- Exchange simulation only sees mail sent and received during the run, so results differ between runs.
3. Tune, then widen#
Cut false positives with higher instance counts or confidence, exceptions, or by excluding noisy sites, and rerun after every change. Then widen in steps: more sites, OneDrive, then Exchange. Avoid a scheduled turn-on date until you trust the results, because it turns the policy on without waiting for your review.
4. Decide what may be overwritten#
| Existing label | Replaced by the policy? |
|---|---|
| Manual, lower priority | No by default; configurable on Additional label settings |
| Manual, higher priority | No |
| Automatic or default label, lower priority | Yes |
| Automatic or default label, higher priority | No |
A policy that applies labels never leaves content unlabeled; only a label-removal policy for SharePoint and OneDrive does, and it removes manual labels too. Simulation shows one policy at a time, so conflicts resolve only when all policies run: if one policy may replace manual labels and another may not, the label stays; if one removes a label while another applies one, applying wins.
5. Mind the Exchange specifics#
- Office and PDF attachments are scanned, but the email gets the label. With an encrypting label, unencrypted Office attachments inherit the encryption.
- Incoming external email is labeled only when the Exchange location is All with nothing excluded, and it's encrypted only if you set a Rights Management owner (
-ExternalMailRightsManagementOwner). - When the label encrypts, IRM settings from mail flow rules or DLP policies are ignored for that message.
- Don't use these policies to send encrypted mass mailings; Microsoft warns of send failures and NDRs.
6. Turn it on and monitor#
When the simulation is in an eligible state and the matches look right, select Turn on policy. The policy's Insights tab then shows files labeled to date, labeled versus failed files over 30 days, the top failure reasons, the most frequent sensitive info types and a per-source breakdown. For an Exchange-only policy, review email labeling in activity explorer.
Verify#
Get-AutoSensitivityLabelPolicy | Format-Table Name, Mode- Live policies show
Modeas Enable; pilots show TestWithoutNotifications or TestWithNotifications. - Matched files show the label in the library's Sensitivity column, while Modified and Modified By keep their values. With an encrypting label, the last person who modified the file becomes its Rights Management issuer and owner.
- The Insights tab's failed count is low and every failure reason is understood.
Tips & gotchas#
- Limits: up to 500,000 automatically labeled files per tenant per day (raised from 100,000; the increase is rolling out worldwide during October 2026, so check your tenant) and 100 policies per tenant. In the portal, a policy can list up to 1,000 SharePoint sites or 100 OneDrive users or groups (All is exempt); adaptive scopes in PowerShell reach 50,000 sites.
- Skipped files: open or checked-out files, libraries that require checkout, list item attachments and detached OneDrive accounts.
- No visual markings on documents; users get them by reapplying the label in Office.
No matching database is available.when saving a new policy is a known transient backend condition. Retry, and open a support case if it keeps failing for 24 hours.- A duplicated policy starts in simulation, even when the source is on.
- Target large estates with adaptive scopes, and see where labeled content lives with content explorer.

