Sensitive information types are great at patterns such as card numbers, but contracts, source code, HR files and financial statements have no pattern to match. Trainable classifiers recognize content by what it is instead. In this post I'll show how to start with Microsoft's built-in classifiers, train a custom one, use classifiers in DLP, labels and retention, and use content explorer to see where classified content lives, including the permissions it needs.
How it works#
- Pretrained classifiers. Microsoft ships dozens with the status Ready to use, such as Agreements, Financial statement, Invoice, Human resources, Healthcare, Legal affairs, Intellectual property, Resume, Source code and Tax documents, plus communication-focused ones such as Harassment, Profanity and Threat. Most evaluate English only; the offensive-language classifiers support several languages. Trainable classifier definitions lists every classifier with its file types and languages.
- Custom classifiers. You give Purview a set of items that definitely belong in a category and a set that definitely doesn't. It builds a model, you review its predictions, and then you publish it. Custom classifiers support English only.
- Where you use them. As a condition in DLP policies, sensitivity label auto-labeling and retention label auto-apply policies. Communication compliance accepts only Microsoft's classifiers. Classifiers only work on items that aren't encrypted.
- Content explorer. It shows a snapshot of items that have a sensitivity label or retention label, or match a sensitive information type or trainable classifier, by location: Exchange, SharePoint, OneDrive and Teams. The data classification overview summarizes those numbers; content explorer lets you drill down to the item.
Prerequisites#
- To create classifiers: Compliance Administrator or Security Administrator access, and access to the SharePoint folders that hold your seed content.
- To open the content explorer page: the Compliance Administrator, Security Administrator or Compliance Data Administrator role in Microsoft Entra ID, or one of the Information Protection role groups (Information Protection, Information Protection Admins, Analysts, Investigators or Readers).
- To see items: membership in Content Explorer List Viewer (items and their locations) and/or Content Explorer Content Viewer (item contents, and also the item names in list view, since names can be sensitive). The two role groups are independent, not cumulative, and both respect administrative units. See Purview roles and role groups.
- Labels in SharePoint and OneDrive: enable sensitivity labels for files in SharePoint and OneDrive, or that data won't surface in data classification.
- Licensing: check the Microsoft 365 service descriptions for your plan.
Step-by-step#
1. Try a built-in classifier first#
In the Microsoft Purview portal, go to Data loss prevention › Data classification › Classifiers and open the Trainable classifiers tab. If a pretrained classifier matches what you want to protect, use it in a DLP policy in simulation mode before training anything yourself; see from simulation mode to enforcement. Note that Source code only fires when most of the text is code, not when snippets sit inside a document.
2. Prepare seed content for a custom classifier#
- Collect 50 to 500 positive items that clearly belong in the category, and 150 to 1,500 negative items that clearly don't. Include negatives that look similar but don't belong (other contracts, other meeting notes) so the model learns the difference.
- Use text-based files only. Image files and image-only PDFs aren't supported.
- Put positives and negatives in separate folders that hold nothing else, on a communication site or another SharePoint site type, not in a Teams folder or OneDrive. Note the site, library and folder URL of each.
- If you just created the site or folder, wait at least an hour for it to be indexed.
3. Create, train and publish#
- On the Trainable classifiers tab, select Create trainable classifier.
- Add the site, library and folder of the positive examples, then the negative examples, review and create.
- Within 24 hours, Purview processes the seed data and builds a prediction model.
- Review the predictions. If accuracy is weak, add better or more seed data and restart training; that's only possible before you publish.
- Publish the classifier. Retraining a published classifier isn't supported: to improve it later, remove it and start over with larger sample sets.
4. Use the classifier in policies#
- DLP: add the classifier to a rule's content conditions alongside, or instead of, sensitive information types. Design guidance is in designing Purview DLP policies.
- Sensitivity labels: use it as an auto-labeling condition in the label, so Office apps recommend or apply the label; see rolling out sensitivity labels.
- Retention labels: auto-apply a retention label to content the classifier matches; see records management in Purview.
5. Find the content in content explorer#
- Go to Solutions › Data Lifecycle Management › Explorers › Content explorer. Microsoft's documentation now calls this view content explorer (classic).
- Type a classifier, label or sensitive information type name in the filter box, or expand Trainable classifiers and select one.
- Pick a location and drill down through the folder structure. In Exchange and Teams, filter by a full mailbox address; in SharePoint and OneDrive, by site name, folder or file name.
- Double-click an item to open it in content explorer. Encrypted documents can't be previewed and downloads are disabled.
- Use Export to save the current pane as a .csv file, and save the filters you use often as a view.
For sensitive information types and classifiers, you can mark an item as Match or Not a Match and use that feedback to improve classifier accuracy.
Verify#
- Built-in classifiers show Ready to use, and your custom classifier is published.
- Test with documents that weren't in the seed set: a few you expect to match and a few near-misses. Your DLP simulation should flag the first group only.
- Content explorer shows counts for the classifier in the locations you expect. Allow up to seven days for counts to update, and up to 14 days for SharePoint files.
- When a label or DLP policy acts on the classifier, the events appear in activity explorer; see investigating DLP alerts and activity explorer.
Tips & gotchas#
- Encrypted items are invisible to classifiers. Content that's already encrypted won't match a classifier condition in DLP or auto-labeling.
- Labels that apply encryption don't surface in content explorer for SharePoint and OneDrive.
- Classifier counts in content explorer (preview) for SharePoint and Teams appear without any labeling policy. Opting out takes a Microsoft Support request, and if scanning is turned off, labels and DLP policies that use those classifiers stop working.
- Combine methods. Classifiers complement, rather than replace, custom sensitive information types and exact data match. For on-premises file shares, use the information protection scanner.
- Content explorer is powerful access. Content Viewer lets someone read files they have no permission to open in SharePoint, so assign it to as few people as possible.

