What is sensitive data classification? Regex vs AI, cloud vs endpoint
TL;DR
Sensitive data classification finds the data that would hurt your business if it leaked and labels it so the right protection follows. How much it catches comes down to two choices: whether content is recognized by patterns or AI models, and whether the decision runs in the cloud or on the device as the data moves.
Every DLP policy depends on classification, because a policy can only act on data it recognizes and understands. A rule built to find card numbers does that job well. It has nothing to say about a pricing model pasted into an AI chat, a contract uploaded to a personal drive, or source code copied to a USB drive. But as you can imagine in the modern age, pattern-matching can be equally noisy and quiet.
In plain terms, sensitive data classification is the work of identifying the data that needs protection and labeling it by how sensitive it is. That usually covers two kinds of data:
- Regulated data: card numbers, health records, and personal data covered by privacy laws.
- Business content: source code, financial models, contracts, product plans, and the other work your company would hate to lose.
The hard part is recognizing all of it reliably, at the speed people work. Two choices shape how well a program does that:
- How content gets recognized: with pattern rules such as regular expressions (regex), or with AI models that read the content and decide what it is.
- Where the decision runs: in the cloud, against data in storage or in transit, or on the device, at the point someone acts on the data.
Both choices come with trade-offs, and the right mix depends on what your data looks like and how quickly you need to act on it.
What is sensitive data classification?
Sensitive data classification is the process of finding data that carries risk and attaching a label that says how sensitive it is. Those labels let a security team apply the right handling to each kind of data without reviewing every file by hand.
NIST’s 2023 draft report on the topic, IR 8496, describes data classification more broadly as “the process an organization uses to characterize its data assets using persistent labels so those assets can be managed properly.” Sensitive data classification applies that idea to the data you’d least want to see leave.
Once data carries a label, that label can drive decisions about:
- Access: who can open, edit, or share it.
- Movement: where it can go, such as whether a file can be uploaded to a personal account or pasted into an AI tool.
- Retention: how long it’s kept and how it’s disposed of.
CIS Critical Security Control 3 treats classification as a core data protection step, asking organizations to “identify, classify, securely handle, retain, and dispose of data.” Labels also come in levels of sensitivity.
How does regex-based classification work, and where does it break?
Regex-based classification matches text against fixed patterns, such as the format of a card number or a Social Security number. It works well when data has a predictable shape and struggles when it doesn’t.
A typical rule combines a few pieces:
- A pattern: for example, nine digits in the three-two-four format of a Social Security number.
- A validator: a check such as the Luhn checksum that real card numbers pass, which filters out random strings of digits.
- A keyword: words like “SSN” or “card number” close to the match, which raise confidence that it’s real.
For structured identifiers, that combination is fast, cheap, and easy to explain to an auditor. Problems show up with everything else:
- False positives: A nine-digit string could be a Social Security number or an employee ID, and the pattern can’t tell them apart. Analysts lose time to alerts that turn out to be noise, and the noise pushes teams toward monitor-only policies.
- Missed data: Source code, financial models, and contracts have no fixed shape, so there’s no pattern to write. Some of the costliest data to lose is also the hardest for rules to see.
- Upkeep: Every new data type needs a new rule, so coverage grows only as fast as someone can write and tune them.
For a more in-depth look at these limitations, see where rule-based DLP falls short.
What is AI data classification?
AI data classification uses a trained model that reads content and decides what it is. Because the model has learned what a category of data looks like, it can recognize a financial model or a block of source code without a rule describing its shape.
A model typically returns a category, such as source code, an HR record, or a board deck, often with a confidence score. Some approaches also let a team train a custom classifier from a handful of its own example documents, which helps with internal formats no vendor has seen before.
Models come with trade-offs of their own:
- Compute: A model takes more processing than a pattern match. Its size and where it runs determine whether classification can keep up with real-time activity.
- Explainability: A regex match points to the exact characters that fired. A model makes a judgment, so your team needs to see why it reached that call before trusting it to block anything.
- Accuracy testing: Published accuracy numbers depend on the data they were measured on. Test any model against a sample of your own documents, proprietary ones included, before you turn on enforcement.
Model size plays into all three. General-purpose large language models can classify content, but calling one for every file action is slow and expensive. Small language models trained for a narrow set of security questions are cheaper to run and easier to test.
Regex vs. AI: which one should you use?
Use patterns for data with a fixed format and models for data without one. Many teams run both, with regex handling structured identifiers and AI handling the content that has no predictable shape.
The table below compares the two on the points that come up in an evaluation.
| Regex | AI | |
|---|---|---|
| What it catches | Structured identifiers with a known format, such as card numbers and Social Security numbers | Structured identifiers plus content with no fixed shape, such as source code, financial models, and contracts |
| Setup and upkeep | A rule for every data type, tuned over time as false positives surface | Pretrained categories, plus custom classifiers trained from example documents |
| False positives | Common on look-alike strings, such as an employee ID that matches an SSN pattern | Fewer look-alike matches, since the model judges the whole document; still needs testing on your data |
| Proprietary data | Hard to cover, because internal documents rarely follow a pattern | Coverable with custom classifiers trained on your own examples |
| Explainability | Clear, because the match shows the exact text that fired | Needs supporting detail, such as the category and confidence score, to explain a decision |
If your program runs on regex alone today, keep the rules that work for structured identifiers and add a model for the data rules can’t describe. Start with the categories that would hurt your business most if they leaked, such as source code or deal documents, since that’s where rules leave the biggest gaps.
The next question is where classification runs.
Should classification run in the cloud or on the device?
At the end of the day, it depends on when the decision has to happen. Cloud classification works well for data sitting in storage, and on-device classification can decide while someone is acting on the data, before it leaves.
Cloud classification covers two main areas:
- Data at rest in cloud stores: Data security posture management (DSPM) tools scan cloud storage and SaaS apps, classify what they find, and map who can reach it. DSPM and DLP cover different halves of the data lifecycle, which we break down in DSPM vs. DLP.
- Traffic through inspection points: Network and cloud DLP classify data as it passes through a proxy or gateway on its way somewhere else.
On-device classification runs where people work with the data, so it can weigh in on actions like these:
- A paste into an AI tool
- An upload to a file-sharing site
- A copy to a USB drive
- A print job
In each case, the decision lands before the action completes. Sending content to a cloud service for a verdict adds a round trip between the action and the decision. For a scan of stored files, that delay doesn’t matter much. For a paste or an upload, the data can be gone before the verdict comes back.
Some data never passes through a cloud inspection point at all. Files created locally, text copied between documents, and output from an AI agent on the device have no cloud record. Some desktop AI apps also encrypt their own traffic, so a network proxy can’t read what’s inside.
If the goal is to stop data loss, classify on the device and keep cloud classification for data at rest. For more on what each layer can see, read network vs. cloud vs. endpoint DLP, or start with the basics of endpoint DLP.
What should you look for in a sensitive data classification approach?
Look for an approach that recognizes regulated and proprietary data, stays accurate enough to enforce, and makes its call before data leaves. In practice, that breaks down into five things to check:
- Regulated and proprietary coverage: It should catch card numbers and health records as well as source code, contracts, and your own internal formats. Ask how it handles data no vendor has seen.
- False positives low enough to enforce: When analysts can’t trust the alerts, blocking gets switched off. Ask what it takes to keep blocking turned on.
- Data at rest and in motion: Scanning stored files shows where risk sits. Classifying data as it moves is what lets you stop it.
- The labels you already have: Your team may have already built sensitivity labels in other tools. A new approach should read them so that work carries forward.
- Timing that fits prevention: For prevention, classification has to finish before the paste, upload, or copy does.
Where Bold fits
Both choices come down to what your data looks like and when you need to act on it. Regex handles data with a fixed format, AI models handle the rest, and stopping data loss means making the call on the device, where the data moves.
Bold is intent-based DLP for the AI endpoint. By default, Bold classifies data on the device with purpose-built small language models. Lawrence Pingree, Head of Data Security and AI Research at SACR, described it this way in the firm’s Endpoint Control and Prevention Market Guide:
“Bold is a critical vendor leading the way for what intent-aware enforcement should look like in the ECP market. Running data classification directly on the device and for more threat analysis in the future, rather than depending on cloud decisions, is exactly the architecture and outcome security teams need to be able to keep up in this rapidly evolving AI risk landscape on the endpoint.”
To go deeper, read how on-device AI classification works at Bold, or get a demo to see it on your own data.
