Python-based threat modeling using pytm library for programmatic STRIDE analysis, data flow diagram generation, and automated security threat identification.

Custom licenceAuto-check: notesSecurity

Install Pytm

skills CLI
$ npx skills add AgentSecOps/SecOpsAgentKit --skill pytm -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AgentSecOps/SecOpsAgentKit pytm --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AgentSecOps/SecOpsAgentKit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/threatmodel/pytm .claude/skills/pytm && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pytm
GitHub stars
219
Used in
2 other repos
Token cost
~4.4k tokens
SKILL.md length
941 words
Files
1
Skills in repo
24
Repo updated
First seen
Licence
Custom licence

At a glance

Python-based threat modeling using pytm library for programmatic STRIDE analysis, data flow diagram generation, and automated security threat identification.

  • Works in 5 steps: Review threat description and affected… → Assess likelihood and impact (use… → Determine if existing controls mitigate… → …
  • Creating threat models programmatically using Python code
  • SKILL.md covers Overview, Quick Start, Core Workflows and Security Considerations, plus 4 more sections
  • Calls brew, python and pip

What it does

Pytm is an agent skill from AgentSecOps/SecOpsAgentKit. Python-based threat modeling using pytm library for programmatic STRIDE analysis, data flow diagram generation, and automated security threat identification. Use when: (1) Creating threat models programmatically using Python code, (2) Generating data flow diagrams (DFDs) with automatic STRIDE threat identification, (3) Integrating threat modeling into CI/CD pipelines and shift-left security practices, (4) Analyzing system architecture for security threats across trust boundaries, (5) Producing threat reports with…

Its SKILL.md is about 4.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Security, covering Threat modeling. It works with Python. The repository describes itself as: Security operations toolkit for AI coding agents. Give Claude Code 25+ skills to catch vulnerabilities, scan containers, detect secrets, and enforce policies automatically.

When your agent uses it

  • Creating threat models programmatically using Python code
  • Generating data flow diagrams (DFDs) with automatic STRIDE threat identification
  • Integrating threat modeling into CI/CD pipelines and shift-left security practices
  • Analyzing system architecture for security threats across trust boundaries

Example prompts

  • “/pytm”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Review threat description and affected component
  2. Assess likelihood and impact (use references/risk_matrix.md)
  3. Determine if existing controls mitigate the threat
  4. Add mitigation using threat.mitigation = "description"
  5. Document residual risk and acceptance criteria

What it can do on your machine

Read from SKILL.md and the folder at commit 6e25a4b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • brew
    • python
    • pip
    • apt-get

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • owasp.org
    • microsoft.com
    • attack.mitre.org
    • threatmodelingmanifesto.org
    • csrc.nist.gov

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pytm loads about 4.4k tokens when it runs. Until then it costs about 162 tokens; SKILL.md has 941 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~162
When it runs · the whole SKILL.md, loaded when a task matches
~4.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteRuns commands with sudoSKILL.md:188
    sudo apt-get install -y graphviz
  • NoteRuns commands with sudoSKILL.md:458
    sudo apt-get install graphviz  # Linux

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 941 words (~4,423 tokens).

“pytm is a Python library for programmatic threat modeling based on the STRIDE methodology. It enables security engineers to define system architecture as code, automatically generate data flow diagrams (DFDs), identify security threats across trust boundaries, and produce comprehensive threat…”

— opening of SKILL.md by AgentSecOps, Custom licence
name
pytm
version
0.1.0
maintainer
SirAppSec
category
threatmodel
tags
threat-modeling, stride, dfd, security-architecture, pytm, appsec, risk-analysis
frameworks
STRIDE, OWASP, MITRE-ATT&CK, NIST
dependencies.python
>=3.7
dependencies.packages
pytm, graphviz
references
https://github.com/izar/pytm, https://owasp.org/www-community/Threat_Modeling, https://www.microsoft.com/en-us/security/blog/2007/09/11/stride-chart/…

Read the full SKILL.md on GitHub

Files

Just SKILL.md in skills/threatmodel/pytm of AgentSecOps/SecOpsAgentKit.

Open the folder on GitHubat commit 6e25a4b

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in AgentSecOps/SecOpsAgentKit, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Pytm next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pytm compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pytm this skillAgentSecOps/SecOpsAgentKit2192 repos~4.4kAutomated safety check: NotesCustom licence
Implementing Container Image Minimal Base With Distrolessmukul975/Anthropic-Cybersecurity-Skills34k—~1.7kAutomated safety check: PassApache-2.0
Fla Ascend Performancefla-org/flash-linear-attention5.8k—~5.6kAutomated safety check: PassMIT
C To AstNarwhal-Lab/MagicSkills316—~1.1kAutomated safety check: PassMIT
Forensifyalexgreensh/repo-forensics187—~2.5kAutomated safety check: NotesCustom licence
Security AuditTheDecipherist/claude-code-mastery550—~1.3kAutomated safety check: NotesMIT

Similar skills

  • Implementing Container Image Minimal Base With Distroless

    mukul975/Anthropic-Cybersecurity-Skills

    Reduces container attack surface by building application images on Google distroless base images that ship only the application runtime - no shell, package manager, or OS utilities - using…

    34k GitHub stars~1.7k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Fla Ascend Performance

    fla-org/flash-linear-attention

    Guidelines for Ascend NPU kernel / Triton-Ascend backend performance work in the FLA repo.

    5.8k GitHub stars~5.6k tokensUpdated yesterday
    SecurityAuto-check passed
  • C To Ast

    Narwhal-Lab/MagicSkills

    Parse C source code into an Abstract Syntax Tree (AST). An agent skill from Narwhal-Lab/MagicSkills.

    316 GitHub stars~1.1k tokensUpdated 6 mo ago
    SecurityAuto-check passed
  • Forensify

    alexgreensh/repo-forensics

    Cross-agent self-inspection of your AI-agent stack. An agent skill from alexgreensh/repo-forensics.

    187 GitHub stars~2.5k tokensUpdated 10 days ago
    SecurityAuto-check: notes
  • Security Audit

    TheDecipherist/claude-code-mastery

    Checks a codebase for hardcoded secrets, vulnerable dependencies, weak input handling, weak authentication and unsafe transport settings before deployment or merge.

    550 GitHub stars~1.3k tokensUpdated 5 mo ago
    SecurityAuto-check: notes
  • Create Rule

    cartography-cncf/cartography

    Author a Cartography security rule (one or more Cypher Facts plus a Pydantic Finding output model) under cartography/rules/data/rules/.

    4.1k GitHub stars~3k tokensUpdated today
    SecurityAuto-check passed

More from AgentSecOps/SecOpsAgentKit

All 24 skills in this repo
  • Sast Semgrep

    AgentSecOps/SecOpsAgentKit

    Static application security testing (SAST) using Semgrep for vulnerability detection, security code review, and secure coding guidance with OWASP and CWE framework mapping.

    219 GitHub starsUsed in 2 repos~2.4k tokens
    Auto-check passed
  • Secrets Gitleaks

    AgentSecOps/SecOpsAgentKit

    Hardcoded secret detection and prevention in git repositories and codebases using Gitleaks.

    219 GitHub starsUsed in 2 repos~4.1k tokens
    Auto-check passed
  • DefectDojo Vulnerability Management

    AgentSecOps/SecOpsAgentKit

    Aggregates scanner results into DefectDojo, deduplicates findings, tracks remediation SLAs and prepares compliance reports across products and pipelines.

    219 GitHub stars~2.3k tokensUpdated 5 mo ago
    Auto-check passed
  • TShark Traffic Analysis

    AgentSecOps/SecOpsAgentKit

    Guides authorized packet capture and analysis with TShark, Wireshark's command-line tool, for security investigations, malware detection and forensic examination of network traffic.

    219 GitHub starsUsed in 1 repo~4.8k tokens
    Auto-check: notes
  • Container Scanning with Grype

    AgentSecOps/SecOpsAgentKit

    Scans container images, filesystems and SBOMs with Grype for known vulnerabilities, ranks them by CVSS, EPSS and CISA KEV, and wires scans into CI/CD thresholds.

    219 GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Hadolint Dockerfile Security Linting

    AgentSecOps/SecOpsAgentKit

    Lints Dockerfiles with Hadolint for security misconfigurations and best-practice violations, locally and in CI, with strict, balanced and permissive rule templates.

    219 GitHub starsUsed in 1 repo~4.4k tokens
    Auto-check passed

Works with

Categories

Questions about Pytm

What does Pytm do?

Python-based threat modeling using pytm library for programmatic STRIDE analysis, data flow diagram generation, and automated security threat identification. Pytm is an agent skill from AgentSecOps/SecOpsAgentKit. Python-based threat modeling using pytm library for programmatic STRIDE analysis, data flow diagram generation, and automated security threat identification.

When should I use Pytm?

Pytm fits situations like: creating threat models programmatically using Python code; generating data flow diagrams (DFDs) with automatic STRIDE threat identification; integrating threat modeling into CI/CD pipelines and shift-left security practices; analyzing system architecture for security threats across trust boundaries.

How do I install Pytm in Claude Code?

Run `npx skills add AgentSecOps/SecOpsAgentKit --skill pytm -a claude-code`. Or copy the skill folder (skills/threatmodel/pytm in AgentSecOps/SecOpsAgentKit) into .claude/skills/pytm in your project. Claude Code loads it when a task matches its description.

How do I install Pytm in Codex?

Run `npx skills add AgentSecOps/SecOpsAgentKit --skill pytm -a codex`. Or copy the skill folder (skills/threatmodel/pytm in AgentSecOps/SecOpsAgentKit) into .agents/skills/pytm in your project. Codex loads it when a task matches its description.

Can I use Pytm in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AgentSecOps/SecOpsAgentKit --skill pytm -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pytm, .gemini/skills/pytm, .github/skills/pytm and .opencode/skills/pytm in your project.

What does Pytm need to run?

Going by SKILL.md and its folder, Pytm needs the command-line tools its instructions call (brew, python, pip and apt-get). Our summary lists: Python 3.

Does Pytm access the network?

SKILL.md names 6 domains. As links in the text: github.com, owasp.org, microsoft.com, attack.mitre.org, threatmodelingmanifesto.org and csrc.nist.gov. This is read from the text; nothing was executed.

Is Pytm safe to install?

Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Pytm use?

Pytm has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Pytm use?

About 4.4k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Pytm?

Skills that share tags, products or a category with Pytm: Implementing Container Image Minimal Base With Distroless (mukul975/Anthropic-Cybersecurity-Skills, 34k stars), Fla Ascend Performance (fla-org/flash-linear-attention, 5.8k stars), C To Ast (Narwhal-Lab/MagicSkills, 316 stars) and Forensify (alexgreensh/repo-forensics, 187 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pytm?

AgentSecOps (a GitHub organization) maintains it in AgentSecOps/SecOpsAgentKit, which has 219 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on April 15, 2026.

Source: AgentSecOps/SecOpsAgentKit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.