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

## Discover Sensitive Data

```bash
node scripts/agent.js --action discover --input /data/exports/ --extensions ".csv,.json,.xml"
```

## Classify Discovered Data

```bash
node scripts/agent.js --action classify --input /tmp/discovery.json
```

## Generate Data Inventory

```bash
node scripts/agent.js --action inventory --input /tmp/classified.json
```

## Sensitive Data Patterns

| Category | Patterns | Classification |
|----------|----------|---------------|
| pii | ssn, email, phone | Restricted |
| pci | credit_card | Restricted |
| credentials | aws_key, private_key, password_field | Restricted |
| phi | mrn, icd10 | Restricted |

## Output Format

```json
{
  "file": "/data/exports/users.csv",
  "size_bytes": 245760,
  "findings": [
    {"category": "pii", "pattern": "ssn", "count": 142, "classification": "restricted"}
  ],
  "highest_classification": "restricted"
}
```

## Classification Levels

| Level | Label | Handling |
|-------|-------|----------|
| L0 | Public | No restrictions |
| L1 | Internal | Access control |
| L2 | Confidential | Encryption + ACL |
| L3 | Restricted | Encryption + DLP + audit |
