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

## agent.js CLI

```bash
node scripts/agent.js --action enumerate --input device_spec.json
node scripts/agent.js --action threats --input components.json
node scripts/agent.js --action report --input threats.json --output report.json
```

## IoT Threat Layers

| Layer | Example Threats |
|-------|----------------|
| hardware | Debug ports, tampering, side-channel |
| firmware | Unsigned updates, hardcoded creds |
| communication | Unencrypted MQTT, BLE bypass |
| cloud | Insecure provisioning, weak API auth |
| mobile | Cleartext storage, insecure pairing |

## Device Spec JSON Schema

```json
{
  "components": [
    {"name": "MCU", "layer": "hardware", "protocols": [], "internet_facing": false}
  ]
}
```
