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

## agent.js CLI

```bash
node scripts/agent.js --action model --input scenario.json
node scripts/agent.js --action simulate --input scenario.json --query 10000
node scripts/agent.js --action ale --input scenarios.json
node scripts/agent.js --action report --input scenarios.json --output report.json
```

## FAIR Scenario JSON Schema

```json
{
  "name": "Data Breach via SQL Injection",
  "tef": {"low": 2, "mode": 8, "high": 24},
  "vulnerability": {"low": 0.1, "mode": 0.4, "high": 0.8},
  "primary_loss": {"low": 50000, "mode": 250000, "high": 2000000},
  "secondary_loss": {"low": 20000, "mode": 100000, "high": 500000}
}
```

## Output Metrics

| Metric | Description |
|--------|-------------|
| TEF | Threat Event Frequency (events/year) |
| LEF | Loss Event Frequency (TEF x Vulnerability) |
| ALE | Annualized Loss Expectancy (LEF x Total Loss) |
| P10/P50/P90 | Confidence intervals from simulation |
