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

## Scan File for DLP Violations

```bash
node scripts/agent.js --action scan --input /data/export.csv --policy pci
node scripts/agent.js --action scan --input /var/log/app.log --policy pii --output /tmp/dlp.json
```

## Evaluate DLP Coverage

```bash
node scripts/agent.js --action coverage --input /tmp/classified_data.json
```

## Generate DLP Policy Template

```bash
node scripts/agent.js --action policy --policy-type endpoint --sensitivity restricted
```

## Supported Policies

| Policy | Patterns | Severity |
|--------|----------|----------|
| pci | credit_card, cvv, cardholder_name | Critical |
| pii | ssn, email, phone_us | High |
| phi | mrn, icd10, npi | Critical |
| credentials | aws_key, generic_secret, private_key | Critical |

## Output Format

```json
{
  "rule": "credit_card",
  "policy": "pci",
  "severity": "critical",
  "line": 42,
  "column": 15,
  "redacted_value": "411***678",
  "context": "payment processed for card 4111111111111678"
}
```

## Policy Actions

| Action | Disruption | Use Case |
|--------|-----------|----------|
| audit | None | Initial deployment, monitoring |
| notify | Low | User awareness, policy training |
| override | Medium | Business justification required |
| encrypt | Medium | Auto-protect before transfer |
| block | High | Critical data, strict compliance |
