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

## Apply Static Masking

```bash
node scripts/agent.js --action mask --input /data/users.csv --rules ssn,email,name
node scripts/agent.js --action mask --input /data/users.csv --output /tmp/masked.csv
```

## Validate Masking Quality

```bash
node scripts/agent.js --action validate --input /tmp/masked.csv --original /data/users.csv
```

## Generate Masking Configuration

```bash
node scripts/agent.js --action config --columns "ssn,email,name,phone,credit_card"
```

## Supported Masking Rules

| Rule | Technique | Example |
|------|-----------|---------|
| ssn | Redaction | 123-45-6789 → ***-**-6789 |
| email | Substitution | john@corp.com → j***@example.com |
| name | Pseudonymization | John Smith → User_a1b2c3d4 |
| phone | Redaction | (555) 123-4567 → (***) ***-4567 |
| credit_card | Tokenization | 4111111111111111 → ****-****-****-1111 |

## Output Format

```json
{
  "file": "/data/users.csv",
  "rows_processed": 5000,
  "fields_masked": 15000,
  "rules_applied": ["ssn", "email", "name"]
}
```

## Validation Output

```json
{
  "rows_compared": 5000,
  "potential_leaks": [],
  "leak_count": 0,
  "status": "pass"
}
```
