pytm
pytm: A free, code-first framework for generating models, diagrams, reports, and findings. Ranked #21 of 24 in Threat Modeling Software by our editors (7.3/10); pricing: Open source; best for developers who prefer code-defined threat models.
At a glance
- Editor score7.3 / 10
- PricingOpen source
- Best forDevelopers who prefer code-defined threat models
- Paid fromFree
- Facts checked22 Sep 2026

Where it wins
- Defines threat models in Python for development-focused workflows
- Generates data-flow diagrams, sequence diagrams, reports, and findings
- Supports custom threats, rules, templates, and JSON exchange
Where it doesn't
- Self-hosted deployment requires teams to manage the local environment
- Does not provide verified collaboration or attack-path analysis
- Broader integrations are limited compared with wider platform offerings
Our verdict on pytm
pytm is an open-source threat-modeling framework from OWASP for developers and security practitioners who want to define system architecture in Python. Instead of working through a hosted visual workspace, users describe model elements and properties in code, then generate data-flow diagrams, sequence diagrams, reports, and threats relevant to the modeled system. It runs on Windows, macOS, and Linux, making it a fit for teams that want threat modeling close to development workflows and source-controlled artifacts.
The main strength is depth within a code-defined approach. pytm can automatically generate threats and findings, produce risk-colored diagrams, and use templates for threat-model reports. Custom threat files and threat rules allow teams to shape the output around their own modeling needs, while JSON import and export supports exchange between workflows. These capabilities make pytm more adaptable than a fixed checklist, particularly for developers who prefer repeatable definitions and generated documentation over manual diagram editing.
Its trade-off is focus. pytm is distributed as open-source code and uses self-hosted deployment, so it is better suited to teams comfortable managing a local or containerized runtime than to organizations seeking a hosted collaborative application. The published feature set also does not include verified collaboration, attack-path analysis, or broad integrations. Choose pytm when Python-defined models, generated diagrams, custom rules, and local control are priorities. Consider an alternative when nontechnical stakeholders need built-in collaboration or when attack-path analysis and a wider integration ecosystem are central requirements.
Your product? Our editors can test pytm in depth and publish a review, labelled as paid · from $149/mo →
pytm pricing
pytm fact sheet
| Free plan | Not verified |
|---|---|
| Paid from | Free |
| Project limit | Not verified |
| Attack-path analysis | Not verified |
| Risk prioritization | Yes |
| Collaborative review | Not verified |
| Templates and frameworks | Yes |
| Modeling methods | Custom |
| Deployment | Self_hosted |
| Deployment | Self-hosted |
| Platforms | Windows, macOS, Linux |
| Support | Community, Docs |
| Built for | Solo, Small business (editorial estimate) |
| Pricing | Open source |
| Website | github.com |
| Facts checked | 22 Sep 2026 |
Alternatives to pytm
- CAIRISA broad open-source choice for teams connecting threats, requirements, architecture, and risk.9.4
- IriusRiskA flexible threat-modeling platform with automation, integrations, and a useful free tier.9.3
- ThreatModeler NexusAI-assisted threat modeling with attack paths, risk prioritization, compliance, and CI/CD checks.9.2
Used pytm? Be the first to review it
The editor score above is our own research. What this page doesn't have yet is a reader's view — what you used pytm for, what worked and what didn't. No stars are seeded and no review is paid for; an editor reads every one before it appears.
Write a reviewTwo minutes · verified accounts only · read by an editor before it appears
Featured on iTechGuides
pytm is listed in our Threat Modeling Software directory. Add the badge to your site — it links back to this page.
<a href="https://www.itechguides.com/products/pytm/"><img src="https://www.itechguides.com/best/badge/pytm.svg" alt="Featured on iTechGuides" width="230" height="46"></a>
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.
Last updated · How we research and update

