An enterprise guide to sensitive data classification, custom detection patterns, regular expressions, confidence levels and Exact Data Match in Microsoft Purview.
Introduction
Data protection begins with understanding what information an organization needs to protect.
Microsoft Purview provides Sensitive Information Types (SITs) to identify sensitive content across supported Microsoft 365 workloads and other integrated environments.
Organizations commonly use SITs to detect:
- Personal identification information
- Financial and banking information
- Credit card numbers
- Employee identifiers
- Customer account numbers
- Healthcare-related information
- Business-specific reference numbers
- Confidential records and regulated data
However, selecting the correct detection method is one of the most important decisions in a Microsoft Purview deployment.
Should an organization use a built-in Sensitive Information Type?
Should it create a custom SIT using regular expressions?
Or should it implement Exact Data Match to identify information belonging to actual customers or employees?
These approaches solve different problems.
In this article, I explain how each detection method works, when to use it, how to implement it and how to avoid common classification mistakes.
1. What Are Sensitive Information Types in Microsoft Purview?
A Sensitive Information Type is a classification mechanism that identifies content matching predefined or custom detection criteria.
Microsoft Purview uses SITs in supported features such as:
- Data Loss Prevention (DLP)
- Information Protection
- Data classification and discovery
- Auto-labeling policies
- eDiscovery scenarios
A SIT is not itself a DLP policy or a sensitivity label.
It identifies information. Other Microsoft Purview capabilities use the classification result to take action.
For example:
Document containing sensitive information → SIT detection → DLP policy evaluation → Alert or restriction
The detection logic and the enforcement logic are separate components.
This distinction is important when troubleshooting policies that do not behave as expected.
2. Understanding the Three Detection Approaches
Microsoft Purview supports several methods for identifying sensitive content.
Three important approaches are built-in SITs, custom SITs and Exact Data Match.
| Capability | Built-in SIT | Custom SIT | Exact Data Match |
|---|---|---|---|
| Detection method | Microsoft-defined patterns | Organization-defined patterns | Matches against an organization’s reference dataset |
| Configuration effort | Low | Medium | High |
| Regex customization | Generally predefined | Yes | Can use a SIT as the primary classifier |
| Supporting keywords | Preconfigured | Customizable | Supported through EDM configuration |
| Confidence levels | Yes | Yes | Yes |
| Requires reference data | No | No | Yes |
| Typical use | Credit cards and national identifiers | Employee IDs and business document numbers | Actual customer or employee records |
| Maintenance | Primarily Microsoft-managed | Organization-managed | Organization-managed patterns and reference data |
Architecture recommendation: Start with built-in SITs where appropriate. Introduce custom SITs when business-specific formats are required. Use EDM when identifying values belonging to an authoritative dataset is necessary.
3. Built-in Sensitive Information Types
Microsoft provides a collection of predefined Sensitive Information Types.
Examples include:
- Credit Card Number
- U.S. Social Security Number
- International Bank Account Number (IBAN)
- Country-specific identity numbers
- Passport and other identification formats
Built-in SITs may combine regular expressions, keywords, checksums and supporting evidence.
Example: Credit card detection
A built-in credit card SIT can evaluate more than whether a document contains a sequence of digits.
Depending on the detection pattern, additional evidence or validation may be involved.
This helps reduce false positives compared with a simple regular expression.
When to use built-in SITs
Built-in SITs are usually the preferred starting point when:
- Microsoft already supports the required data format.
- The organization does not require a unique identifier format.
- The detection logic is appropriate for the business requirement.
- The SIT produces acceptable results during testing.
Important limitation
A built-in SIT detects values matching its configured definition.
It does not necessarily establish that the detected value belongs to the organization’s actual customers or employees.
That distinction is one reason Exact Data Match exists.
4. Custom Sensitive Information Types
Custom SITs allow organizations to define their own detection patterns.
These are particularly useful for business-specific information that is not covered by Microsoft’s predefined classifiers.
Examples include:
- Employee identification numbers
- Internal contract references
- Customer account numbers
- Insurance policy identifiers
- Banking customer references
- Internal case numbers
- Business-specific document identifiers
Example: Employee identifier
Suppose an organization uses employee IDs in this format:
EMP-123456
The format contains:
- The prefix
EMP - A hyphen
- Six digits
A custom SIT can be created to identify this pattern.
However, simply detecting the format may produce false positives if similar strings appear in unrelated documents.
Supporting keywords and confidence levels can improve detection quality.
5. Anatomy of a Custom SIT
A custom Sensitive Information Type can contain several detection components.
| Component | Purpose |
|---|---|
| Primary element | Main pattern or value to detect |
| Supporting element | Additional evidence confirming the context |
| Confidence level | Indicates how much supporting evidence is present |
| Character proximity | Controls how close supporting evidence must be |
| Additional checks | Refines matches through supported validators or exclusions |
Primary element
The primary element can use:
- Regular expressions
- Keyword lists
- Keyword dictionaries
- Supported functions
Supporting elements
Supporting elements provide contextual evidence.
For example, the employee identifier EMP-123456 may appear near:
- Employee ID
- Staff Number
- Personnel Number
- Employee Reference
These keywords help distinguish an employee identifier from a similar-looking random string.
Confidence levels
Microsoft Purview uses three confidence levels:
- Low
- Medium
- High
Higher-confidence patterns generally require stronger evidence.
A higher confidence level can reduce false positives but may increase false negatives.
Best practice: Configure confidence levels according to the reliability of the detection evidence, not simply according to how sensitive the data is.
6. Creating a Custom SIT in Microsoft Purview
To create a custom Sensitive Information Type:
- Sign in to the Microsoft Purview portal at https://purview.microsoft.com.
- Navigate to Information Protection → Classifiers → Sensitive info types.
- Select Create sensitive info type.
- Enter a descriptive name.
- Add a business-focused description.
- Create a detection pattern.
- Select the confidence level.
- Configure the primary element.
- Add supporting elements where appropriate.
- Configure character proximity.
- Review additional checks.
- Save the SIT.
- Test it with representative synthetic content.
Naming example
Name: CORP - Employee Identifier
Description: Detects internal employee identifiers following the organization’s approved numbering convention.
Use a naming standard that clearly separates custom classifiers from Microsoft-provided classifiers.
This simplifies administration, change management and troubleshooting.
7. Regular Expressions in Microsoft Purview
Regular expressions, commonly called regex, are patterns used to identify text with a defined structure.
For example:
EMP-123456
A simple regex for this format is:
EMP-[0-9]{6}
This matches the prefix followed by six digits.
However, Microsoft Purview custom SIT regex patterns have specific requirements.
Microsoft documents the use of the Boost.RegEx 5.1.3 engine for custom SITs.
Custom SIT regex patterns must use exactly one primary capturing group. Other grouping should use noncapturing groups.
Example: Recommended structure
(EMP-[0-9]{6})
This uses one capturing group for the primary match.
Example: Supporting multiple formats
Suppose the organization supports:
- EMP-123456
- STF-123456
A single capturing group can handle both formats:
((?:EMP|STF)-[0-9]{6})
The inner group is noncapturing.
The outer group captures the primary value.
Important regex rules
Microsoft documents the following requirements:
- Use exactly one primary capturing group.
- Use noncapturing groups for other grouping.
- Place alternative primary match formats inside the same capturing group.
- Avoid positional anchors such as
^and$in custom SIT patterns. - Validate regex behavior in Microsoft Purview, not only in external regex testers.
A regex that works in another programming language or online tester may not behave identically in Microsoft Purview.
8. Supporting Keywords and Character Proximity
Regex identifies structure.
Supporting keywords provide context.
Consider this document:
Employee ID: EMP-123456
The primary regex detects:
EMP-123456
A supporting keyword list might include:
- Employee ID
- Staff Number
- Personnel Number
If the supporting keyword appears within the configured character proximity, the SIT can match a higher-confidence pattern.
Example design
| Element | Configuration |
|---|---|
| SIT name | CORP – Employee Identifier |
| Primary element | (EMP-[0-9]{6}) |
| Supporting keywords | Employee ID, Staff Number, Personnel Number |
| Character proximity | 300 characters |
| Confidence | High when supporting evidence is present |
A proximity value of 300 characters is a useful starting point recommended in Microsoft’s false-positive reduction guidance, but it should be validated against actual document structures.
For large tables, the correct proximity configuration may differ from ordinary documents.
Why proximity matters
A proximity that is too restrictive can miss valid matches.
A proximity that is too broad can associate unrelated keywords with a value, increasing false positives.
Test both conditions.
9. Built-in vs Custom SIT: Choosing the Right Approach
Consider three business requirements.
Scenario A — Protect credit card numbers
A financial organization wants to detect credit card numbers in email attachments.
Recommended starting point: Built-in Credit Card Number SIT.
The organization should validate confidence levels, thresholds and detection results before creating a custom alternative.
Scenario B — Protect internal contract references
A company uses identifiers such as:
CTR-2026-123456
Microsoft does not necessarily provide a built-in SIT for this proprietary format.
Recommended approach: Custom SIT using regex and supporting keywords.
Scenario C — Protect actual customer records
A bank wants to identify customer account information belonging to its own customer database.
Detecting every number matching the account-number format may generate too many irrelevant matches.
Recommended approach: Evaluate Exact Data Match.
EDM can compare detected values against an organization-supplied reference dataset.
10. What Is Exact Data Match?
Exact Data Match, or EDM, is a Microsoft Purview classification capability designed to identify sensitive information using reference data supplied by an organization.
Unlike a conventional custom SIT that identifies generic patterns, EDM can validate whether detected information corresponds to records in an authoritative dataset.
Example
A bank maintains a customer dataset containing:
| CustomerID | AccountNumber | CustomerName |
|---|---|---|
| CUST001 | 8000012345 | Example Customer A |
| CUST002 | 8000012346 | Example Customer B |
| CUST003 | 8000012347 | Example Customer C |
All values are fictional.
A conventional regex might detect many ten-digit numbers.
An EDM classifier can be configured to identify account values represented in the organization’s uploaded reference data, using its configured primary and supporting fields.
Important distinction
EDM does not simply search arbitrary content for every row in a CSV file.
The classifier uses a primary element associated with a detectable SIT, then performs the configured exact-data matching process.
Supporting fields can provide additional evidence.
11. EDM Architecture and Data Protection
A typical EDM implementation involves:
- Identifying an authoritative data source.
- Designing the EDM schema.
- Selecting primary and supporting fields.
- Creating the EDM classifier.
- Preparing the source dataset.
- Hashing the sensitive data.
- Uploading the hashed reference data.
- Testing the classifier.
- Integrating the EDM SIT into supported protection policies.
Why hashing matters
Microsoft’s EDM workflow uses hashing with a salt value before reference data is uploaded.
The EDM Upload Agent performs the supported hashing and upload process.
This reduces exposure of the original sensitive reference dataset.
For higher-security environments, Microsoft recommends separating hashing and uploading across two computers.
Security recommendations
- Restrict access to the original reference dataset.
- Use a dedicated upload identity with appropriate permissions.
- Protect intermediate files and hashing material.
- Follow Microsoft’s documented EDM Upload Agent process.
- Avoid copying production customer data into unmanaged test environments.
- Establish a secure dataset refresh procedure.
Important: EDM hashing is part of the supported Microsoft workflow. Do not replace it with a custom hashing implementation.
12. Designing an EDM Schema
The EDM schema defines the fields used for classification.
For example:
| Field | Purpose |
|---|---|
| CustomerID | Unique customer reference |
| AccountNumber | Primary account identifier |
| CustomerName | Supporting evidence |
| DateOfBirth | Optional supporting evidence, subject to business requirements |
The primary element must be associated with an appropriate SIT capable of discovering candidate values.
Supporting elements help establish the relationship between detected content and the reference data.
Design considerations
Choose the primary field carefully.
A primary identifier that is too generic can produce unnecessary scanning overhead.
Microsoft specifically warns against selecting overly broad classifiers that match large amounts of irrelevant text or numbers.
Use the narrowest reliable detector for the primary field.
13. EDM Deployment Workflow
An enterprise EDM implementation should follow a controlled sequence.
Phase 1 — Discovery
Identify:
- The business requirement
- The authoritative source system
- The sensitive fields
- The required protection actions
- The relevant Microsoft 365 workloads
Phase 2 — Schema design
Define the primary and supporting fields.
Confirm that the primary element has an appropriate SIT.
Phase 3 — Dataset preparation
Export the approved reference data in a supported format.
Validate column names, delimiters, encoding and source-data quality.
Phase 4 — Hash and upload
Use the Microsoft EDM Upload Agent.
The supported workflow includes data validation, hashing and upload.
Phase 5 — Classification testing
Use synthetic or approved test records.
Verify that expected values match and unrelated values do not.
Phase 6 — Policy integration
Reference the EDM SIT in a supported DLP or classification scenario.
Start with a controlled pilot and review results before enforcement.
Phase 7 — Operations
Document how the reference dataset will be updated as records change.
EDM is not a one-time configuration when the underlying business dataset changes regularly.
14. Common False Positives and False Negatives
Detection quality is as important as detection coverage.
False positive
A false positive occurs when content is classified as sensitive even though it does not meet the intended business meaning.
Example:
A regex intended to identify customer numbers also matches unrelated transaction references.
False negative
A false negative occurs when genuinely sensitive information is not detected.
Example:
A customer identifier appears in an unexpected format that the regex does not recognize.
Troubleshooting matrix
| Problem | Possible cause | Recommendation |
|---|---|---|
| Too many matches | Regex too broad | Narrow the pattern |
| Random numbers detected | Missing supporting keywords | Add contextual evidence |
| Valid values missed | Regex too restrictive | Review supported formats |
| High-confidence matches absent | Supporting evidence missing | Validate keywords and proximity |
| EDM does not match | Schema or source-data mismatch | Validate primary and supporting fields |
| Existing SharePoint files not classified | Content has not been recrawled | Review crawling and reindexing guidance |
| DLP does not trigger | Rule thresholds or scope incorrect | Test classification and policy separately |
15. Microsoft Purview SIT Limits
Microsoft documents several limits that should be considered when designing custom SITs.
| Configuration | Documented limit |
|---|---|
| Custom SITs created through the Purview portal | 500 |
| Regex length | 1,024 characters |
| Distinct regexes per SIT | 20 |
| Terms in a keyword list | 2,048 |
| Maximum keyword-list term length | 50 characters |
| Rule packages | 10 |
| SITs per rule package | 50 |
| Maximum rule-package size | 150 KB |
These are documented service limits and should be checked again before a large deployment because Microsoft can update them.
Avoid building unnecessarily complex regex patterns when a simpler combination of primary patterns, supporting keywords and separate SITs would be easier to maintain.
16. Testing Sensitive Information Types Before Production
A SIT should be tested independently before it is used in an enforcement policy.
Recommended test cases
| Test case | Expected result |
|---|---|
| Valid identifier with supporting keyword | Match |
| Valid identifier without supporting keyword | Depends on configured confidence pattern |
| Invalid identifier format | No match |
| Similar but unrelated identifier | No match |
| Identifier with unexpected spacing | Depends on supported format |
| Multiple matching identifiers | Correct instance count |
| Approved EDM reference value | Match |
| Value absent from EDM reference dataset | No EDM match |
For each test, document:
- Test file or message
- Expected detection
- Actual detection
- Confidence level
- Number of instances
- Applicable policy
- Remediation, if needed
A successful regex test outside Microsoft Purview is not sufficient evidence that a custom SIT is ready for production.
17. Integrating SITs with DLP Policies
After validating a SIT, it can be used in supported Microsoft Purview DLP policy conditions.
Example: Employee data protection
Policy: CORP - Employee Data Protection
Locations: Exchange, SharePoint and OneDrive
Condition: Content contains the custom employee identifier SIT.
Action: Audit and notify during the pilot, followed by approved restrictions.
Example: Customer data protection using EDM
Policy: CORP - Customer Records Protection
Condition: Content matches the approved EDM classifier.
Action: Restrict supported external sharing scenarios.
Recommended deployment sequence
- Validate the SIT.
- Configure a scoped DLP pilot.
- Run simulation.
- Review matches and false positives.
- Tune the classifier and policy.
- Obtain business approval.
- Enable enforcement.
- Monitor and optimize.
Architecture principle: A well-designed DLP policy cannot compensate for an unreliable classifier.
18. Enterprise Best Practices
For a production Microsoft Purview implementation, I recommend the following:
- Reuse built-in SITs where appropriate. Avoid duplicating Microsoft-provided classifiers without a clear business reason.
- Use custom SITs for business-specific formats. Combine regex with supporting evidence to improve accuracy.
- Use EDM when reference-data validation matters. Generic pattern matching and exact-data matching solve different problems.
- Separate classification testing from DLP enforcement testing. Confirm detection before investigating policy actions.
- Use synthetic data during initial validation. Avoid exposing production customer information unnecessarily.
- Establish naming and ownership standards. Every custom classifier should have an owner, purpose and change history.
- Review false positives and false negatives. Detection quality should be measured, not assumed.
- Document dataset refresh procedures for EDM. Classification quality depends on the reference data remaining current.
- Apply least privilege. Restrict who can manage classifiers, upload EDM data and investigate sensitive content.
- Treat SIT design as part of data security architecture. Classification should align with sensitivity labels, DLP policies and business risk.
Conclusion
Microsoft Purview Sensitive Information Types provide the foundation for identifying sensitive data across supported Microsoft 365 security and compliance scenarios.
However, successful classification requires choosing the appropriate detection approach.
Built-in SITs are a strong starting point for commonly recognized sensitive information.
Custom SITs provide flexibility for business-specific identifiers through regular expressions, keywords, proximity and confidence levels.
Exact Data Match extends classification by comparing detected information with an organization-controlled reference dataset.
The key is not to create as many classifiers as possible.
The objective is to create classifiers that are accurate, maintainable, testable and aligned with real business requirements.
For enterprise Microsoft Purview deployments, classification quality directly affects DLP effectiveness, investigation reliability and the organization’s ability to protect sensitive information.
Microsoft Learn References
- Learn about Sensitive Information Types
- Create custom Sensitive Information Types
- Sensitive Information Type limits
- Regular expressions in DLP policies
- Customize a built-in Sensitive Information Type
- Learn about Exact Data Match
- Create an EDM SIT and rule package
- Hash and upload EDM source data
- Regex validators and additional checks
- Reduce false positives in data classification