Skip to main content

ThreatSketch

CI

Threat modelling in the style of Microsoft's Threat Modeling Tool (TMT), for macOS, Windows, Linux and the browser. Draw a data-flow diagram; the STRIDE threats from TMT's SDL TM Knowledge Base template appear as you draw, with TMT's titles, categories and priorities.

ThreatSketch with the example model: stencils on the left, the diagram in TMT's style, the threat list below, and the selected threat's state, priority and justification on the right

Install

Where How
Browser, any system https://elikplimsunu.github.io/threatsketch/ (works offline after the first visit)
macOS brew install --cask elikplimsunu/tap/threatsketch, or the .dmg from Releases (Intel and Apple silicon)
Windows the .msi or -setup.exe from Releases
Linux the .AppImage or .deb from Releases
Command line uv tool install threatsketch or pipx install threatsketch (guide)

The desktop app offers new versions when it starts; the web version offers a reload. The apps are not signed by Apple or Microsoft, so the first launch needs one extra step: on macOS, Open Anyway in System Settings > Privacy & Security; on Windows, More info > Run anyway.

Used TMT before? Coming from Microsoft TMT maps each TMT step to ThreatSketch.

What it does

  • TMT's stencils and rules. Web Application, SQL Database, HTTPS and the rest of the SDL template, with each stencil's TMT properties. Threats depend on the stencils, their properties and which trust boundaries each flow crosses, as in TMT.
  • Connecting. Hover an element: a + appears on each side. Drag it to another element to draw a data flow, or click it to link the nearest element on that side.
  • Triage. Not Started, Needs Investigation, Not Applicable and Mitigated, with priority and justification.
  • Hand-ins. A report laid out like TMT's Full Report (HTML or PDF), the threat list in TMT's CSV format, or a .tm7 for TMT.
  • Files. Opens Threat Dragon .json and TMT .tm7; saves Threat Dragon .json, which Threat Dragon also opens. Nothing is uploaded: the threat engine runs on your computer.

A tour

Start. New model, open a file, or the example. Unsaved work from last time is offered here.

The start screen: New threat model, Open a file, Open the example

Draw and connect. Hover an element for a + on each side; drag it to another element, or click it to link the nearest one.

Payment Provider hovered, with a + handle on each side

TMT properties. Pick the element's stencil and set its TMT properties. Values fixed by the stencil are shown locked; the trust boundary it sits in is named in red.

Orders DB selected: SQL Database stencil, inside Shop backend, and its TMT properties

Triage. Set state, priority and justification. Threats nobody has looked at stay quiet in the list; the ones you have decided on stand out.

The threat list with threats marked Mitigated, Needs Investigation and Not Applicable

Report. The threat report follows TMT's Full Report: a summary by state and by STRIDE category, the diagram, then every interaction, the boundaries it crosses, and its threats. It prints to A4 with page numbers; Export > Threat report (PDF) saves it as a PDF (example PDF). The Export menu also has the HTML report, TMT's CSV and a .tm7.

The threat report: model details and the Threat Model Summary by state and by STRIDE category

Threats in the report: each with its state, category, priority, rule, description and justification

Dark mode follows your system. Files, reports and exports stay black on white, as in TMT.

ThreatSketch in dark mode

How close it is to TMT

Checked against a real model built in TMT 7.3 with the SDL template: the same 54 threats, the CSV export identical row for row, and the .tm7 back unchanged after import and export.

Not yet compared with TMT itself: line boundaries, stencil properties other than the defaults, encrypted or HTTPS flows, out-of-scope elements, two-way flows, and TMT opening a .tm7 exported from a diagram drawn here. These follow TMT's own rules and are checked against worked examples. If you can run TMT, comparing them is the most useful contribution (see Contributing).

Documentation

Development

uv sync
uv run pytest -q
uv run ruff check . && uv run ruff format --check .
uv sync --extra pytm   # optional OWASP pytm rule pack (`--pack pytm`); CI installs it

cd app
npm run check          # type-check the app
npx vitest run         # unit tests
npx playwright test    # end-to-end tests against the production build, in Chrome

The app runs the Python engine (src/threatsketch) unchanged, in the browser, through Pyodide; src/threatsketch/api.py is everything it calls. app/README.md explains how the app is put together.

Tests come first. A change that teaches something new about the file formats updates docs/SPEC.md in the same commit. main only accepts changes whose CI passes.

Releasing

One version number covers the app and the command (semantic versioning). Note changes under Unreleased in CHANGELOG.md as you go. To release:

uv run python scripts/bump.py 0.4.0       # sets the version everywhere, dates the changelog
git commit -am "Release 0.4.0" && git tag v0.4.0 && git push && git push --tags

The tag starts .github/workflows/release.yml: tests; desktop builds for macOS, Windows and Linux, each opened and checked by a self-test; the GitHub release with every installer and the update feed; then the website, the Homebrew tap and PyPI. Running the workflow by hand ("Run workflow") builds and self-tests everything without releasing.

Contributing

Issues and pull requests are welcome. The most valuable help needs a Windows machine: the real acceptance test is drawing the four small diagrams in tests/fixtures/golden/ in TMT 7.3 with the SDL TM Knowledge Base template and comparing its threat report with ThreatSketch's expected output (PLAN task 3.4). If you can run TMT, please open an issue.

License

MIT, see LICENSE. Bundled third-party material:

  • src/threatsketch/data/templates/default.tb7: Microsoft threat-modeling-templates, MIT.
  • tests/fixtures/td/ and tests/fixtures/schema/: sample models and the v2 JSON schema from OWASP Threat Dragon, Apache-2.0.
  • The diagram shapes are adapted from OWASP Threat Dragon (Apache-2.0). The app bundles AntV X6, Svelte and Tauri (MIT), Pyodide (MPL-2.0) and IBM Plex (OFL-1.1).

Details in THIRD_PARTY_NOTICES.md. ThreatSketch is not affiliated with Microsoft or OWASP.

Metadata

Release files for threatsketch 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for threatsketch 0.4.0
File Size Uploaded
threatsketch-0.4.0.tar.gz 197.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for threatsketch 0.4.0
File Interpreter ABI Platform
threatsketch-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 360.5 kB

Release files / threatsketch-0.4.0.tar.gz

Download URL threatsketch-0.4.0.tar.gz
Size 197.9 kB
Tags Source
SHA-256 checksum
How to use checksums
85929f7ecd14cb8119b0dbb3c308b479b8ec26b4376ef024391b2eba541489d2
BLAKE2b-256 checksum
How to use checksums
17955febe0e2a4494e5e5149c6dc40a6253e5da6c19ff72819f7bf97a7ef6abb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / threatsketch-0.4.0-py3-none-any.whl

Download URL threatsketch-0.4.0-py3-none-any.whl
Size 162.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec33c79dc400e14037def36761b5a0f24b1d7bc8c9f9481493a505493ba4f3d5
BLAKE2b-256 checksum
How to use checksums
d9dd4527418bc5a66f42e47f9aedb6e9af701b0c28b3c568c06ab7ee5074f38f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page