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

## agent.js CLI

```bash
# Classify data assets
node scripts/agent.js --action classify --catalog data-catalog.json

# Generate encryption strategy
node scripts/agent.js --action encrypt --catalog classified.json --output encryption.json

# Generate DLP policies
node scripts/agent.js --action dlp --catalog classified.json --output dlp-policies.json

# Validate data protection
node scripts/agent.js --action validate --policies encryption.json --dlp dlp-policies.json
```

## Data Catalog JSON Schema

```json
{
  "name": "users",
  "type": "table",
  "fields": [
    {"name": "email", "pii": true},
    {"name": "preferences", "pii": false}
  ]
}
```

## Classification Levels

| Level | Label | Encryption | DLP | Masking |
|-------|-------|-----------|-----|---------|
| 4 | Restricted | AES-256-GCM + KMS | Yes | Yes |
| 3 | Confidential | AES-256-GCM + KMS | Yes | No |
| 2 | Internal | AES-256 | No | No |
| 1 | Public | None | No | No |

## PII Auto-Detection Keywords

- Level 4: ssn, credit_card, password, secret
- Level 3: email, phone, address, dob, salary
