Research & Analysisπ€claudeβ¨οΈcursorπuniversal
AI-Assisted Threat Modeling Framework
A collection of rule and instruction sets for AI systems such as GitHub copilot and Cursor to perform generalized, structured, threat models based on a target set of documentation files.
Quick Start
Install this Skill
npx skills add ensingm2/AI-threat-modeling-rulesets# AI-Assisted Threat Modeling Framework
A structured instruction set for guiding AI agents through comprehensive security threat modeling.
> **β οΈ AI Disclaimer:** AI outputs are NOT guaranteed to be accurate or complete. LLMs hallucinate and make errors. **All outputs MUST be reviewed by qualified security professionals.** This tool augmentsβnot replacesβhuman expertise.
> **π Status:** Developed for **Cursor** with **Claude** models. Tested primarily in Automatic mode. Collaborative mode and diverse system types need further validation. The complete process is resource-intensiveβpremium AI plans recommended.
---
## Quick Start
1. **Clone** this repository
2. **Open Workspace** in Cursor IDE or CLI (or compatible AI editor)
3. **Place target documentation** in `targets/[system-name]/external-resources/`
4. **Initiate** by prompting: `"Perform a threat model on ./targets/[system-name]/"`
5. **Select options** when asked (see below)
### Startup Selections
The agent will prompt you to select **both** operational mode and critic review preference before starting:

| Mode | Description |
|------|-------------|
| **Collaborative** | User answers questions, reviews/approves each stage |
| **Automatic** | Fully autonomous, uses provided documentation only |
| Critic Review | Description |
|---------------|-------------|
| **Without Critic** *(Recommended)* | Direct execution, 50-75% faster |
| **With Critic** | Adversarial validation after each stage (better suited for future multi-agent setups) |
---
## Methodology
### 6-Stage Process
| Stage | Output | Description |
|-------|--------|-------------|
| 1 | `01-system-understanding.md` | Architecture, components, trust boundaries |
| 2 | `02-data-flow-analysis.md` | DFDs, data flows, attack surfaces |
| 3 | `03-threat-identification.md` | STRIDE + MITRE ATT&CK + Kill Chain analysis |
| 4 | `04-risk-assessment.md` | Risk scoring and prioritization |
| 5 | `05-mitigation-strategy.md` | Security controls and roadmap |
| 6 | `00-final-report.md` | Executive-ready consolidated report |
### Key Principles
- **Evidence-based**: All claims traced to source documentation
- **Confidence-calibrated**: HIGH/MEDIUM/LOW/INSUFFICIENT levels
- **No fabrication**: Unknown details acknowledged, not invented
- **Multi-framework**: Integrates STRIDE, MITRE ATT&CK, and Cyber Kill Chain
---
## Repository Structure
```
.ai-instructions/ # Framework instructions
βββ core/entry-point.md # Central entry point
βββ modes/ # Collaborative & Automatic mode configs
βββ skills/ # Modular skills framework
βββ workflow-guide.md
βββ documentation-specialist/ # Stages 1, 2, 6
βββ threat-modeler/ # Stages 3-6
βββ quality-critic/ # Validation (optional)
βββ shared/ # Terminology, confidence levels
targets/[system-name]/
βββ external-resources/ # Place target documentation here
βββ output/threat-model/ # Generated outputs
```
### Example Output
See `targets/example-quickdeliver/` for a complete example threat model output, including all 6 stages and supporting JSON working documents.
---
## Platform Support
| Platform | Loader File |
|----------|-------------|
| **Cursor** | `.cursorrules` (auto-loaded) |
| **GitHub Copilot** | `.github/copilot-instructions.md` |
---
## Known Limitations
- **Single-agent context sharing**: Critic retains worker context, reducing validation effectiveness
- **Numeric anchoring**: Agent may hit suggested ranges in instructions
---
## Potential Improvements
- Multi-agent architecture for true worker/critic separation
- Improved Data-Flow Diagram generation
- Final report formatting refinements
- Remove numeric anchors from instructions
---
## Related Resources
- [STRIDE](https://learn.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats) - Microsoft threat classification
- [MITRE ATT&CK](https://attack.mitre.org/) - Adversary tactics knowledge base
- [Cyber Kill Chain](https://www.lockheedmartin.com/en-us/capabilities/cyber/cyber-kill-chain.html) - Attack progression framework
---
## License
MIT License - See [LICENSE](LICENSE) for details.
**Created by:** Mike Ensing (ensingm2@gmail.com)
---
*This framework augments human security expertise but does not replace it. Always apply critical thinking to AI-generated threat models.*
Repository
9stars
0forks
Details
Related Skills
More research & analysis skills you might like
pr-improver
Research & AnalysisRuns an autonomous review-and-fix improvement loop over the current branch's changes until a PR review comes back clean, scoped mechanically to the directories the branch touched. Reviews are performed by an installed PR-review skill (default: pr-review-toolkit's review-pr). Use to fix review findings on a branch before opening or updating a pull request ('clean up this branch', 'fix this PR until review passes', 'run review-and-fix on my changes'). NOT for a one-time review β run the PR-review skill directly.
π€claudeπuniversal
7.5k
643
View
code-improver
Research & AnalysisRuns an autonomous review-and-fix improvement loop over any code target β a skill, plugin, module, or directory β using a reviewer the user names: any installed skill or agent. Keeps a cross-round findings ledger, escalates when fixes stop converging, and guards scope mechanically. Use when asked to 'improve this code until review passes', 'run an improvement loop with <reviewer>', or to iterate review-and-fix with a specific reviewer. For skills prefer the skill-improver entry; for a branch prefer pr-improver.
π€claudeπuniversal
7.5k
643
View
skill-improver
Research & AnalysisRuns an autonomous review-and-fix improvement loop over a Claude Code skill until a review comes back clean, with a cross-round findings ledger, escalation when fixes stop converging, and a mechanical scope guard. Reviews are performed by the plugin-dev skill-reviewer agent. Use to fix skill quality issues, iteratively refine a skill, or resume a loop after an escalation ('fix my skill', 'improve this skill until it passes review', 'skill improvement loop'). NOT for a one-time review β use the plugin-dev skill-reviewer agent directly.
π€claudeπuniversal
7.5k
643
View
audit-augmentation
Research & AnalysisAugments Trailmark code graphs with external audit findings from SARIF static analysis results, weAudit annotation files, and version-gated Trailmark 0.4.x binary-analysis graph exports. Maps findings to graph nodes by file and line overlap, creates severity-based subgraphs, and enables cross-referencing findings with pre-analysis data (blast radius, taint, etc.). Use when projecting SARIF results onto a code graph, overlaying weAudit annotations, importing binary graph findings, cross-referencing Semgrep, CodeQL, or binary-analysis findings with call graph data, or visualizing audit findings in the context of code structure.
πuniversal
7.5k
643
View