security-planning

Generate TM7 threat models and markdown reports from YAML security specs.

1.4k|284|Updated Nov 2, 2025
One-click install
npx skills add https://github.com/microsoft/hve-core --skill security-planning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-planning
Source: https://github.com/microsoft/hve-core/tree/main/.github/skills/project-planning/security-planning
Command: npx skills add https://github.com/microsoft/hve-core --skill security-planning

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyyaml, defusedxml, pywinauto, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Security teams need repeatable, reviewable threat models, but hand-authoring Microsoft Threat Modeling Tool (.tm7) files and STRIDE documentation is slow and error-prone. This Skill turns a vendor-neutral YAML/JSON threat-model spec into a deterministic .tm7 model plus a synchronized markdown report, with references for STRIDE analysis, NIST control mapping, and backlog handoff.

Core Features & Use Cases

  • Deterministic TM7 generation: Build .tm7 models that deserialize cleanly under the Microsoft Threat Modeling Tool's own DataContract serializer, with modes for pre-populated-comprehensive and diagram-only output.
  • Dual-output reporting: Emit a markdown STRIDE/NIST report from the same spec so reviewers get both the tool-native model and a readable document.
  • Native feedback loop: Optionally validate and refine diagram layout on Windows using the pinned Threat Modeling Tool 7.3.51110.1, UI Automation, screenshots, and a human-reviewed overlay contract.
  • Planning references: Load operational bucket guidance, STRIDE methodology, standards cross-references, NIST control families, data classification, and backlog formats on demand.
  • Use Case: Given a spec describing components, trust zones, data flows, threats, and mitigations, generate a .tm7 file and markdown report for a security review, then iterate on diagram layout with the native feedback loop before human approval.

Quick Start

Ask the agent to generate a TM7 threat model and markdown report from your threat-model spec using the security-planning skill's generate_tm7.py and generate_markdown.py scripts.

Frequently Asked Questions about security-planning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a TM7 threat model from a YAML spec?

Run scripts/generate_tm7.py with your spec file, an output path, and optionally a template profile and mode. The generator validates the spec, builds the model deterministically, and emits a .tm7 file that deserializes under the Threat Modeling Tool's own serializer.

How do I create a markdown threat model report alongside the TM7 file?

Run scripts/generate_markdown.py against the same spec used for TM7 generation. It produces a synchronized markdown report with STRIDE threat tables, NIST control-family mappings, abuse cases, data classification, and security test cases.

Does the TM7 feedback loop work on macOS or Linux?

No. The native visual feedback loop requires Windows with an interactive desktop session, UI Automation access, and the pinned Microsoft Threat Modeling Tool 7.3.51110.1. Base TM7 and markdown generation remain portable across platforms.

What Python dependencies does TM7 generation require?

Generation requires Python 3.11 or later with pyyaml and defusedxml, pinned in the skill's pyproject.toml. The optional Windows feedback loop adds pywinauto, and the dev group adds pytest, ruff, and pillow for testing.

Why does the feedback loop keep overlays in pending approval state?

Overlays stay in approval_state pending because visual scores are not semantic approval signals. A human reviewer must explicitly promote an overlay after review; no runtime flag auto-promotes it or rewrites the canonical baseline model.

What are the limitations of automated TM7 layout validation?

Deterministic geometry gates cannot detect label collisions or unreadable label text because TM7 persists no connector label geometry. An agent-assisted visual review of screenshots handles those defects, but the remedy is documented rather than proven end to end.