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

## Assess System

```bash
node scripts/agent.js --action assess \
  --system "SYSTEM_NAME" --data-categories "cat1,cat2"
```

## Data Minimization

```bash
node scripts/agent.js --action minimize \
  --fields "name,email,dob,ssn,phone" --purpose "email_marketing"
```

### Supported Purposes

| Purpose | Required Fields |
|---------|----------------|
| order_fulfillment | name, email, address, phone |
| email_marketing | email |
| analytics | (none — use aggregated data) |
| fraud_detection | email, ip_address, purchase_history |
| account_management | name, email, phone |

## Generate Checklist

```bash
node scripts/agent.js --action checklist --phase "design|development|deployment"
```

## PbD Principles Quick Reference

| # | Principle | GDPR Article |
|---|-----------|-------------|
| 1 | Proactive not Reactive | Art. 25(1) |
| 2 | Privacy as Default | Art. 25(2) |
| 3 | Privacy Embedded in Design | Art. 25(1) |
| 4 | Full Functionality | Recital 78 |
| 5 | End-to-End Security | Art. 5(1)(f), Art. 32 |
| 6 | Visibility and Transparency | Art. 5(1)(a), Art. 12 |
| 7 | Respect for User Privacy | Art. 12-22 |

## Privacy Engineering Patterns

| Pattern | Implementation Example |
|---------|----------------------|
| Minimize | Drop unused columns at ingestion |
| Separate | Microservice per purpose with separate DB |
| Abstract | k-anonymity before analytics |
| Hide | Column-level encryption |
| Inform | Real-time privacy dashboard |
| Control | Granular consent toggles |
| Enforce | Policy-as-code enforcement |
| Demonstrate | Immutable audit log |
