What is k-anonymity?
K-anonymity is a privacy property of a dataset. Each record shares its quasi-identifier values, such as ZIP code, birth date and sex, with at least k minus 1 other records. Any person therefore hides in a group of at least k, which makes it harder to link a row back to them using outside data such as a voter roll.
For example, a health plan shares claims data with a research partner. It removes names and member IDs but leaves ZIP code, full birth date and sex. The partner, or anyone who gets the file, can match those three fields against a public voter list and put names back on many rows. Latanya Sweeney’s research found that ZIP code, birth date and sex together were unique for about 87% of the US population in 1990 census data. K-anonymity was developed to close this gap.
How k-anonymity works
Teams pick the quasi-identifiers and a value of k, then change the data until every combination appears at least k times. Two techniques do most of the work:
- Generalization. Replace exact values with ranges or broader groups, such as a 3-digit ZIP prefix instead of 5 digits, or birth year instead of full date.
- Suppression. Remove records or values that still stand out after generalization.
| Before | After (k = 2) |
|---|---|
| 02139, 1984-03-12, F, asthma | 021**, 1980 to 1989, F, asthma |
| 02141, 1987-07-30, F, diabetes | 021**, 1980 to 1989, F, diabetes |
| 02142, 1962-11-02, M, asthma | 021**, 1960 to 1969, M, asthma |
| 02138, 1965-01-19, M, flu | 021**, 1960 to 1969, M, flu |
Limits of k-anonymity
K-anonymity hides who a row belongs to, but not always what the row says. If every record in a group has the same diagnosis, an attacker learns it anyway (a homogeneity attack). Background knowledge can also narrow a group. Later models address this: l-diversity requires varied sensitive values in each group, and t-closeness keeps each group’s distribution close to the whole dataset. K-anonymity also gets hard with many columns, because each added field splits the groups further.
Why k-anonymity matters for AI systems
K-anonymity was built for tables. AI systems mostly handle free text: support tickets, clinical notes, emails, prompts and documents in a vector store. A sentence like “the 34-year-old engineer from the Austin office who filed in March” carries quasi-identifiers that no column-based method sees. Protecting AI data means finding both direct identifiers and these context clues inside unstructured text.
How Protecto helps
Protecto does not compute k for a dataset. It detects direct identifiers and other sensitive values in tables and free text and replaces them with consistent tokens, so records stay linked for analysis without exposing who they belong to. Teams can pair it with generalization for quasi-identifiers when they prepare data for sharing. See PHI de-identification for data lakes.
Frequently asked questions
What is a good value of k?
There is no universal value. Teams choose k based on how sensitive the data is and who will receive it. A higher k gives stronger protection but removes more detail.
What is the difference between k-anonymity and differential privacy?
K-anonymity changes a released dataset so each record blends into a group of at least k. Differential privacy adds noise to outputs such as counts or model training, and gives a mathematical limit on what any one record reveals.
Does k-anonymity meet HIPAA de-identification?
Not by itself. HIPAA allows Safe Harbor, which removes 18 identifiers, or Expert Determination, where an expert certifies very small re-identification risk. An expert may use k-anonymity as one of the methods in that analysis.
Related terms
Quasi-identifier · Differential privacy · Data anonymization · HIPAA Expert Determination · Data de-identification