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

## agent.js CLI

```bash
# Generate classification taxonomy
node scripts/agent.js --action taxonomy --levels 4

# Scan content for sensitive data
node scripts/agent.js --action scan --content "SSN: 123-45-6789"

# Discover sensitive data in cloud storage
node scripts/agent.js --action discover --source s3 --bucket company-data

# Classify data inventory
node scripts/agent.js --action classify --inventory data-inventory.json

# Generate compliance report
node scripts/agent.js --action report --inventory data-inventory.json
```

## AWS Macie CLI

```bash
# Enable Macie
aws macie2 enable-macie

# Create classification job
aws macie2 create-classification-job --job-type ONE_TIME \
  --s3-job-definition '{"bucketDefinitions":[{"accountId":"ID","buckets":["BUCKET"]}]}'

# List findings
aws macie2 list-findings --finding-criteria '{"criterion":{"severity.description":{"eq":["High"]}}}'

# Get finding details
aws macie2 get-findings --finding-ids ID1 ID2
```

## Microsoft Purview CLI

```bash
# List sensitivity labels
az purview label list

# Create auto-labeling policy
az purview auto-labeling create --name "PII-detection" \
  --sensitivity-label-id LABEL_ID --conditions '{"contentContains":["SSN"]}'
```

## Supported PII Patterns

| Pattern | Type | Classification | Regex |
|---------|------|---------------|-------|
| SSN | PII | L3 | `\d{3}-\d{2}-\d{4}` |
| Credit Card | PCI | L3 | `(\d{4}[-\s]?){3}\d{4}` |
| Email | PII | L2 | Standard email regex |
| API Key | Credential | L4 | `(sk\|pk\|api)[-_][A-Za-z0-9]{20,}` |
| AWS Access Key | Credential | L4 | `AKIA[0-9A-Z]{16}` |
