/threat-model
Overview
The /threat-model command generates a comprehensive, application-centric threat model by analyzing the codebase in your current working directory. It creates an operator session, explores the source code using AI, and produces a structured Markdown document covering application context, trust boundaries, attacker profiles, security controls, and attack paths with pentest guidance.
Usage
With flags:
Alias: /tm
How It Works
Codebase Analysis
The AI agent explores the codebase — reading source files, configuration, infrastructure, and security-relevant code.
Threat Modeling
The agent identifies the application’s identity, features, trust boundaries, attacker profiles, deployment model, security controls, and system architecture.
Command Flags
Output Format
The generated threat model includes these sections:
- Application Context — identity, features & capabilities, trust boundaries, attacker profiles
- Deployment Model — cloud, containers, CI/CD, environment files
- System Components — component inventory with types and technologies
- Trust Boundaries — infrastructure-level trust zones
- Data Flows — component-to-component data flow map
- Security Controls — existing controls with effectiveness and gaps
- Attack Paths — detailed attack paths with mechanism steps, preconditions, existing controls, control gaps, and pentest guidance
- Summary — statistics by severity
Example Workflow
Using with /pentest
The generated threat model can be fed into a pentest session using the --threat-model flag:
This guides the pentest agent to prioritize testing based on the identified attack paths and control gaps.