In this section

0.4 Recognizing Sensitive Data

Module 0

Introduction

Every control in this course acts on content it recognizes as sensitive. A label is applied automatically because a file contains card numbers. A DLP rule blocks a message because it contains an employee's personal details. A retention label keeps a contract because a classifier recognized it as a contract. Answers from Copilot are filtered because their sources carry labels that classification put there.

If recognition is wrong, every one of those controls is wrong in the same way, at scale. A pattern that matches order numbers as employee IDs will label order confirmations Confidential, warn people sending them to customers, and count them as personal data in every posture report. Nobody designs that outcome. It arrives because the classifier was accepted without being tested on the organization's own text.

Purview offers four ways to recognize content, and each fits a different kind of data. None of them is right for everything, and the most expensive mistakes in classification come from using the convenient method on data that needed another. A pattern is quick to write and wrong on data without a pattern; a trainable classifier is powerful and slow to train, and pointless where a pattern would do.

Knowing all four before Module 2 lets each request be matched to the method that suits it. This lesson sets out what each one does and when it fits, takes apart the most common one, the sensitive information type, shows how to read the counts Purview reports, introduces the two errors every classifier makes, and lists the controls that inherit those errors.

What does the content have?A patternsensitive info typecard numbers, IDsKnown valuesexact data matchyour employee listA formfingerprinta blank templateA subjecttrainable classifiercontracts, CVsused by auto-labeling, DLP, retention labels and insider risk

Choose the method by what the content has. Every method feeds the same downstream controls, so a classifier's errors become those controls' errors.

The figure sorts the four methods by one question: what does the content have that makes it recognizable? If it has a pattern, a sensitive information type can find it. If you hold the exact values, exact data match can. If it is built from a standard form, a fingerprint can.

If none of those is true and only the subject identifies it, a trainable classifier is the remaining option. Module 2 builds each, and starts every decision from this question. Most organizations need more than one method. Card numbers suit a sensitive information type. A client list suits exact data match. A standard contract template suits a fingerprint.

Board papers and legal advice, which have no common format at all, suit a trainable classifier or, more often, a label applied by the people who write them. Matching the method to the data is the first design decision in classification, and the most common mistake is to reach for a pattern when the data has none.

1

Four Methods

Choose by what the content has

The four methods differ in what they look for, how much setup they need, and where they fail. The sheet sets them side by side. Read the last column first. Every method has a limit, and the limit is usually what decides between two methods that would both work on paper.

Foundations.xlsx
D5not encrypted items
ABCD
1MethodFindsFits whenMain limit
2Sensitive info typetext matching a pattern, with evidencethe data has a recognizable formatanything else with that format
3Exact data matchvalues from a table you upload as hashesyou hold the real listneeds the list kept current
4Document fingerprintdocuments built from a standard forma blank form existsonly that form
5Trainable classifierdocuments about a subjectno value or form identifies itnot encrypted items
Classification methods

Sensitive information types are the workhorse. Microsoft publishes several hundred built-in types for card numbers, national identifiers, bank details and credentials, and organizations add their own for internal identifiers. A type finds text that matches a pattern and checks for evidence around it. It is quick to deploy and it matches anything with the right shape, which is both its strength and its weakness.

The built-ins are written for the world, not for one organization. A national identifier pattern written to catch every real identifier in every document will also catch reference numbers, part numbers and phone numbers in some organizations, because those organizations happen to use the same shapes for something else. The built-in cannot know that; the organization's own testing can.

Exact data match narrows a pattern to real values. The organization uploads a table of the values it holds, such as its employees' identifiers, and Purview matches only those. Microsoft's documentation describes the result as fewer false positives, and notes that only salted one-way hashes of the values are uploaded. The cost is maintenance: the table must be refreshed as the data changes.

Exact data match also needs a pattern underneath: Microsoft's documentation requires the primary field to be discoverable through an existing sensitive information type, so EDM narrows a pattern's matches to the real values rather than replacing the pattern. A good EDM design starts with a reasonable pattern and adds the table to remove its false positives.

Document fingerprinting recognizes documents built from a standard form, such as a patent application or an HR template. A fingerprint is made from the blank form, and documents that reuse it match. It is precise and narrow: it finds that form and nothing else.

That narrowness is useful when the form itself is what matters: a completed employee onboarding form holds personal details in predictable places, and recognizing the form is a reliable way to recognize the data. It is useless for content that arrives in many shapes.

Trainable classifiers recognize documents by subject when no value or form identifies them: contracts, CVs, source code, financial statements. Microsoft provides pretrained ones, and organizations can train their own from examples.

The highlighted limit applies to all of them: Microsoft's documentation states that classifiers only work with items that aren't encrypted. A file encrypted by a label before a classifier reads it is invisible to that classifier, which shapes the order in which Module 4 applies labels.

Custom trainable classifiers have their own constraints, which Module 2 sets out: they need hundreds of examples, they are limited to English, and a published custom classifier cannot be retrained, only removed and built again. They are the most capable method and the slowest to get right, which is why they come last in the course's order of preference.

2

How a Sensitive Information Type Matches

A pattern, evidence and a window

A sensitive information type is a set of patterns, each with a confidence level. Every pattern has a primary element, usually a regular expression or a keyword list, and may require supporting elements found within a set number of characters of it. Some add checks, such as a checksum. The pattern that matches with the most evidence decides the confidence of the match.

This structure is what lets one type serve several controls. A DLP rule that warns can act on the medium-confidence pattern; a rule that blocks can wait for the high-confidence one. Both use the same type, and the type's patterns carry the judgment about how much evidence each kind of action deserves.

How one pattern decides a matchPrimary elementthe regex orkeyword listProximity windowcharacters eitherside of itSupporting evidencekeywords, checksinside the windowConfidencelow, medium or high:which pattern matchedNo primary element, no match, however much supporting evidence is nearby.

One pattern of a sensitive information type. A type holds several such patterns, one per confidence level.

A published definition shows the same parts with real values.

Microsoft PurviewSearch
Information Protection › Classifiers › Sensitive info types
Argentina National Identity (DNI) Number
Pattern 1Medium confidence
Primary element
Regular expressionRegex_argentina_national_id
Character proximity
250 characters
Supporting elements
  • Keyword listKeyword_argentina_national_id
Additional checks
  • None
A worked reading of a published definition: medium confidence needs the number and a keyword nearby. The number alone does not match.
Recreated view with example values. Field names are those Microsoft documents.

The published definition of the Argentina national identity number shows the idea in its simplest form. The primary element is a named regular expression for the number's format, and the supporting element is a named keyword list; the published page lists both. At medium confidence, a keyword from a list must appear within 250 characters of it.

A string of digits in the right shape with no keyword nearby does not match at all. That keyword is what separates a national identity number from an invoice number in the same format. Proximity is measured in characters around the primary element, so the window is a design choice too.

Too narrow and a keyword in a table header two columns away falls outside it. Too wide and a keyword anywhere on the page counts, which in a long spreadsheet means almost everywhere. Module 2 tests windows against real document layouts because the right width depends on how the organization's documents are written.

Foundations.xlsx
B375
ABCD
1LevelValueTypically requiresTrade
2Low65the pattern alonemost matches, most false positives
3Medium75the pattern and some supporting evidencethe usual balance
4High85the pattern, a check, and strong evidencefewest false positives, more misses
Classification methodsConfidence levels

Confidence levels are tiers of evidence. Microsoft's documentation gives low as 65, medium as 75 and high as 85. A low-confidence pattern usually requires the primary element alone and matches the most, including the most text that only looks right. A high-confidence pattern requires more evidence and matches less, including some real cases that happen to lack the evidence.

The highlighted value is the middle level, which is where most built-in types recommend their use. Each type also records a recommended confidence, the level its authors consider the best balance for general use. It is a starting point, and the organization's own testing decides whether it holds for that organization's text.

The levels matter because the controls that use a type choose which level to act on. A DLP rule that blocks at low confidence will block a lot of innocent mail.

A rule that acts only at high confidence will miss real data that was written without the expected keywords nearby. Module 6 sets different actions at different levels for exactly this reason: a warning on the uncertain matches, a block on the certain ones.

Built-in types cannot be edited. They can be copied and the copy changed, which is how organizations adapt a built-in to their own data, for instance by excluding test values. Some types cannot be copied at all, such as the named entity types that recognize people's names and medical terms.

Module 2 reads several built-in definitions before writing a custom type, because the built-ins show how Microsoft balances evidence against reach. Every built-in definition is published on Learn with its patterns, keywords and checks, and reading one before relying on it takes a few minutes.

Most surprises in production come from types that nobody read. A bundled type, such as All Full Names, groups several named entity types into one; the bundle is convenient for counting and hard to reason about, because its matches come from several different detectors at once.

Microsoft Purview portal

Read a built-in type before relying on it:
Microsoft Purview › Solutions › Information Protection › Classifiers › Sensitive info types
Search for the type, open it, and read its patterns, confidence levels and recommended confidence. Test runs a sample file against it and shows the matches.

The Test button is the cheapest check there is, and Module 2 uses it on every type it builds.

3

Two Errors

False positives and false negatives

Every classifier makes two kinds of error. A false positive is a match on content that is not what the type is for. A false negative is a miss on content that is. They pull against each other: tightening a pattern to reduce false positives usually raises false negatives, and loosening it does the reverse.

Pattern checkEmployee ID, pattern alone2 wrong of 4
(?<![\w-])(NE-\d{6})(?![\w-])
1Employee NE-104233 joined Operations in March.matchshould match
2Order NE-882910 shipped to the Leeds depot.matchshould not
3Badge for employee NE-55120 is pending.no matchshould match
4Part number XNE-104233 replaced.no matchshould not
Computed when this page was built, with Python's regular expression engine. The portal uses Boost.RegEx 5.1.3; confirm any pattern with the portal test before relying on it.

The pattern check above runs a bare employee ID pattern against four lines, and the result is computed when the page is built. It matches the employee ID on the first line correctly, and it matches the order number on the second line, which shares the format.

The third line is a real employee record with a mistyped ID of five digits, and the pattern misses it: a false negative, marked wrong in the check because the line should have been found. The fourth line is a part number that contains the ID's shape inside a longer code, and the boundaries in the pattern keep it out.

The order number is the false positive that supporting evidence exists to prevent. In a real tenant it would not be one line: every order confirmation the firm ever sent would match, and a DLP rule built on the bare pattern would warn on all of them.

Requiring a keyword such as "employee" or "staff" within a short distance would keep the first line and drop the second. That is what the medium and high confidence patterns in a well-built type do, and what a bare regex never does.

Exclusions help in the other direction: a list of known test values, or a pattern for the order number format, can be excluded so that the type ignores text it would otherwise match. Module 2 uses both, evidence to confirm and exclusions to reject, and tests each against a corpus that holds real cases and look-alikes side by side.

The cost of each error depends on the control downstream. A false positive in auto-labeling puts a restrictive label on a file that did not need it, and may encrypt it so that the people who need it cannot use Copilot with it. A false positive in DLP blocks a legitimate message and teaches users to override.

A false negative in either lets the content through unprotected. Choosing a confidence level is choosing which error the organization would rather have, for that control, on that data. That choice belongs to the people who own the data and the process as much as to the engineer.

Finance may accept warnings on every invoice to avoid missing a card number; sales may not accept a single blocked proposal. The engineer's job is to show each owner what each level would match on their own content, so that the choice is made on evidence.

4

Reading Counts

A count is a list of candidates

Purview reports where its classifiers find matches. Data explorer, and the DSPM pages built on the same data, show each sensitive information type with the number of items that matched it and where those items sit.

Data explorer in Microsoft Purview with All Full Names selected under Sensitive info types. The left pane lists types with counts: All Full Names 83,492, All Medical Terms And Conditions 55,147, Diseases 48,141, UAE Passport Number 47,580 and EU Tax Identification Number 36,221, with a link to see all 281. The right pane lists four data sources holding items with the type: Copilot 2,371, OneDrive 54,787, SharePoint 7,286 and Teams 19,047.

A real Data explorer page from the course tenant. The counts are items with at least one match, not confirmed sensitive items. Select the image to open it full size.

The capture is a real Data explorer page. Read the counts as candidates. All Full Names at 83,492 items is plausible for any organization, because names appear everywhere. UAE Passport Number at 47,580 items is a different matter for a firm that has no particular reason to hold UAE passports.

A count like that is more likely to be a collision, the type's pattern matching something else in the firm's content that shares its shape, than a finding. Module 2 reads such counts as a collision report and uses them to decide which built-in types to trust and which to copy and tighten. The same reading applies to medical terms and diseases, both high on the list.

A firm whose staff write about health in benefits documents and sick-leave records will have real matches; a firm that sells medical equipment will have thousands of matches in product sheets that hold no one's personal information. The count cannot tell those apart. Opening a sample of matched items can, and twenty items usually settle the question.

The data source column on the right is worth a second look. It lists Copilot alongside OneDrive, SharePoint and Teams, which means classification also runs on Copilot interactions. Counts are also not live: Microsoft documents that they can take up to seven days to update, and up to fourteen for SharePoint files.

A count is a recent snapshot of matches. It says where to look, and the item itself, opened by someone permitted to read it, says what was found. Reading items needs its own permissions: Microsoft separates the roles that can see counts, list items and read content, which keeps the evidence behind a count away from anyone who only needs the number. Lesson 0.3's role groups apply here.

Microsoft Purview portal

See where a type matches:
Microsoft Purview › Solutions › Information Protection › Explorers › Data explorer
Select Sensitive info types, pick a type and read the locations on the right. Counts are items with at least one match, and can be up to a week old.

The same page is where Module 1 reads the data column of its exposure map.

Foundations.xlsx
B2decide which files get a label
ABC
1ControlUses a classifier toModule
2Auto-labelingdecide which files get a label4
3DLPdecide which messages, files or prompts to act on6, 7
4Retention labelsapply a retention label automatically8
5Insider riskweigh activity involving sensitive content9
6Data explorer, DSPMcount where sensitive content sits1, 11
Classification methodsConfidence levelsWhere classifiers are used

The sheet lists the controls that use classifiers, and each inherits the classifier's errors. A classifier is built once and used in many places, so its quality multiplies. A type that is right 95 times in 100 is right 95 times in 100 in every control that uses it; a type that is right 60 times in 100 spreads its 40 errors across labels, alerts, retention and risk scores together.

The highlighted row, auto-labeling, is usually the first to show them, because a label applied wrongly is visible to users at once. DLP shows them in alerts and override rates. Retention shows them much later, when something was kept that should have been deleted, or the reverse. Insider risk weighs them into a person's risk, which is why its errors have consequences for individuals.

A posture report that counts sensitive items carries the same errors into the figures a board sees. If half of a type's matches are collisions, half of the "sensitive items at risk" are not sensitive, and a remediation program sized from the count will spend half its effort in the wrong place.

Microsoft 365 CopilotWorkWebPrepared example
Write a regex for our employee IDs, which look like NE- followed by six digits, for a Purview sensitive info type.
Use NE-\d{6}. Add it as the primary element of a custom sensitive information type and set the confidence level to High.
Check before you use itThe pattern finds every employee ID and every order number that happens to share the shape, and a six-digit ID inside a longer code. Setting High confidence on a bare pattern inverts what the levels mean: High should need the most evidence, such as a keyword nearby. The regex is a quarter of a type; the supporting evidence is the rest, and the assistant left it out.

The assistant's regex is a reasonable start and an incomplete type. It produces the first line of the pattern check above, including the false positive. A better prompt asks for the evidence as well: keywords that should appear near a real employee ID, a proximity window, and which level each combination belongs at.

Even then, the only way to know how a type behaves is to run it against text that contains both real cases and look-alikes, which is how Module 2 builds every custom type.

Do

Practice

What a built-in type will match
the requirement set
Review taskFoundationsWhat a built-in type will match
DeliverableFor one built-in type, a prediction of what it will and will not match, with the evidence each level needs.
Done whenEach prediction names the evidence that decides it, and the count has an explanation other than "we hold 47,580 UAE passports".
  • The definitionRead the pattern. Primary element, supporting elements, proximity, confidence level.
  • TextPredict. Four lines of text: which match at which level, and why.
  • Data explorerRead a count. Is 47,580 UAE passport matches in a UK firm plausible? What else could it be?
  • DownstreamName the cost. Which control would act on a false positive, and what it would do.

Use the DNI definition from this lesson. Write four lines of your own: one with the number and a keyword close by, one with the number alone, one with the keyword far from the number, and one with a different number in the same format next to the keyword.

Predict which match and at what confidence. Then explain the UAE passport count with at least one plausible collision, and name the control that would act on it first.

Try thisCheck it treats confidence as evidence
Explain how a Microsoft Purview sensitive information type decides that text matches, including confidence levels, supporting elements and proximity.

What to look at: whether it explains that each confidence level is a pattern with its own required evidence, that supporting elements must fall within the proximity window of the primary element, and that low confidence matches more and is wrong more often. An answer that describes confidence as a score the engine calculates has misread the model.

The answer worth trusting treats confidence as evidence: each level is a pattern with its own required supporting elements inside a proximity window. An answer that calls confidence a score the engine computes has misread the model, and will lead to types that match too much.

Purview recognizes sensitive content in four ways, chosen by what the content has: a pattern, known values, a form or a subject. Sensitive information types are patterns with evidence and a proximity window, at three confidence levels that trade false positives against false negatives.

Counts in Data explorer are candidates, often collisions, and lag the content by days. Auto-labeling, DLP, retention and insider risk all inherit a classifier's errors. The next lesson takes the control that most often acts on classification: the sensitivity label.