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

## agent.js CLI

```bash
node scripts/agent.js --action init --query "Application Name v2.0"
node scripts/agent.js --action import --input threats.json
node scripts/agent.js --action diagram --input components.json
node scripts/agent.js --action matrix --input threats.json
node scripts/agent.js --action report --input document.json --output report.json
```

## Document Sections

| Section | Audience |
|---------|----------|
| executive_summary | Leadership |
| system_description | All |
| data_flow_diagrams | Architects |
| threat_table | Security team |
| risk_matrix | All |
| mitigation_plan | Dev, PM |
| appendix | Audit |

## Component JSON Schema (for DFD)

```json
{
  "name": "Web App",
  "type": "process | data_store | external_entity",
  "connects_to": ["Database", "Cache"]
}
```
