EVERYTHING XIAOMI
Get listed

pytm

pytm is a Python framework for creating threat models from an architectural description.

Place
#13 of 23
Score
6.0
pytm's website

What pytm is

pytm is a Python framework for creating threat models from an architectural description. Models use elements such as servers, data stores, actors, processes, data flows, and trust boundaries. From a model, pytm can generate data flow diagrams, sequence diagrams, and relevant threats. Templates can produce reports containing diagrams and findings, and a RevealMD template can create browser-presentable slides. Data flow diagrams use Graphviz DOT, while sequence diagrams use PlantUML. Models can be loaded from JSON through pytm's Python load function. Users can supply a custom threats file and override findings such as severity, CVSS score, and response text. The project aims to make threat modeling more automated and developer-centric. Listed requirements include Linux or macOS, Python 3.11 or later, Graphviz, Java OpenJDK 10 or 11, and plantuml.jar; Windows use is documented through Devbox with WSL. Its README warns that strings in threats.json are evaluated with eval(), so the file's permissions need protection against changes by an attacker.

Good

  • Generates data flow and sequence diagrams.
  • Creates threat findings from architectural models.
  • Supports report templates and browser-presentable slides.
  • Allows custom threats and finding attributes.

Watch out

  • Requires Python 3.11 or later.
  • Diagram generation requires Graphviz and Java/PlantUML.
  • Windows usage is documented through WSL.
  • Editable threats.json strings are evaluated with eval().

Who it suits

pytm suits developers who want to describe an architecture in Python and generate threat-model diagrams and findings. It is intended for users who can meet its diagram-generation requirements and protect the threats.json file.

Verdict

pytm brings architectural modeling, diagrams, and threat findings into a Python-based workflow. Check its runtime and diagram requirements, and restrict access to threats.json as the project cautions.

Plans and prices

From pytm's own pricing page, checked 8 Oct 2026.

All about pricing
PlanPriceWhat it gives you
Open-source pytmFreePython 3.11+ · Requires Graphviz and Java/PlantUML for diagram generation

The facts

Each one read from pytm's own pages, with the date it was checked.

What it does

Diagram integrations
Diagram output uses Graphviz DOT for data flow diagrams and PlantUML for sequence diagrams.checked 8 Oct 2026
Generated outputs
From an architectural model, pytm can generate data flow diagrams, sequence diagrams, and relevant threats.checked 8 Oct 2026
Intended users
The project describes its goal as shifting threat modeling earlier and making it more automated and developer-centric.checked 8 Oct 2026
Model import
A threat model can be imported from JSON using pytm's Python load function.checked 8 Oct 2026
Other tooling
The project documents container and Devbox workflows for managing dependencies, and uses Pandoc in its example report-generation command.checked 8 Oct 2026
Purpose
pytm is a Pythonic framework for threat modeling intended to make threat modeling more automated and developer-centric.checked 8 Oct 2026
Reports and slides
Templates can produce reports containing diagrams and findings, and a RevealMD template can create browser-presentable slides.checked 8 Oct 2026
Security caution
The README warns that strings in threats.json are evaluated with eval() and says to protect the file's permissions to prevent code execution by an attacker who can change those strings.checked 8 Oct 2026
Threat customization
Users can provide a custom threats file and override finding attributes such as CVSS score, response text, and severity.checked 8 Oct 2026

The company

Maker
OWASP describes itself as a nonprofit foundation dedicated to improving software security through open-source collaboration, education, and innovation.checked 8 Oct 2026

Where it runs

Modeling approach
Threat models are defined in Python using elements such as servers, data stores, actors, processes, data flows, and trust boundaries.checked 8 Oct 2026
Platform requirements
The listed requirements are Linux or macOS, Python 3.11 or later, Graphviz, Java OpenJDK 10 or 11, and plantuml.jar.checked 8 Oct 2026
Windows usage
The project documents a Devbox setup for Windows through WSL.checked 8 Oct 2026
The full review of pytm

Overview

pytm is an open-source framework for building threat models in Python and turning them into diagrams and security findings. It is best suited to developers and security practitioners who want threat modeling to fit a code-based workflow.

Key features

Models describe an architecture through Python elements including actors, servers, processes, data stores, data flows, and trust boundaries. pytm uses that model to generate data-flow diagrams, sequence diagrams, and relevant threats. For teams already comfortable working in Python, keeping the architecture in code can make threat modeling part of development work; teams seeking a visual, point-and-click modeling process should look elsewhere.

Data-flow diagrams use Graphviz DOT, while sequence diagrams use PlantUML. Templates can bring diagrams and findings together in reports, and a RevealMD template can turn model output into browser-presentable slides. This range is useful for teams that need to share findings in different formats, though those outputs depend on the relevant tooling and on maintaining templates.

A model can also be loaded from JSON through pytm's Python function. Custom threat files let teams adapt findings, including CVSS score, severity, and response text, to their own practices. That control is valuable when generic findings need adjustment, but the project warns that strings in threats.json are evaluated with eval(). Protecting that file's permissions is essential: someone able to change those strings could cause code execution.

The project documents container and Devbox workflows for managing dependencies. Its example report-generation command uses Pandoc, another component to account for when preparing the reporting workflow.

Pricing

Open-source pytm — free. The free plan is the open-source framework, with Python 3.11 or later and Graphviz and Java/PlantUML required for diagram generation. There are no paid tiers to weigh against it; the cost is the setup and maintenance of a self-hosted toolchain.

Platforms

pytm is listed for Linux, macOS, and Windows. The documented requirements specify Linux or macOS, Python 3.11 or later, Graphviz, Java OpenJDK 10 or 11, and plantuml.jar. Windows use is documented through a Devbox setup in WSL, so Windows users should expect a Linux environment rather than a native workflow.

Who it's for

pytm makes the most sense for developers and security practitioners who want an architecture model expressed in Python, customizable threat findings, and generated diagrams or reports. Its self-hosted approach also suits teams that want to manage their own dependencies and model files. It is a weaker fit for people who want a graphical modeling interface or minimal setup.

Pros and cons

  • Pro: Python-defined models connect architecture elements to generated diagrams and threat findings, supporting a code-centric modeling workflow.
  • Pro: Report and slide templates, plus adjustable threat attributes, give teams options for tailoring and presenting their output.
  • Con: Diagram generation relies on Graphviz and Java/PlantUML, with Python 3.11 or later also required.
  • Con: The documented Windows route uses WSL and Devbox, which adds setup for Windows users.
  • Con: The threats.json evaluation warning makes file permissions a security responsibility, not an optional housekeeping step.

Alternatives

Threat Modeling Software is the category directory for comparing tools. Choose CAIRIS if its free plan and support for web and self-hosted platforms better fit your environment. OWASP Threat Dragon is another free, open-source option, with web and self-hosted platforms among its listed choices.

ThreatForge offers a free, open-source application with no account required. Threagile is a free, MIT-licensed toolkit with web and self-hosted platforms. Consider ThreatModeler Nexus if you want a free Community Edition aimed at practitioners, students, developers, architects, and security teams, with a path to scaling.

ThreatOpus may suit teams looking for a freemium web service with a paid Starter plan at £129.99 a month. ThreatTree has a free plan capped at three forests, three DFDs per forest, and five attack trees per DFD, plus a Pro plan at $29 a month billed per user monthly. AWS Threat Composer is another free option, with platforms including web and desktop operating systems.

Verdict

Choose pytm if your team wants threat modeling in Python and can take responsibility for its diagram dependencies, templates, and threat-file security. Its strongest reason to choose is the ability to turn a code-defined architecture into diagrams and customizable findings; look elsewhere if you need a graphical workflow or a simpler Windows setup.

Alternatives to pytm

All alternatives
  1. 1Dethernety logo

    Dethernety

    Free planOpen sourceWebAPISelf-hosted
    7.2Free plan
  2. 2ThreatModeler Nexus logo

    ThreatModeler Nexus

    Free planWebAPISelf-hosted
    6.7From $4,000 a year
  3. 3ThreatOpus logo

    ThreatOpus

    Free planWebAPI
    6.7From £129.99 a month
  4. 4

    ThreatTree

    Free planWebAPI
    6.6From $29 a month
  5. 5

    OWASP Threat Dragon

    Free planWebLinuxmacOSSelf-hosted
    6.4Free plan
  6. 6

    CAIRIS

    Free planWebAPILinuxmacOS
    6.3Free plan