# mrwadams/stride-gpt architecture

> Architecture diagram of the GitHub repository mrwadams/stride-gpt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mrwadams/stride-gpt
- Repository: https://github.com/mrwadams/stride-gpt

## Overview

STRIDE GPT accepts application descriptions, diagrams, or a codebase; generates STRIDE threat findings and related security artifacts; and presents or exports the results through a CLI/REPL or Streamlit UI. The CLI’s agent workflow plans subsystems, explores code with tools, records evidence, and synthesizes findings. Other documented capabilities include DFDs, attack trees, mitigations, DREAD scoring, test cases, MITRE mappings, and Markdown, JSON, SARIF, and HTML output. Edges rely on excerpts, SOURCE INDEX references, or README statements; unsampled subsystem details are represented cautiously.

Main entry points: [`apps/web/main.py`](https://github.com/mrwadams/stride-gpt/blob/master/apps/web/main.py) (Streamlit interface), [`stride_gpt/cli.py`](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/cli.py) (CLI and REPL), [`stride_gpt/agent/loop.py`](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/loop.py) (Agent loop), [`stride_gpt/core/llm.py`](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/llm.py) (LLM interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI and REPL<br/>[cli.py]"]
  node_web["Streamlit interface<br/>[main.py]"]
end

subgraph group_agent["Agent analysis"]
  node_planner["Subsystem planner<br/>[planner.py]"]
  node_loop["Agent loop<br/>[loop.py]"]
  node_tools["Code exploration tools<br/>[tools.py]"]
  node_evidence["Evidence verification<br/>[evidence.py]"]
  node_context["Analysis context<br/>[context.py]"]
  node_persistence["Run checkpoints<br/>[persistence.py]"]
end

subgraph group_modeling["Threat modeling"]
  node_prompt["Prompt builder<br/>[builder.py]"]
  node_references["Threat reference cards<br/>[variants.py]"]
  node_llm["LLM interface<br/>[llm.py]"]
  node_threatmodel["STRIDE threat model<br/>[threat_model.py]"]
  node_dfd["Data flow diagrams<br/>[dfd.py]"]
  node_drawio["draw.io parsing<br/>[drawio_parser.py]"]
  node_attacktree["Attack trees<br/>[attack_tree.py]"]
  node_mitigations["Mitigations<br/>[mitigations.py]"]
  node_dread["DREAD scoring<br/>[dread.py]"]
  node_tests["Gherkin test cases<br/>[test_cases.py]"]
end

subgraph group_outputs["Results and configuration"]
  node_schemas["Analysis schemas<br/>[schemas.py]"]
  node_config["Provider configuration<br/>[config.py]"]
  node_registry["Model registry<br/>[models.py]"]
  node_report["Report rendering<br/>[report.py]"]
  node_html["HTML report<br/>[html_report.py]"]
end

node_user(("Security practitioner"))
node_providers{{"LLM providers"}}

node_user -->|"starts analysis"| node_cli
node_user -->|"provides inputs"| node_web
node_cli -->|"plans codebase"| node_planner
node_cli -->|"runs analysis"| node_loop
node_cli -->|"saves checkpoints"| node_persistence
node_cli -->|"renders results"| node_report
node_planner -->|"explores code"| node_tools
node_loop -->|"uses plan"| node_planner
node_loop -->|"dispatches tools"| node_tools
node_loop -->|"verifies findings"| node_evidence
node_loop -->|"uses context"| node_context
node_loop -->|"requests completions"| node_llm
node_loop -->|"builds prompts"| node_prompt
node_tools -->|"loads cards"| node_references
node_cli -->|"loads settings"| node_config
node_config -->|"uses model catalog"| node_registry
node_llm -->|"routes requests"| node_providers
node_web -->|"generates threats"| node_threatmodel
node_web -->|"generates DFDs"| node_dfd
node_web -->|"parses diagrams"| node_drawio
node_web -->|"generates attack trees"| node_attacktree
node_web -->|"suggests mitigations"| node_mitigations
node_web -->|"scores threats"| node_dread
node_web -->|"generates cases"| node_tests
node_threatmodel -->|"requests generation"| node_llm
node_dfd -->|"requests generation"| node_llm
node_attacktree -->|"requests generation"| node_llm
node_mitigations -->|"requests suggestions"| node_llm
node_dread -->|"requests scoring"| node_llm
node_cli -->|"structures findings"| node_schemas
node_report -->|"renders HTML"| node_html
node_user -->|"receives exports"| node_report

click node_cli "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/cli.py"
click node_web "https://github.com/mrwadams/stride-gpt/blob/master/apps/web/main.py"
click node_planner "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/planner.py"
click node_loop "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/loop.py"
click node_tools "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/tools.py"
click node_evidence "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/evidence.py"
click node_context "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/context.py"
click node_persistence "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/persistence.py"
click node_prompt "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/prompts/builder.py"
click node_references "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/prompts/variants.py"
click node_llm "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/llm.py"
click node_threatmodel "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/threat_model.py"
click node_dfd "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/dfd.py"
click node_drawio "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/drawio_parser.py"
click node_attacktree "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/attack_tree.py"
click node_mitigations "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/mitigations.py"
click node_dread "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/dread.py"
click node_tests "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/test_cases.py"
click node_schemas "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/schemas.py"
click node_config "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/config.py"
click node_registry "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/models.py"
click node_report "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/report.py"
click node_html "https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/html_report.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_web toneBlue
class node_planner,node_loop,node_tools,node_evidence,node_context,node_persistence toneAmber
class node_prompt,node_references,node_llm,node_threatmodel,node_dfd,node_drawio,node_attacktree,node_mitigations,node_dread,node_tests toneMint
class node_schemas,node_config,node_registry,node_report,node_html toneRose
class node_user,node_providers toneIndigo
```

## Components

### User interfaces

- [CLI and REPL](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/cli.py): `stride_gpt/cli.py`
- [Streamlit interface](https://github.com/mrwadams/stride-gpt/blob/master/apps/web/main.py): `apps/web/main.py`

### Agent analysis

- [Subsystem planner](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/planner.py): `stride_gpt/agent/planner.py`
- [Agent loop](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/loop.py): `stride_gpt/agent/loop.py`
- [Code exploration tools](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/tools.py): `stride_gpt/agent/tools.py`
- [Evidence verification](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/evidence.py): `stride_gpt/agent/evidence.py`
- [Analysis context](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/context.py): `stride_gpt/agent/context.py`
- [Run checkpoints](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/persistence.py): `stride_gpt/agent/persistence.py`

### Threat modeling

- [Prompt builder](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/prompts/builder.py): `stride_gpt/core/prompts/builder.py`
- [Threat reference cards](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/prompts/variants.py): `stride_gpt/core/prompts/variants.py`
- [LLM interface](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/llm.py): `stride_gpt/core/llm.py`
- [STRIDE threat model](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/threat_model.py): `stride_gpt/core/threat_model.py`
- [Data flow diagrams](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/dfd.py): `stride_gpt/core/dfd.py`
- [draw.io parsing](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/drawio_parser.py): `stride_gpt/core/drawio_parser.py`
- [Attack trees](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/attack_tree.py): `stride_gpt/core/attack_tree.py`
- [Mitigations](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/mitigations.py): `stride_gpt/core/mitigations.py`
- [DREAD scoring](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/dread.py): `stride_gpt/core/dread.py`
- [Gherkin test cases](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/test_cases.py): `stride_gpt/core/test_cases.py`

### Results and configuration

- [Analysis schemas](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/core/schemas.py): `stride_gpt/core/schemas.py`
- [Provider configuration](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/config.py): `stride_gpt/config.py`
- [Model registry](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/models.py): `stride_gpt/models.py`
- [Report rendering](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/report.py): `stride_gpt/agent/report.py`
- [HTML report](https://github.com/mrwadams/stride-gpt/blob/master/stride_gpt/agent/html_report.py): `stride_gpt/agent/html_report.py`

### Other components

- **Security practitioner**
- **LLM providers**

## Connections

- Security practitioner → CLI and REPL: starts analysis (evidence: `README.md`)
- Security practitioner → Streamlit interface: provides inputs (evidence: `README.md`)
- CLI and REPL → Subsystem planner: plans codebase (evidence: `stride_gpt/cli.py`)
- CLI and REPL → Agent loop: runs analysis (evidence: `stride_gpt/cli.py`)
- CLI and REPL → Run checkpoints: saves checkpoints (evidence: `stride_gpt/cli.py`)
- CLI and REPL → Report rendering: renders results (evidence: `stride_gpt/cli.py`)
- Subsystem planner → Code exploration tools: explores code (evidence: `stride_gpt/agent/planner.py`)
- Agent loop → Subsystem planner: uses plan (evidence: `stride_gpt/agent/loop.py`)
- Agent loop → Code exploration tools: dispatches tools (evidence: `stride_gpt/agent/loop.py`)
- Agent loop → Evidence verification: verifies findings (evidence: `stride_gpt/agent/loop.py`)
- Agent loop → Analysis context: uses context (evidence: `stride_gpt/agent/loop.py`)
- Agent loop → LLM interface: requests completions (evidence: `stride_gpt/agent/loop.py`)
- Agent loop → Prompt builder: builds prompts (evidence: `stride_gpt/agent/loop.py`)
- Code exploration tools → Threat reference cards: loads cards (evidence: `stride_gpt/agent/tools.py`)
- CLI and REPL → Provider configuration: loads settings (evidence: `stride_gpt/cli.py`)
- Provider configuration → Model registry: uses model catalog (evidence: `stride_gpt/config.py`)
- LLM interface → LLM providers: routes requests (evidence: `stride_gpt/core/llm.py`)
- Streamlit interface → STRIDE threat model: generates threats (evidence: `apps/web/main.py`)
- Streamlit interface → Data flow diagrams: generates DFDs (evidence: `apps/web/main.py`)
- Streamlit interface → draw.io parsing: parses diagrams (evidence: `apps/web/main.py`)
- Streamlit interface → Attack trees: generates attack trees (evidence: `apps/web/main.py`)
- Streamlit interface → Mitigations: suggests mitigations (evidence: `apps/web/main.py`)
- Streamlit interface → DREAD scoring: scores threats (evidence: `apps/web/main.py`)
- Streamlit interface → Gherkin test cases: generates cases (evidence: `README.md`)
- STRIDE threat model → LLM interface: requests generation (evidence: `stride_gpt/core/threat_model.py`)
- Data flow diagrams → LLM interface: requests generation (evidence: `stride_gpt/core/dfd.py`)
- Attack trees → LLM interface: requests generation (evidence: `stride_gpt/core/attack_tree.py`)
- Mitigations → LLM interface: requests suggestions (evidence: `stride_gpt/core/mitigations.py`)
- DREAD scoring → LLM interface: requests scoring (evidence: `stride_gpt/core/dread.py`)
- CLI and REPL → Analysis schemas: structures findings (evidence: `stride_gpt/cli.py`)
- Report rendering → HTML report: renders HTML (evidence: `stride_gpt/agent/report.py`)
- Security practitioner → Report rendering: receives exports (evidence: `README.md`)
