torusguard 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/.torusguard/.manifest.json +55 -5
  2. package/.torusguard/core/__init__.py +146 -0
  3. package/.torusguard/core/agent_roles.py +104 -0
  4. package/.torusguard/core/ast_walker.py +283 -0
  5. package/.torusguard/core/authorization.py +218 -0
  6. package/.torusguard/core/browser_verifier.py +128 -0
  7. package/.torusguard/core/bundle.py +141 -0
  8. package/.torusguard/core/call_graph.py +184 -0
  9. package/.torusguard/core/clustering.py +275 -0
  10. package/.torusguard/core/confidence.py +120 -0
  11. package/.torusguard/core/cross_file_taint.py +101 -0
  12. package/.torusguard/core/exploit_checker.py +317 -0
  13. package/.torusguard/core/formatter.py +351 -0
  14. package/.torusguard/core/governance.py +210 -0
  15. package/.torusguard/core/identity.py +104 -0
  16. package/.torusguard/core/import_resolver.py +91 -0
  17. package/.torusguard/core/incremental.py +102 -0
  18. package/.torusguard/core/lifecycle.py +137 -0
  19. package/.torusguard/core/models.py +425 -0
  20. package/.torusguard/core/parallel.py +56 -0
  21. package/.torusguard/core/parser.py +202 -0
  22. package/.torusguard/core/rechecker.py +107 -0
  23. package/.torusguard/core/replay_trace.py +178 -0
  24. package/.torusguard/core/rules_registry.py +131 -0
  25. package/.torusguard/core/run_folder.py +60 -0
  26. package/.torusguard/core/run_manager.py +163 -0
  27. package/.torusguard/core/runtime_evidence.py +175 -0
  28. package/.torusguard/core/runtime_validator.py +246 -0
  29. package/.torusguard/core/safety_gate.py +139 -0
  30. package/.torusguard/core/sarif.py +189 -0
  31. package/.torusguard/core/stack_profiler.py +184 -0
  32. package/.torusguard/core/symbol_table.py +91 -0
  33. package/.torusguard/core/taint.py +133 -0
  34. package/.torusguard/core/taint_graph.py +235 -0
  35. package/.torusguard/core/taint_rules.py +268 -0
  36. package/.torusguard/core/v070_reporter.py +102 -0
  37. package/.torusguard/core/v070_workflow.py +339 -0
  38. package/.torusguard/core/v6_reporter.py +180 -0
  39. package/.torusguard/core/v6_workflow.py +221 -0
  40. package/.torusguard/core/watcher.py +58 -0
  41. package/.torusguard/custom_rules/README.md +24 -0
  42. package/.torusguard/rules/TG-INPUT-007-unvalidated-redirect.md +53 -0
  43. package/.torusguard/rules/TG-INPUT-008-insecure-deserialization.md +52 -0
  44. package/.torusguard/scripts/__pycache__/audit_runner.cpython-314.pyc +0 -0
  45. package/.torusguard/scripts/__pycache__/finding_scorer.cpython-314.pyc +0 -0
  46. package/.torusguard/scripts/__pycache__/manifest_builder.cpython-314.pyc +0 -0
  47. package/.torusguard/scripts/__pycache__/rules_sync.cpython-314.pyc +0 -0
  48. package/.torusguard/scripts/audit_runner.py +108 -10
  49. package/.torusguard/scripts/deliberation_tournament.py +136 -0
  50. package/.torusguard/scripts/finding_scorer.py +43 -13
  51. package/.torusguard/scripts/reachability_analyzer.py +165 -0
  52. package/.torusguard/scripts/skill_profiler.py +26 -0
  53. package/.torusguard/scripts/stride_generator.py +198 -0
  54. package/.torusguard/skills/torusguard/SKILL.md +6 -2
  55. package/.torusguard/skills/torusguard-audit/SKILL.md +109 -84
  56. package/.torusguard/skills/torusguard-review/SKILL.md +27 -0
  57. package/.torusguard/skills/torusguard-threatmodel/SKILL.md +27 -0
  58. package/.torusguard/workflows/audit.md +21 -17
  59. package/.torusguard/workflows/review.md +11 -0
  60. package/.torusguard/workflows/threatmodel.md +9 -0
  61. package/README.md +149 -48
  62. package/package.json +10 -2
  63. package/skills/torusguard/SKILL.md +6 -2
  64. package/skills/torusguard/__pycache__/bootstrap.cpython-314.pyc +0 -0
  65. package/skills/torusguard/bootstrap.py +3 -3
  66. package/skills/torusguard/payload/.manifest.json +56 -7
  67. package/skills/torusguard/payload/core/__init__.py +146 -0
  68. package/skills/torusguard/payload/core/agent_roles.py +104 -0
  69. package/skills/torusguard/payload/core/ast_walker.py +283 -0
  70. package/skills/torusguard/payload/core/authorization.py +218 -0
  71. package/skills/torusguard/payload/core/browser_verifier.py +128 -0
  72. package/skills/torusguard/payload/core/bundle.py +141 -0
  73. package/skills/torusguard/payload/core/call_graph.py +184 -0
  74. package/skills/torusguard/payload/core/clustering.py +275 -0
  75. package/skills/torusguard/payload/core/confidence.py +120 -0
  76. package/skills/torusguard/payload/core/cross_file_taint.py +101 -0
  77. package/skills/torusguard/payload/core/exploit_checker.py +317 -0
  78. package/skills/torusguard/payload/core/formatter.py +351 -0
  79. package/skills/torusguard/payload/core/governance.py +210 -0
  80. package/skills/torusguard/payload/core/identity.py +104 -0
  81. package/skills/torusguard/payload/core/import_resolver.py +91 -0
  82. package/skills/torusguard/payload/core/incremental.py +102 -0
  83. package/skills/torusguard/payload/core/lifecycle.py +137 -0
  84. package/skills/torusguard/payload/core/models.py +425 -0
  85. package/skills/torusguard/payload/core/parallel.py +56 -0
  86. package/skills/torusguard/payload/core/parser.py +202 -0
  87. package/skills/torusguard/payload/core/rechecker.py +107 -0
  88. package/skills/torusguard/payload/core/replay_trace.py +178 -0
  89. package/skills/torusguard/payload/core/rules_registry.py +131 -0
  90. package/skills/torusguard/payload/core/run_folder.py +60 -0
  91. package/skills/torusguard/payload/core/run_manager.py +163 -0
  92. package/skills/torusguard/payload/core/runtime_evidence.py +175 -0
  93. package/skills/torusguard/payload/core/runtime_validator.py +246 -0
  94. package/skills/torusguard/payload/core/safety_gate.py +139 -0
  95. package/skills/torusguard/payload/core/sarif.py +189 -0
  96. package/skills/torusguard/payload/core/stack_profiler.py +184 -0
  97. package/skills/torusguard/payload/core/symbol_table.py +91 -0
  98. package/skills/torusguard/payload/core/taint.py +133 -0
  99. package/skills/torusguard/payload/core/taint_graph.py +235 -0
  100. package/skills/torusguard/payload/core/taint_rules.py +268 -0
  101. package/skills/torusguard/payload/core/v070_reporter.py +102 -0
  102. package/skills/torusguard/payload/core/v070_workflow.py +339 -0
  103. package/skills/torusguard/payload/core/v6_reporter.py +180 -0
  104. package/skills/torusguard/payload/core/v6_workflow.py +221 -0
  105. package/skills/torusguard/payload/core/watcher.py +58 -0
  106. package/skills/torusguard/payload/custom_rules/README.md +15 -0
  107. package/skills/torusguard/payload/rules/TG-INPUT-007-unvalidated-redirect.md +53 -0
  108. package/skills/torusguard/payload/rules/TG-INPUT-008-insecure-deserialization.md +52 -0
  109. package/skills/torusguard/payload/rules/container/TG-CONT-001-root-user-execution.md +50 -50
  110. package/skills/torusguard/payload/rules/container/TG-CONT-002-docker-socket-mount.md +47 -47
  111. package/skills/torusguard/payload/rules/container/TG-CONT-003-privileged-container-mode.md +53 -53
  112. package/skills/torusguard/payload/rules/container/TG-CONT-004-build-arg-secret-exposure.md +43 -43
  113. package/skills/torusguard/payload/rules/git/TG-GIT-001-historical-secret-in-git-commit.md +44 -44
  114. package/skills/torusguard/payload/rules/git/TG-GIT-002-plaintext-credentials-in-git-config.md +41 -41
  115. package/skills/torusguard/payload/rules/git/TG-GIT-003-sensitive-tracked-file-gitignore-breach.md +40 -40
  116. package/skills/torusguard/payload/rules/rag/TG-RAG-001-untrusted-rag-context-injection.md +72 -72
  117. package/skills/torusguard/payload/rules/rag/TG-RAG-002-autonomous-llm-tool-unsandboxed-call.md +51 -51
  118. package/skills/torusguard/payload/rules/rag/TG-RAG-003-unpartitioned-vector-tenant-lookup.md +51 -51
  119. package/skills/torusguard/payload/rules/redos/TG-REDOS-001-catastrophic-exponential-backtracking.md +46 -46
  120. package/skills/torusguard/payload/rules/redos/TG-REDOS-002-unbounded-nested-quantifier.md +43 -43
  121. package/skills/torusguard/payload/scripts/audit_runner.py +108 -10
  122. package/skills/torusguard/payload/scripts/deliberation_tournament.py +127 -0
  123. package/skills/torusguard/payload/scripts/finding_scorer.py +43 -13
  124. package/skills/torusguard/payload/scripts/reachability_analyzer.py +164 -0
  125. package/skills/torusguard/payload/scripts/stride_generator.py +196 -0
  126. package/skills/torusguard/payload/skills/torusguard/SKILL.md +6 -2
  127. package/skills/torusguard/payload/skills/torusguard/bootstrap.py +3 -3
  128. package/skills/torusguard/payload/skills/torusguard-ai-guard/SKILL.md +95 -95
  129. package/skills/torusguard/payload/skills/torusguard-audit/SKILL.md +109 -84
  130. package/skills/torusguard/payload/skills/torusguard-container/SKILL.md +94 -94
  131. package/skills/torusguard/payload/skills/torusguard-git-mine/SKILL.md +92 -92
  132. package/skills/torusguard/payload/skills/torusguard-ocr-scan/SKILL.md +94 -94
  133. package/skills/torusguard/payload/skills/torusguard-redos/SKILL.md +91 -91
  134. package/skills/torusguard/payload/skills/torusguard-review/SKILL.md +27 -0
  135. package/skills/torusguard/payload/skills/torusguard-threatmodel/SKILL.md +27 -0
  136. package/skills/torusguard/payload/workflows/ai-guard.md +31 -31
  137. package/skills/torusguard/payload/workflows/audit.md +21 -17
  138. package/skills/torusguard/payload/workflows/container.md +29 -29
  139. package/skills/torusguard/payload/workflows/git-mine.md +25 -25
  140. package/skills/torusguard/payload/workflows/ocr-scan.md +25 -25
  141. package/skills/torusguard/payload/workflows/redos.md +27 -27
  142. package/skills/torusguard/payload/workflows/review.md +11 -0
  143. package/skills/torusguard/payload/workflows/threatmodel.md +9 -0
  144. package/skills/torusguard/payload/workflows/torusguard-audit.md +35 -55
  145. package/skills/torusguard/references/csharp-security.md +41 -41
  146. package/skills/torusguard/references/go-security.md +41 -41
  147. package/skills/torusguard/references/java-security.md +40 -40
  148. package/skills/torusguard/references/polyglot-security-matrix.md +25 -25
  149. package/skills/torusguard/references/rust-security.md +40 -40
  150. package/skills/torusguard-audit/SKILL.md +107 -83
  151. package/skills/torusguard-review/SKILL.md +27 -0
  152. package/skills/torusguard-threatmodel/SKILL.md +27 -0
@@ -1,91 +1,91 @@
1
- ---
2
- name: torusguard-redos
3
- description: Analyzes regular expressions across JavaScript, TypeScript, Python, and Go for catastrophic exponential backtracking and ReDoS vulnerabilities via CLI, Chat, or MCP.
4
- version: 2.0.0
5
- workflow: .torusguard/workflows/redos.md
6
- tools: Read, Grep, Glob, Write, run_command
7
- scripts-binding:
8
- - internal/scanner/redos.go
9
- - cmd/torusguard/main.go
10
- - cmd/torusguard/mcp.go
11
- ---
12
-
13
- # TorusGuard ReDoS Complexity Scanner
14
-
15
- ## Objective
16
- Detect and remediate catastrophic exponential ($O(2^n)$) and polynomial ($O(n^k)$) backtracking regular expressions in web applications. Prevents thread starvation, CPU exhaustion, and availability denial of service attacks caused by untrusted user input matching evil regex patterns.
17
-
18
- ---
19
-
20
- ## Tri-Mode Execution
21
-
22
- ### Mode A: Automated CLI Execution
23
- Run ReDoS scanning against source code files:
24
- ```bash
25
- # Scan current workspace for catastrophic regex backtracking
26
- torusguard redos
27
-
28
- # Scan specific directory or source tree
29
- torusguard redos --target ./src
30
- ```
31
-
32
- ### Mode B: In-Session AI Chat Slash Command
33
- Run `/torusguard redos` in chat.
34
- The agent executes the compiled Go ReDoS analyzer or MCP tool to locate dangerous nested quantifiers, overlapping alternations, and unanchored expressions.
35
-
36
- ### Mode C: Native MCP Tool Call
37
- MCP-enabled coding agents (Antigravity, Cursor, Windsurf, Claude Code) call:
38
- ```json
39
- {
40
- "tool": "torusguard_redos",
41
- "arguments": {
42
- "target": "."
43
- }
44
- }
45
- ```
46
-
47
- ---
48
-
49
- ## Supported Patterns & Invariants
50
- - **TG-REDOS-001 (Nested Quantifier Catastrophic Backtracking):** Detects nested repetitions such as `(a+)+`, `([a-zA-Z0-9]+)*`, or `((foo)*)+` that cause exponential evaluation time $O(2^n)$ when matching non-matching suffixes (e.g. `aaaaaaaaaaaaaaaa!`).
51
- - **TG-REDOS-002 (Overlapping Alternation with Outer Repetition):** Detects patterns like `(a|ab)+` or `(user|username)*` where multiple branches match identical prefixes, causing exponential branch exploration.
52
-
53
- ---
54
-
55
- ## 🏛️ OpenCodeReview Hybrid Architecture Integration
56
- - **First-Principles NFA/DFA Complexity Analysis:** Scans regex literals and constructor invocations across JS, TS, Python, and Go.
57
- - **Engine-Aware Triage:** Flags backtracking engines (V8, Node.js, Python `re`, PCRE) as high risk while noting linear-time DFA engines (Go `regexp`/RE2, Rust `regex`).
58
- - **Surgical Patching:** Replaces evil regexes with bounded, non-overlapping expressions or length pre-checks (≤35 additions, ≤25 deletions).
59
-
60
- ---
61
-
62
- ## 🚨 LLM Trap Table
63
-
64
- | Pattern | What AI Does Wrong | What Is Actually Correct |
65
- | :--- | :--- | :--- |
66
- | **Nested Quantifiers** | Writes `([a-zA-Z0-9_]+)*` or `(https?://.+)*`, causing $O(2^n)$ catastrophic backtracking on malicious input. | Flatten expressions: `[a-zA-Z0-9_]*` or use non-overlapping delimiters like `[^/\s]+`. |
67
- | **Overlapping Alternation** | Combines overlapping options inside repetition: `(a\|aa)+` or `(\w+\|\d+)+`. | Disjoint branch design: ensure alternatives cannot consume the same character prefix. |
68
- | **Missing Input Length Guards** | Evaluates complex regexes against arbitrarily long input strings from untrusted HTTP bodies. | Impose input bounds (`if (input.length > 256) return false`) before regex evaluation. |
69
- | **Unanchored Wildcards** | Writes `.*foo.*` without anchors, leading to quadratic scan across long documents. | Anchor patterns with `^` and `$` whenever full string matching is intended. |
70
- | **Engine Indifference** | Assumes all regex engines backtrack identically; doesn't know Go RE2 is linear $O(n)$ while Node V8 is vulnerable. | Tailor remediation to target runtime: use atomic groups/lookahead in V8/Python or switch to parser combinators. |
71
-
72
- ---
73
-
74
- ## ✅ Pre-Flight Self-Audit
75
-
76
- Before concluding a ReDoS complexity audit, verify:
77
- - [ ] Were all regex literals and `RegExp` / `re.compile` declarations inspected?
78
- - [ ] Are any nested quantifiers (`(x+)+`, `(x*)*`) present in the codebase?
79
- - [ ] Are alternatives in grouped alternations strictly mutually exclusive?
80
- - [ ] Is untrusted input strictly bounded in length before regex execution?
81
- - [ ] Are remediations validated within Ponytail diff bounds?
82
-
83
- ---
84
-
85
- ## 🔁 VBC Protocol (Verify → Build → Confirm)
86
-
87
- ```
88
- VERIFY: Identify regex patterns evaluated on untrusted user inputs.
89
- BUILD: Execute torusguard redos or torusguard_redos to detect exponential backtracking structures.
90
- CONFIRM: Refactor pattern into deterministic, non-overlapping tokens, adding length guards and testing with evil payloads.
91
- ```
1
+ ---
2
+ name: torusguard-redos
3
+ description: Analyzes regular expressions across JavaScript, TypeScript, Python, and Go for catastrophic exponential backtracking and ReDoS vulnerabilities via CLI, Chat, or MCP.
4
+ version: 2.0.0
5
+ workflow: .torusguard/workflows/redos.md
6
+ tools: Read, Grep, Glob, Write, run_command
7
+ scripts-binding:
8
+ - internal/scanner/redos.go
9
+ - cmd/torusguard/main.go
10
+ - cmd/torusguard/mcp.go
11
+ ---
12
+
13
+ # TorusGuard ReDoS Complexity Scanner
14
+
15
+ ## Objective
16
+ Detect and remediate catastrophic exponential ($O(2^n)$) and polynomial ($O(n^k)$) backtracking regular expressions in web applications. Prevents thread starvation, CPU exhaustion, and availability denial of service attacks caused by untrusted user input matching evil regex patterns.
17
+
18
+ ---
19
+
20
+ ## Tri-Mode Execution
21
+
22
+ ### Mode A: Automated CLI Execution
23
+ Run ReDoS scanning against source code files:
24
+ ```bash
25
+ # Scan current workspace for catastrophic regex backtracking
26
+ torusguard redos
27
+
28
+ # Scan specific directory or source tree
29
+ torusguard redos --target ./src
30
+ ```
31
+
32
+ ### Mode B: In-Session AI Chat Slash Command
33
+ Run `/torusguard redos` in chat.
34
+ The agent executes the compiled Go ReDoS analyzer or MCP tool to locate dangerous nested quantifiers, overlapping alternations, and unanchored expressions.
35
+
36
+ ### Mode C: Native MCP Tool Call
37
+ MCP-enabled coding agents (Antigravity, Cursor, Windsurf, Claude Code) call:
38
+ ```json
39
+ {
40
+ "tool": "torusguard_redos",
41
+ "arguments": {
42
+ "target": "."
43
+ }
44
+ }
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Supported Patterns & Invariants
50
+ - **TG-REDOS-001 (Nested Quantifier Catastrophic Backtracking):** Detects nested repetitions such as `(a+)+`, `([a-zA-Z0-9]+)*`, or `((foo)*)+` that cause exponential evaluation time $O(2^n)$ when matching non-matching suffixes (e.g. `aaaaaaaaaaaaaaaa!`).
51
+ - **TG-REDOS-002 (Overlapping Alternation with Outer Repetition):** Detects patterns like `(a|ab)+` or `(user|username)*` where multiple branches match identical prefixes, causing exponential branch exploration.
52
+
53
+ ---
54
+
55
+ ## 🏛️ OpenCodeReview Hybrid Architecture Integration
56
+ - **First-Principles NFA/DFA Complexity Analysis:** Scans regex literals and constructor invocations across JS, TS, Python, and Go.
57
+ - **Engine-Aware Triage:** Flags backtracking engines (V8, Node.js, Python `re`, PCRE) as high risk while noting linear-time DFA engines (Go `regexp`/RE2, Rust `regex`).
58
+ - **Surgical Patching:** Replaces evil regexes with bounded, non-overlapping expressions or length pre-checks (≤35 additions, ≤25 deletions).
59
+
60
+ ---
61
+
62
+ ## 🚨 LLM Trap Table
63
+
64
+ | Pattern | What AI Does Wrong | What Is Actually Correct |
65
+ | :--- | :--- | :--- |
66
+ | **Nested Quantifiers** | Writes `([a-zA-Z0-9_]+)*` or `(https?://.+)*`, causing $O(2^n)$ catastrophic backtracking on malicious input. | Flatten expressions: `[a-zA-Z0-9_]*` or use non-overlapping delimiters like `[^/\s]+`. |
67
+ | **Overlapping Alternation** | Combines overlapping options inside repetition: `(a\|aa)+` or `(\w+\|\d+)+`. | Disjoint branch design: ensure alternatives cannot consume the same character prefix. |
68
+ | **Missing Input Length Guards** | Evaluates complex regexes against arbitrarily long input strings from untrusted HTTP bodies. | Impose input bounds (`if (input.length > 256) return false`) before regex evaluation. |
69
+ | **Unanchored Wildcards** | Writes `.*foo.*` without anchors, leading to quadratic scan across long documents. | Anchor patterns with `^` and `$` whenever full string matching is intended. |
70
+ | **Engine Indifference** | Assumes all regex engines backtrack identically; doesn't know Go RE2 is linear $O(n)$ while Node V8 is vulnerable. | Tailor remediation to target runtime: use atomic groups/lookahead in V8/Python or switch to parser combinators. |
71
+
72
+ ---
73
+
74
+ ## ✅ Pre-Flight Self-Audit
75
+
76
+ Before concluding a ReDoS complexity audit, verify:
77
+ - [ ] Were all regex literals and `RegExp` / `re.compile` declarations inspected?
78
+ - [ ] Are any nested quantifiers (`(x+)+`, `(x*)*`) present in the codebase?
79
+ - [ ] Are alternatives in grouped alternations strictly mutually exclusive?
80
+ - [ ] Is untrusted input strictly bounded in length before regex execution?
81
+ - [ ] Are remediations validated within Ponytail diff bounds?
82
+
83
+ ---
84
+
85
+ ## 🔁 VBC Protocol (Verify → Build → Confirm)
86
+
87
+ ```
88
+ VERIFY: Identify regex patterns evaluated on untrusted user inputs.
89
+ BUILD: Execute torusguard redos or torusguard_redos to detect exponential backtracking structures.
90
+ CONFIRM: Refactor pattern into deterministic, non-overlapping tokens, adding length guards and testing with evil payloads.
91
+ ```
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: torusguard-review
3
+ description: Differential PR and Git diff incremental security review — detects newly introduced vulnerabilities between Git branches or commits with net security score deltas.
4
+ tools: Read, Grep, Glob, Bash, Edit, Write
5
+ version: 2.1.2
6
+ last-updated: 2026-09-30
7
+ skills:
8
+ - torusguard
9
+ - torusguard-audit
10
+ ---
11
+
12
+ # TorusGuard Review — Differential Incremental PR Review
13
+
14
+ TorusGuard Review performs rapid, surgical security review on Git changes (e.g. against `HEAD~1`, `main`, or PR target branch), analyzing only modified lines to prevent introducing security regressions.
15
+
16
+ ## Invocation
17
+
18
+ - **Mode A (Terminal CLI):** `torusguard review [--diff <ref>]`
19
+ - **Mode B (AI Chat Slash Command):** `/torusguard review` or `/torusguard-review`
20
+ - **Mode C (Native MCP Tool):** `torusguard_review(target=".", diff_ref="HEAD~1")`
21
+
22
+ ## Core Capabilities
23
+
24
+ 1. **Sub-300ms Turnaround:** Only parses and checks modified/added lines in Git diffs.
25
+ 2. **Net Security Score Delta:** Tracks introduced vs. resolved vulnerabilities (`+0 Introduced, -2 Resolved`).
26
+ 3. **PR Gate Decision:** Blocks CI/CD pipelines if Critical or High severity flaws are introduced.
27
+ 4. **Alibaba OpenCodeReview Parity:** Outputs ready-to-post pull request inline review comments.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: torusguard-threatmodel
3
+ description: Synthesizes an architectural STRIDE threat model, interactive Mermaid Data Flow Diagram (DFD), and trust boundary register into SECURITY_THREAT_MODEL.md.
4
+ tools: Read, Grep, Glob, Bash, Edit, Write
5
+ version: 2.1.2
6
+ last-updated: 2026-09-30
7
+ skills:
8
+ - torusguard
9
+ - torusguard-audit
10
+ ---
11
+
12
+ # TorusGuard Threat Model — STRIDE & DFD Synthesizer
13
+
14
+ TorusGuard Threat Model automatically maps routes, trust boundaries, datastores, and egress sinks to construct an architectural Data Flow Diagram and formal STRIDE threat model.
15
+
16
+ ## Invocation
17
+
18
+ - **Mode A (Terminal CLI):** `torusguard threatmodel`
19
+ - **Mode B (AI Chat Slash Command):** `/torusguard threatmodel` or `/torusguard-threatmodel`
20
+ - **Mode C (Native MCP Tool):** `torusguard_threatmodel(target=".")`
21
+
22
+ ## Core Capabilities
23
+
24
+ 1. **Automated DFD Generation:** Renders interactive Mermaid diagram showing Zones 1–4 (Clients, Gateways, Core Services, Datastores).
25
+ 2. **STRIDE Risk Ledger:** Evaluates threats across Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege.
26
+ 3. **Multi-Modal Vision Integration:** Discovers architectural diagrams and verifies that visual trust boundaries match code execution paths.
27
+ 4. **Living Compliance Artifact:** Emits `SECURITY_THREAT_MODEL.md` at workspace root.
@@ -1,31 +1,31 @@
1
- # /torusguard-ai-guard — AI Application & RAG Pipeline Guard
2
-
3
- $ARGUMENTS
4
-
5
- ---
6
-
7
- ## Objective
8
- Detect and remediate prompt injection, unsandboxed autonomous tool executions, and cross-tenant vector contamination across AI agent and RAG architectures.
9
-
10
- ---
11
-
12
- ## Tri-Mode Parity
13
- - **Mode A (Terminal CLI):** `torusguard ai-guard [target]`
14
- - **Mode B (AI Chat Slash Command):** `/torusguard ai-guard [target]`
15
- - **Mode C (Native MCP Tool):** `torusguard_ai_guard`
16
-
17
- ---
18
-
19
- ## Execution Steps
20
-
21
- 1. **Discover LLM & Agent Call Sites:** Locate AI framework usage (OpenAI, Anthropic, LangChain, LlamaIndex, Vercel AI SDK).
22
- 2. **Audit Prompt Templates:**
23
- - Detect raw user string concatenation into system instructions (`TG-AGENT-001`).
24
- - Flag raw document chunk ingestion in RAG without inert delimiters (`TG-RAG-002`).
25
- 3. **Audit Tool Registry & Dispatchers:**
26
- - Check for unsandboxed shell, file, or database tool calls lacking Human Gates (`TG-AGENT-002`).
27
- - Enforce Zod/Pydantic schema validation on all tool argument payloads (`TG-AGENT-003`).
28
- 4. **Audit Vector Store Queries:**
29
- - Assert all similarity searches (`pgvector`, `pinecone`, `qdrant`, `chroma`) include tenant/user metadata filters (`TG-RAG-001`).
30
- - Flag ingestion of unvalidated external document payloads (`TG-RAG-003`).
31
- 5. **Formulate Patches & Synchronize:** Propose surgical fixes and record findings in `security_report.md`.
1
+ # /torusguard-ai-guard — AI Application & RAG Pipeline Guard
2
+
3
+ $ARGUMENTS
4
+
5
+ ---
6
+
7
+ ## Objective
8
+ Detect and remediate prompt injection, unsandboxed autonomous tool executions, and cross-tenant vector contamination across AI agent and RAG architectures.
9
+
10
+ ---
11
+
12
+ ## Tri-Mode Parity
13
+ - **Mode A (Terminal CLI):** `torusguard ai-guard [target]`
14
+ - **Mode B (AI Chat Slash Command):** `/torusguard ai-guard [target]`
15
+ - **Mode C (Native MCP Tool):** `torusguard_ai_guard`
16
+
17
+ ---
18
+
19
+ ## Execution Steps
20
+
21
+ 1. **Discover LLM & Agent Call Sites:** Locate AI framework usage (OpenAI, Anthropic, LangChain, LlamaIndex, Vercel AI SDK).
22
+ 2. **Audit Prompt Templates:**
23
+ - Detect raw user string concatenation into system instructions (`TG-AGENT-001`).
24
+ - Flag raw document chunk ingestion in RAG without inert delimiters (`TG-RAG-002`).
25
+ 3. **Audit Tool Registry & Dispatchers:**
26
+ - Check for unsandboxed shell, file, or database tool calls lacking Human Gates (`TG-AGENT-002`).
27
+ - Enforce Zod/Pydantic schema validation on all tool argument payloads (`TG-AGENT-003`).
28
+ 4. **Audit Vector Store Queries:**
29
+ - Assert all similarity searches (`pgvector`, `pinecone`, `qdrant`, `chroma`) include tenant/user metadata filters (`TG-RAG-001`).
30
+ - Flag ingestion of unvalidated external document payloads (`TG-RAG-003`).
31
+ 5. **Formulate Patches & Synchronize:** Propose surgical fixes and record findings in `security_report.md`.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Static security AST scanning, stable line-shift invariant fingerprinting, root-cause clustering, and 0-100 confidence scoring.
2
+ description: Taint-aware static security AST scanning, cross-file interprocedural dataflow, 86+ rules across 22 families, and 7-signal calibrated confidence scoring.
3
3
  tools: Read, Grep, Glob, Bash, Write, run_command
4
4
  version: 2.0.0
5
5
  agent: auditor
@@ -7,19 +7,21 @@ lifecycle-phase: Phase 2 (Static Audit & Clustering)
7
7
  required-skills:
8
8
  - torusguard-audit
9
9
  scripts-binding:
10
- - internal/scanner/scanner.go
11
- - cmd/torusguard/main.go
12
- - cmd/torusguard/mcp.go
10
+ - .torusguard/scripts/audit_runner.py
11
+ - .torusguard/scripts/finding_scorer.py
12
+ - .torusguard/core/cross_file_taint.py
13
+ - .torusguard/core/confidence.py
14
+ - .torusguard/core/incremental.py
13
15
  ---
14
16
 
15
- # /torusguard audit — Static Security Code Scan & Clustering
17
+ # /torusguard audit — Deep Taint-Aware Static Security Code Scan & Clustering
16
18
 
17
19
  $ARGUMENTS
18
20
 
19
21
  ---
20
22
 
21
23
  ## Objective
22
- Execute static AST analysis across polyglot project files, evaluate code against 74 canonical security rules across 18 families, assign stable line-shift invariant fingerprints, cluster architectural root causes, synchronize findings with `security_report.md`, and score findings with auditable 0–100 confidence ratings.
24
+ Execute deep taint-aware static AST analysis across polyglot project files, evaluate code against 86+ canonical security rules across 22 families, trace interprocedural source-to-sink dataflows, assign stable line-shift invariant fingerprints, cluster architectural root causes, synchronize findings with `security_report.md`, and score findings with auditable 7-signal evidence-chain confidence ratings.
23
25
 
24
26
  ---
25
27
 
@@ -27,7 +29,7 @@ Execute static AST analysis across polyglot project files, evaluate code against
27
29
 
28
30
  | Mode | Command / Tool | Execution Method |
29
31
  | :--- | :--- | :--- |
30
- | **Mode A: Terminal CLI** | `torusguard audit [--include-tests] [--json]` | Shell execution of compiled Go binary. |
32
+ | **Mode A: Terminal CLI** | `torusguard audit [--incremental] [--watch] [--json]` | Shell execution of TorusGuard audit engine. |
31
33
  | **Mode B: AI Chat Slash** | `/torusguard audit` | Conversational guided audit with bounded context inspection. |
32
34
  | **Mode C: Native MCP Tool** | `torusguard_audit` | Autonomous agent tool invocation via stdio JSON-RPC. |
33
35
 
@@ -37,7 +39,7 @@ Execute static AST analysis across polyglot project files, evaluate code against
37
39
 
38
40
  Inspect workspace prerequisites before launching static audit:
39
41
  1. **Init State (`torusguard.json`):** Assert repository is initialized or run `torusguard init`.
40
- 2. **Active Rules (`rules/active/`):** Confirm rule definitions exist.
42
+ 2. **Active Rules (`rules/`):** Confirm rule definitions exist across the 22 architectural families.
41
43
  3. **Exclusions:** Assert `node_modules/`, `.venv/`, `dist/`, `.git/` are skipped.
42
44
  4. **Syntax Check:** Check for syntax errors before parsing ASTs.
43
45
 
@@ -52,13 +54,14 @@ Inspect workspace prerequisites before launching static audit:
52
54
  ## Execution Steps
53
55
 
54
56
  1. **Launch Audit Scan:**
55
- - **Mode A (CLI):** Run `torusguard audit` in terminal.
56
- - **Mode B (Chat):** Parse AST sinks using `grep_search` and bounded `ExtractContext`.
57
+ - **Mode A (CLI):** Run `torusguard audit` (or `python .torusguard/scripts/audit_runner.py`). Use `--incremental` for fast diffs.
58
+ - **Mode B (Chat):** Parse AST sinks and trace sources to sinks using `core.taint_graph` and bounded context windows.
57
59
  - **Mode C (MCP):** Call `torusguard_audit` with `{"target": "."}`.
58
- 2. **Scan Codebase ASTs:** Match 74 canonical rules across 18 families against source trees.
59
- 3. **Compute Stable Fingerprints:** Hash AST context to produce stable line-shift invariant IDs.
60
- 4. **Cluster Root Causes:** Group findings sharing identical sinks or causal architecture.
61
- 5. **Synchronize Ground Truth:** Update `security_report.md` at workspace root.
60
+ 2. **Scan Codebase ASTs:** Match 86+ canonical rules across 22 families against source trees.
61
+ 3. **Trace Taint Dataflows:** Follow untrusted inputs from sources to dangerous sinks across module boundaries.
62
+ 4. **Compute Stable Fingerprints:** Hash AST context to produce stable line-shift invariant IDs (`TG-XXX-<hash12>`).
63
+ 5. **Cluster Root Causes:** Group findings into the 22 canonical architectural root causes.
64
+ 6. **Synchronize Ground Truth:** Update `security_report.md` at workspace root.
62
65
 
63
66
  ---
64
67
 
@@ -66,10 +69,11 @@ Inspect workspace prerequisites before launching static audit:
66
69
 
67
70
  ```markdown
68
71
  ### 🔎 TorusGuard Static Audit Results
69
- - **Files Scanned:** [Count] source files
72
+ - **Files Scanned:** [Count] source files ([Changed] changed)
73
+ - **Taint Paths Confirmed:** [Count] verified dataflows
70
74
  - **Total Findings:** [Count] ([Critical] Critical, [High] High)
71
75
  - **Root Cause Clusters:** [Count] architectural issues
72
- - **Confidence:** [Score]/100
76
+ - **Confidence:** [Score]/100 (Evidence-Chain Calibrated)
73
77
  - **Living Report:** `security_report.md`
74
78
  ```
75
79
 
@@ -78,4 +82,4 @@ Inspect workspace prerequisites before launching static audit:
78
82
  ## Next Steps
79
83
 
80
84
  1. Run `/torusguard verify` to validate exploitability and review evidence.
81
- 2. Run `/torusguard harden` to generate minimal surgical remediation plans.
85
+ 2. Run `/torusguard harden` to generate minimal surgical remediation plans conforming to the Ponytail protocol (<= 35 additions, <= 25 deletions).
@@ -1,29 +1,29 @@
1
- # /torusguard-container — Container & Docker Security Audit
2
-
3
- $ARGUMENTS
4
-
5
- ---
6
-
7
- ## Objective
8
- Detect and remediate container privilege escalation, root execution, docker socket exposure, and build-time secret injection across `Dockerfile`, `Containerfile`, and `docker-compose.yml` configurations.
9
-
10
- ---
11
-
12
- ## Tri-Mode Parity
13
- - **Mode A (Terminal CLI):** `torusguard container [target]`
14
- - **Mode B (AI Chat Slash Command):** `/torusguard container [target]`
15
- - **Mode C (Native MCP Tool):** `torusguard_container`
16
-
17
- ---
18
-
19
- ## Execution Steps
20
-
21
- 1. **Discover Container Configurations:** Discover all Dockerfiles and compose YAML files in the workspace.
22
- 2. **Execute Static Heuristic Audit:** Run `ScanContainerFiles` or `torusguard_container` against discovered files.
23
- 3. **Assert Security Invariants:**
24
- - Enforce non-root user declarations (`TG-CONT-001`).
25
- - Block Docker daemon socket mounts (`/var/run/docker.sock`) (`TG-CONT-002`).
26
- - Disallow `privileged: true` and unconfined seccomp profiles (`TG-CONT-003`).
27
- - Ban build-time secrets in `ARG` or `ENV` directives (`TG-CONT-004`).
28
- 4. **Formulate Surgical Patches:** Propose minimal diffs adding non-root users (`USER appuser`) and secret mounts within Ponytail bounds (≤35 additions, ≤25 deletions).
29
- 5. **Synchronize Report:** Log all container findings in `security_report.md`.
1
+ # /torusguard-container — Container & Docker Security Audit
2
+
3
+ $ARGUMENTS
4
+
5
+ ---
6
+
7
+ ## Objective
8
+ Detect and remediate container privilege escalation, root execution, docker socket exposure, and build-time secret injection across `Dockerfile`, `Containerfile`, and `docker-compose.yml` configurations.
9
+
10
+ ---
11
+
12
+ ## Tri-Mode Parity
13
+ - **Mode A (Terminal CLI):** `torusguard container [target]`
14
+ - **Mode B (AI Chat Slash Command):** `/torusguard container [target]`
15
+ - **Mode C (Native MCP Tool):** `torusguard_container`
16
+
17
+ ---
18
+
19
+ ## Execution Steps
20
+
21
+ 1. **Discover Container Configurations:** Discover all Dockerfiles and compose YAML files in the workspace.
22
+ 2. **Execute Static Heuristic Audit:** Run `ScanContainerFiles` or `torusguard_container` against discovered files.
23
+ 3. **Assert Security Invariants:**
24
+ - Enforce non-root user declarations (`TG-CONT-001`).
25
+ - Block Docker daemon socket mounts (`/var/run/docker.sock`) (`TG-CONT-002`).
26
+ - Disallow `privileged: true` and unconfined seccomp profiles (`TG-CONT-003`).
27
+ - Ban build-time secrets in `ARG` or `ENV` directives (`TG-CONT-004`).
28
+ 4. **Formulate Surgical Patches:** Propose minimal diffs adding non-root users (`USER appuser`) and secret mounts within Ponytail bounds (≤35 additions, ≤25 deletions).
29
+ 5. **Synchronize Report:** Log all container findings in `security_report.md`.
@@ -1,25 +1,25 @@
1
- # /torusguard-git-mine — Git Repository & History Secret Mining
2
-
3
- $ARGUMENTS
4
-
5
- ---
6
-
7
- ## Objective
8
- Inspect local Git metadata, `.git/config` remotes, and historical commit logs to uncover leaked API tokens, private certificates, and sensitive credentials committed in previous revisions.
9
-
10
- ---
11
-
12
- ## Tri-Mode Parity
13
- - **Mode A (Terminal CLI):** `torusguard git-mine [target]`
14
- - **Mode B (AI Chat Slash Command):** `/torusguard git-mine [target]`
15
- - **Mode C (Native MCP Tool):** `torusguard_git_mine`
16
-
17
- ---
18
-
19
- ## Execution Steps
20
-
21
- 1. **Verify Git Environment:** Verify target directory is a valid Git repository containing `.git/`.
22
- 2. **Audit Remote Configurations:** Check `.git/config` for embedded basic auth credentials in remote origin URLs (`TG-GIT-002`).
23
- 3. **Mine Commit Log Diffs:** Inspect the last 50 commits (`git log -p`) for added tokens, keys, and credentials (`TG-GIT-001`).
24
- 4. **Audit Tracked Sensitive Files:** Ensure `.env`, private keys, and certificates are not tracked in git tree history (`TG-GIT-003`).
25
- 5. **Report & Revoke:** Provide immediate provider revocation steps and commit log cleanup guidance in `security_report.md`.
1
+ # /torusguard-git-mine — Git Repository & History Secret Mining
2
+
3
+ $ARGUMENTS
4
+
5
+ ---
6
+
7
+ ## Objective
8
+ Inspect local Git metadata, `.git/config` remotes, and historical commit logs to uncover leaked API tokens, private certificates, and sensitive credentials committed in previous revisions.
9
+
10
+ ---
11
+
12
+ ## Tri-Mode Parity
13
+ - **Mode A (Terminal CLI):** `torusguard git-mine [target]`
14
+ - **Mode B (AI Chat Slash Command):** `/torusguard git-mine [target]`
15
+ - **Mode C (Native MCP Tool):** `torusguard_git_mine`
16
+
17
+ ---
18
+
19
+ ## Execution Steps
20
+
21
+ 1. **Verify Git Environment:** Verify target directory is a valid Git repository containing `.git/`.
22
+ 2. **Audit Remote Configurations:** Check `.git/config` for embedded basic auth credentials in remote origin URLs (`TG-GIT-002`).
23
+ 3. **Mine Commit Log Diffs:** Inspect the last 50 commits (`git log -p`) for added tokens, keys, and credentials (`TG-GIT-001`).
24
+ 4. **Audit Tracked Sensitive Files:** Ensure `.env`, private keys, and certificates are not tracked in git tree history (`TG-GIT-003`).
25
+ 5. **Report & Revoke:** Provide immediate provider revocation steps and commit log cleanup guidance in `security_report.md`.
@@ -1,25 +1,25 @@
1
- # /torusguard-ocr-scan — Multi-Modal OCR Secret Scanning
2
-
3
- $ARGUMENTS
4
-
5
- ---
6
-
7
- ## Objective
8
- Detect optical leaks of private API keys, AWS credentials, database URIs, GitHub personal access tokens, and private certificates embedded inside visual artifacts (`.png`, `.jpg`, `.jpeg`, `.webp`, `.bmp`, `.tiff`) up to 10MB using Tesseract OCR and deterministic regex signatures.
9
-
10
- ---
11
-
12
- ## Tri-Mode Parity
13
- - **Mode A (Terminal CLI):** `torusguard ocr-scan <target>`
14
- - **Mode B (AI Chat Slash Command):** `/torusguard ocr-scan <target>`
15
- - **Mode C (Native MCP Tool):** `torusguard_ocr_scan`
16
-
17
- ---
18
-
19
- ## Execution Steps
20
-
21
- 1. **Verify Target:** Check target image or directory exists on disk.
22
- 2. **Inspect File Size:** Reject images exceeding 10MB (`DefaultMaxImageSize`) to preserve DoS resilience.
23
- 3. **Execute OCR Extraction:** Run Tesseract optical text analysis via Go scanner or MCP tool.
24
- 4. **Pattern Match Secrets:** Evaluate optical text against `TG-SEC-001` through `TG-SEC-007` signatures.
25
- 5. **Redact & Report:** Emit sanitized finding cards and synchronize into `security_report.md`.
1
+ # /torusguard-ocr-scan — Multi-Modal OCR Secret Scanning
2
+
3
+ $ARGUMENTS
4
+
5
+ ---
6
+
7
+ ## Objective
8
+ Detect optical leaks of private API keys, AWS credentials, database URIs, GitHub personal access tokens, and private certificates embedded inside visual artifacts (`.png`, `.jpg`, `.jpeg`, `.webp`, `.bmp`, `.tiff`) up to 10MB using Tesseract OCR and deterministic regex signatures.
9
+
10
+ ---
11
+
12
+ ## Tri-Mode Parity
13
+ - **Mode A (Terminal CLI):** `torusguard ocr-scan <target>`
14
+ - **Mode B (AI Chat Slash Command):** `/torusguard ocr-scan <target>`
15
+ - **Mode C (Native MCP Tool):** `torusguard_ocr_scan`
16
+
17
+ ---
18
+
19
+ ## Execution Steps
20
+
21
+ 1. **Verify Target:** Check target image or directory exists on disk.
22
+ 2. **Inspect File Size:** Reject images exceeding 10MB (`DefaultMaxImageSize`) to preserve DoS resilience.
23
+ 3. **Execute OCR Extraction:** Run Tesseract optical text analysis via Go scanner or MCP tool.
24
+ 4. **Pattern Match Secrets:** Evaluate optical text against `TG-SEC-001` through `TG-SEC-007` signatures.
25
+ 5. **Redact & Report:** Emit sanitized finding cards and synchronize into `security_report.md`.
@@ -1,27 +1,27 @@
1
- # /torusguard-redos — Regular Expression Complexity Scanner
2
-
3
- $ARGUMENTS
4
-
5
- ---
6
-
7
- ## Objective
8
- Detect and remediate catastrophic exponential ($O(2^n)$) and polynomial backtracking regular expressions in web applications to prevent availability and thread starvation DoS attacks.
9
-
10
- ---
11
-
12
- ## Tri-Mode Parity
13
- - **Mode A (Terminal CLI):** `torusguard redos [target]`
14
- - **Mode B (AI Chat Slash Command):** `/torusguard redos [target]`
15
- - **Mode C (Native MCP Tool):** `torusguard_redos`
16
-
17
- ---
18
-
19
- ## Execution Steps
20
-
21
- 1. **Locate Regex Definitions:** Walk source tree to find regex literals and constructor calls (`RegExp`, `re.compile`, `regexp.MustCompile`).
22
- 2. **Analyze Backtracking Complexity:**
23
- - Detect nested quantifiers (`(x+)+`, `(x*)*`) causing $O(2^n)$ exponential blowup (`TG-REDOS-001`).
24
- - Detect overlapping alternations with outer repetition causing polynomial blowup (`TG-REDOS-002`).
25
- 3. **Audit Input Length Guardrails:** Check if untrusted inputs evaluated against regexes are bounded in character length.
26
- 4. **Formulate Safe Remediation:** Refactor vulnerable regexes into linear deterministic expressions, anchor tokens, or parser logic.
27
- 5. **Synchronize Report:** Log all ReDoS findings in `security_report.md`.
1
+ # /torusguard-redos — Regular Expression Complexity Scanner
2
+
3
+ $ARGUMENTS
4
+
5
+ ---
6
+
7
+ ## Objective
8
+ Detect and remediate catastrophic exponential ($O(2^n)$) and polynomial backtracking regular expressions in web applications to prevent availability and thread starvation DoS attacks.
9
+
10
+ ---
11
+
12
+ ## Tri-Mode Parity
13
+ - **Mode A (Terminal CLI):** `torusguard redos [target]`
14
+ - **Mode B (AI Chat Slash Command):** `/torusguard redos [target]`
15
+ - **Mode C (Native MCP Tool):** `torusguard_redos`
16
+
17
+ ---
18
+
19
+ ## Execution Steps
20
+
21
+ 1. **Locate Regex Definitions:** Walk source tree to find regex literals and constructor calls (`RegExp`, `re.compile`, `regexp.MustCompile`).
22
+ 2. **Analyze Backtracking Complexity:**
23
+ - Detect nested quantifiers (`(x+)+`, `(x*)*`) causing $O(2^n)$ exponential blowup (`TG-REDOS-001`).
24
+ - Detect overlapping alternations with outer repetition causing polynomial blowup (`TG-REDOS-002`).
25
+ 3. **Audit Input Length Guardrails:** Check if untrusted inputs evaluated against regexes are bounded in character length.
26
+ 4. **Formulate Safe Remediation:** Refactor vulnerable regexes into linear deterministic expressions, anchor tokens, or parser logic.
27
+ 5. **Synchronize Report:** Log all ReDoS findings in `security_report.md`.
@@ -0,0 +1,11 @@
1
+ # TorusGuard Review Workflow (`/torusguard review`)
2
+
3
+ ## Purpose
4
+ Executes differential incremental Git diff security review against a reference branch or commit (default: `HEAD~1`).
5
+ Inspects changed lines for new security regressions, evaluates net security score deltas, and outputs pull request review comments.
6
+
7
+ ## Steps
8
+ 1. Determine reference branch or commit (e.g. `HEAD~1` or `origin/main`).
9
+ 2. Run differential scan via `torusguard review [--diff <ref>]` or native MCP tool `torusguard_review`.
10
+ 3. Check PR Gate Decision (`PASSED` or `BLOCKED`).
11
+ 4. If blocked, review newly introduced violations and formulate surgical Ponytail fixes via `/torusguard harden`.
@@ -0,0 +1,9 @@
1
+ # TorusGuard Threat Model Workflow (`/torusguard threatmodel`)
2
+
3
+ ## Purpose
4
+ Synthesizes architectural STRIDE threat models, interactive Mermaid Data Flow Diagrams (DFDs), and trust boundary registers directly into `SECURITY_THREAT_MODEL.md`.
5
+
6
+ ## Steps
7
+ 1. Execute `torusguard threatmodel` or native MCP tool `torusguard_threatmodel`.
8
+ 2. Inspect `SECURITY_THREAT_MODEL.md` to verify identified entrypoints, data stores, and trust boundaries.
9
+ 3. Align STRIDE risk controls against corresponding TorusGuard security invariants (`TG-AUTH`, `TG-DB`, `TG-RATE`, `TG-SSRF`).