Skip to content

Enhance DFD generation from system descriptions - #91

Merged
melonattacker merged 3 commits into
mainfrom
feature/gen-dfd-from-desctiption
Apr 28, 2026
Merged

Enhance DFD generation from system descriptions#91
melonattacker merged 3 commits into
mainfrom
feature/gen-dfd-from-desctiption

Conversation

@melonattacker

Copy link
Copy Markdown
Owner

This pull request adds support for generating threat models directly from natural-language system descriptions, allowing users to create Data Flow Diagrams (DFDs) without needing an existing architecture diagram. It introduces new CLI flags, updates documentation, and implements the backend logic for parsing LLM-generated DFDs into Threat Thinker's native Graph IR. The documentation and tutorials are also updated to reflect this new workflow.

Major new feature: Description-to-DFD workflow

  • Backend logic for description-to-DFD:
    Adds business_context.py, which implements utilities and dataclasses to parse LLM-generated DFD JSON payloads into native Graph IR, including confidence levels, assumptions, and clarifying questions.
  • LLM prompt and schema for DFD generation:
    Introduces new constants (DFD_SYSTEM, DFD_INSTRUCTIONS) to instruct the LLM on how to generate DFDs from descriptions, and adds a corresponding JSON schema for validation. [1] [2]
  • Inference pipeline integration:
    Updates the inference module to support DFD generation from descriptions, including a new token budget for this flow. [1] [2]

CLI and documentation updates

  • New CLI flags and usage guidance:
    Adds --description, --description-file, and --context-file flags to the CLI, clarifies their usage, and documents how to run Threat Thinker from a system description or file. [1] [2]
  • Expanded documentation and tutorials:
    Updates the README and CLI docs to explain the new workflow, and adds a new tutorial for starting from a system description. [1] [2] [3] [4] [5]

These changes make it possible to perform automated threat modeling even when no diagram exists, lowering the barrier for early-stage or less-documented projects.

@melonattacker
melonattacker merged commit 26be9e3 into main Apr 28, 2026
3 checks passed
@melonattacker
melonattacker deleted the feature/gen-dfd-from-desctiption branch April 28, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant