<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
# Data Anonymization — API Reference

## Column Classification

```bash
# Classify CSV columns by identifier type
node scripts/agent.js --action classify --input dataset.csv
```

Output categories: `direct_identifier`, `quasi_identifier`, `sensitive`, `non_identifying`.

## Pseudonymization

```bash
# Pseudonymize a column with HMAC-SHA256
node scripts/agent.js --action pseudonymize \
  --input data.csv --column email --secret "SECRET_KEY" \
  --output /tmp/pseudonymized.csv
```

## k-Anonymity Verification

```bash
# Check k-anonymity (default k=5)
node scripts/agent.js --action k-anonymity \
  --input dataset.csv --quasi-identifiers "age,zipcode,gender" --k 5

# Verify anonymized output
node scripts/agent.js --action verify \
  --input /tmp/anonymized.csv --quasi-identifiers "age,zipcode,gender" --k 5
```

## Re-Identification Risk Assessment

```bash
# Assess re-identification risk
node scripts/agent.js --action risk \
  --input dataset.csv --quasi-identifiers "age,zipcode,gender"
```

## Anonymization Models Reference

| Model | Property | Protection Against |
|-------|----------|--------------------|
| k-Anonymity | k records per equivalence class | Singling out |
| l-Diversity | l distinct sensitive values per class | Attribute disclosure |
| t-Closeness | Distribution within t of global | Skewness attack |

## Technique Selection Guide

| Data Type | Recommended Technique | k Minimum |
|-----------|----------------------|-----------|
| Published open data | Generalization + suppression | k ≥ 10 |
| Internal analytics | Pseudonymization | N/A |
| Research datasets | k-anonymity + l-diversity | k ≥ 5, l ≥ 3 |
| Healthcare (HIPAA) | Safe Harbor (18 identifiers) | N/A |
