> Markdown version of https://www.artie.com/glossary/data-classification. Site index for AI agents: https://www.artie.com/llms.txt

[Back to glossary](https://www.artie.com/glossary)

# Data Classification

Data classification labels data by what it contains and how sensitive it is, so access, masking and retention rules can follow the label.

[Share on LinkedIn (opens in a new tab)](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fwww.artie.com%2Fglossary%2Fdata-classification) [Share on X (opens in a new tab)](https://x.com/intent/post?text=Data%20Classification\&url=https%3A%2F%2Fwww.artie.com%2Fglossary%2Fdata-classification)

## What Is Data Classification?

**Data classification** is the practice of labeling data by what it contains and how sensitive it is, so that access, masking and retention rules can follow the label. In a data stack the unit is usually the column: `users.email` is labeled PII and confidential, and every copy of that column should carry the same label.

Labels describe two things:

* **Sensitivity level**: how much harm exposure would cause, such as public, internal, confidential or restricted.
* **Data type**: what the value is, such as **PII** (names, email addresses, IP addresses, government IDs), **PHI** under HIPAA, **payment card data** under PCI DSS, credentials and secrets, or confidential business data like salaries.

## How Data Classification Works

Data classification runs in three steps: discovery proposes labels, labeling records them, and enforcement applies controls based on them.

1. **Discovery.** A scanner reads schemas, and often values, to find sensitive columns. Snowflake's sensitive data classification (Enterprise Edition) gives each such column a semantic category, such as `NAME`, and a privacy category of `IDENTIFIER`, `QUASI_IDENTIFIER` or `SENSITIVE` ([Snowflake docs](https://docs.snowflake.com/en/user-guide/classify-intro)).
2. **Labeling.** A rule or a reviewer confirms the label and stores it as metadata: a Snowflake tag, a BigQuery policy tag or a data catalog entry.
3. **Enforcement.** A Snowflake tag-based masking policy masks every tagged column whose data type matches the policy ([masking policy docs](https://docs.snowflake.com/en/user-guide/tag-based-masking-policies)). BigQuery checks a column's policy tag against IAM at query time ([BigQuery docs](https://docs.cloud.google.com/bigquery/docs/column-level-security-intro)).

### One column, from Postgres to the warehouse

Take `users.email` in a production Postgres database:

* **In Postgres**, the column is labeled PII and confidential.
* **In replication**, a [change data capture](https://www.artie.com/glossary/change-data-capture) pipeline reads changes from the WAL, Postgres's write-ahead log, and writes them to `raw.users` in Snowflake. The label is metadata and does not travel with the rows.
* **In transformation**, dbt builds `stg_users`, `dim_customers` and a marketing export from `raw.users`. All three now hold email addresses.

That makes four copies outside Postgres. [Data lineage](https://www.artie.com/glossary/data-lineage) finds them by listing every column derived from `users.email`. [Database replication](https://www.artie.com/blogs/introduction-to-database-replication) copies personal data out of production, so the label has to be applied again in the warehouse.

## Data Classification Levels

A common scheme has four sensitivity levels. Names vary, but the tiers map closely:

| Level        | Examples                                                  | Typical handling                                                                   |
| ------------ | --------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Public       | Published docs, list prices, marketing pages              | No restrictions                                                                    |
| Internal     | Wiki pages, org charts, aggregate metrics                 | Employees only, no external sharing                                                |
| Confidential | Customer emails, contracts, revenue by account            | Role-based access, masked outside production, reads logged                         |
| Restricted   | Government IDs, card numbers, health records, credentials | Need-to-know access, excluded or encrypted in analytics copies, every read audited |

A column takes the level of the most sensitive value it can hold. A `notes` field that sometimes contains a phone number is confidential. Keep the number of tiers small, since every extra one adds borderline calls.

## Where Name-Based PII Discovery Falls Short

Name-based scanning flags columns whose names or types match patterns such as `email`, `phone`, `ssn`, `dob` or `ip_address`. It needs only schema metadata and finds the obvious columns quickly. It is a heuristic, and it gets four kinds of column wrong:

* **Free-text fields.** `notes` and `comments` columns collect phone numbers that support agents paste in.
* **JSON and JSONB columns.** A `metadata` column holding `{"email": "..."}` has a name that reveals nothing.
* **Vague or legacy names.** `contact`, `val` or `c7` hide their contents, and a column renamed in a migration can lose its match.
* **False positives.** `email_template_id` and `phone_verified` match the pattern and hold no personal data.

Content sampling closes part of the gap by testing values against regular expressions, checksums such as the Luhn check for card numbers, or ML models. Sampling costs compute and only sees the rows it reads. Treat name-based results as the first draft of the inventory and have column owners confirm anything labeled restricted.

## Classifying Data in Replication Pipelines

A replication pipeline decides which personal data reaches the warehouse at all. In-flight controls change what lands; warehouse controls change who can read it. There are four options:

* **Exclude** the column. It never reaches the destination, and analysts lose the field.
* **Hash** the column. A deterministic hash keeps joins, counts and deduplication working without the raw value.
* **Encrypt** the column. Encryption is reversible with the key, for teams that need the original value back.
* **Mask in the warehouse.** The raw value lands, and a masking policy hides it at query time. The value still sits in storage, backups and any table copied from it.

[CDC pipelines differ in how they handle schema changes](https://www.artie.com/blogs/not-all-cdc-pipelines-are-created-equal), so check what happens to columns added later. With an exclusion list, a new `tax_id` column lands unprotected. An inclusion list keeps it out until someone adds it.

## Data Classification Best Practices

Data classification holds up when labels start at the source and are re-checked every time the schema changes.

* **Label at the source.** Application teams know what each column holds, and lineage carries the labels downstream.
* **Re-scan after schema changes.** A migration that adds `tax_id` creates an unlabeled restricted column. Run PII discovery on new and altered columns.
* **Minimize before you mask.** If analytics never needs the raw value, exclude or hash it in the pipeline.
* **Scan derived tables and exports.** dbt models, reverse ETL syncs and CSV exports copy labeled columns into places a scan of raw tables never reaches.
* **Keep audit evidence.** An auditor may ask which controls applied to a column, and since when. Version the labels, and keep a change history of the tables, as in [audit logs built with CDC and SCD Type 2](https://www.artie.com/blogs/how-to-build-audit-logs-using-cdc-and-scd-type-2).

## How Artie handles this

[Artie Catalog](https://www.artie.com/catalog) flags likely personal data in the databases and warehouses you connect. It matches column names for emails, people's names and credentials, and Postgres's `inet` type for IP addresses. It doesn't read the values, so free-text and JSON columns still need a person to check them. In a pipeline, you can [exclude, hash or encrypt columns](https://www.artie.com/docs/pipelines/tables#exclude-certain-columns) before they reach the destination. Hashing and encryption aren't available for Kafka destinations.

## Frequently asked questions

What is data classification?

Data classification is labeling data by type and sensitivity, usually column by column, so that access controls, masking and retention rules follow the label. A typical scheme marks a column of email addresses as PII and confidential and restricts who can read it.

Can column names alone identify PII?

Column names alone identify only part of the PII in a database. Name rules catch columns like `email` or `ssn`, but miss free-text fields, JSON columns and vaguely named columns, and they can flag lookalikes such as `email_template_id`. Content sampling and owner review are needed to complete the inventory.

Does hashing a column make the data anonymous?

Hashing a column pseudonymizes data but does not anonymize it. The same value always produces the same hash, so rows can still be linked to one person, and unsalted hashes of emails or phone numbers can be reversed by hashing likely values and comparing results. A secret salt, as in HMAC-SHA256, makes that attack much harder.

## Related resources

* [Glossary term](https://www.artie.com/glossary/data-lineage)
  ### [Data Lineage](https://www.artie.com/glossary/data-lineage)
* [Glossary term](https://www.artie.com/glossary/change-data-capture)
  ### [Change Data Capture](https://www.artie.com/glossary/change-data-capture)
* [Blog post](https://www.artie.com/blogs/how-to-build-audit-logs-using-cdc-and-scd-type-2)
  ### [How to build audit logs using CDC and SCD Type 2](https://www.artie.com/blogs/how-to-build-audit-logs-using-cdc-and-scd-type-2)
* [Blog post](https://www.artie.com/blogs/introduction-to-database-replication)
  ### [Introduction to database replication](https://www.artie.com/blogs/introduction-to-database-replication)

## Watch your data replicate live

[Start for free](https://app.artie.com/signup) [Book a demo](https://www.artie.com/contact)
