torusguard 2.0.0-alpha → 2.1.1

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 (227) hide show
  1. package/.torusguard/.manifest.json +94 -30
  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/rules/TG-INPUT-007-unvalidated-redirect.md +53 -0
  42. package/.torusguard/rules/TG-INPUT-008-insecure-deserialization.md +52 -0
  43. package/.torusguard/rules/container/TG-CONT-001-root-user-execution.md +50 -0
  44. package/.torusguard/rules/container/TG-CONT-002-docker-socket-mount.md +47 -0
  45. package/.torusguard/rules/container/TG-CONT-003-privileged-container-mode.md +53 -0
  46. package/.torusguard/rules/container/TG-CONT-004-build-arg-secret-exposure.md +43 -0
  47. package/.torusguard/rules/git/TG-GIT-001-historical-secret-in-git-commit.md +44 -0
  48. package/.torusguard/rules/git/TG-GIT-002-plaintext-credentials-in-git-config.md +41 -0
  49. package/.torusguard/rules/git/TG-GIT-003-sensitive-tracked-file-gitignore-breach.md +40 -0
  50. package/.torusguard/rules/rag/TG-RAG-001-untrusted-rag-context-injection.md +72 -0
  51. package/.torusguard/rules/rag/TG-RAG-002-autonomous-llm-tool-unsandboxed-call.md +51 -0
  52. package/.torusguard/rules/rag/TG-RAG-003-unpartitioned-vector-tenant-lookup.md +51 -0
  53. package/.torusguard/rules/redos/TG-REDOS-001-catastrophic-exponential-backtracking.md +46 -0
  54. package/.torusguard/rules/redos/TG-REDOS-002-unbounded-nested-quantifier.md +43 -0
  55. package/.torusguard/rules_catalog.json +96 -0
  56. package/.torusguard/scripts/__pycache__/audit_runner.cpython-314.pyc +0 -0
  57. package/.torusguard/scripts/__pycache__/finding_scorer.cpython-314.pyc +0 -0
  58. package/.torusguard/scripts/__pycache__/manifest_builder.cpython-314.pyc +0 -0
  59. package/.torusguard/scripts/__pycache__/rules_sync.cpython-314.pyc +0 -0
  60. package/.torusguard/scripts/audit_runner.py +108 -10
  61. package/.torusguard/scripts/finding_scorer.py +43 -13
  62. package/.torusguard/scripts/manifest_builder.py +1 -1
  63. package/.torusguard/scripts/skill_profiler.py +26 -0
  64. package/.torusguard/skills/torusguard/SKILL.md +74 -25
  65. package/.torusguard/skills/torusguard/bootstrap.py +57 -24
  66. package/.torusguard/skills/torusguard-ai-guard/SKILL.md +95 -0
  67. package/.torusguard/skills/torusguard-apply/SKILL.md +60 -34
  68. package/.torusguard/skills/torusguard-audit/SKILL.md +131 -57
  69. package/.torusguard/skills/torusguard-authorize/SKILL.md +48 -6
  70. package/.torusguard/skills/torusguard-container/SKILL.md +94 -0
  71. package/.torusguard/skills/torusguard-exploit-check/SKILL.md +50 -6
  72. package/.torusguard/skills/torusguard-full/SKILL.md +62 -19
  73. package/.torusguard/skills/torusguard-git-mine/SKILL.md +92 -0
  74. package/.torusguard/skills/torusguard-harden/SKILL.md +81 -50
  75. package/.torusguard/skills/torusguard-init/SKILL.md +61 -14
  76. package/.torusguard/skills/torusguard-ocr-scan/SKILL.md +94 -0
  77. package/.torusguard/skills/torusguard-recheck/SKILL.md +71 -18
  78. package/.torusguard/skills/torusguard-redos/SKILL.md +91 -0
  79. package/.torusguard/skills/torusguard-report/SKILL.md +50 -9
  80. package/.torusguard/skills/torusguard-status/SKILL.md +63 -10
  81. package/.torusguard/skills/torusguard-verify/SKILL.md +52 -10
  82. package/.torusguard/skills/torusguard-web-validate/SKILL.md +53 -8
  83. package/.torusguard/workflows/ai-guard.md +31 -0
  84. package/.torusguard/workflows/apply.md +32 -55
  85. package/.torusguard/workflows/audit.md +35 -49
  86. package/.torusguard/workflows/authorize.md +27 -50
  87. package/.torusguard/workflows/container.md +29 -0
  88. package/.torusguard/workflows/exploit-check.md +28 -50
  89. package/.torusguard/workflows/git-mine.md +25 -0
  90. package/.torusguard/workflows/harden.md +29 -48
  91. package/.torusguard/workflows/init.md +27 -50
  92. package/.torusguard/workflows/memory.md +18 -23
  93. package/.torusguard/workflows/ocr-scan.md +25 -0
  94. package/.torusguard/workflows/recheck.md +28 -46
  95. package/.torusguard/workflows/redos.md +27 -0
  96. package/.torusguard/workflows/report.md +33 -52
  97. package/.torusguard/workflows/status.md +31 -52
  98. package/.torusguard/workflows/verify.md +29 -49
  99. package/.torusguard/workflows/web-validate.md +22 -45
  100. package/README.md +96 -60
  101. package/package.json +7 -2
  102. package/skills/torusguard/SKILL.md +75 -24
  103. package/skills/torusguard/__pycache__/bootstrap.cpython-314.pyc +0 -0
  104. package/skills/torusguard/bootstrap.py +60 -71
  105. package/skills/torusguard/payload/.manifest.json +94 -31
  106. package/skills/torusguard/payload/core/__init__.py +146 -0
  107. package/skills/torusguard/payload/core/agent_roles.py +104 -0
  108. package/skills/torusguard/payload/core/ast_walker.py +283 -0
  109. package/skills/torusguard/payload/core/authorization.py +218 -0
  110. package/skills/torusguard/payload/core/browser_verifier.py +128 -0
  111. package/skills/torusguard/payload/core/bundle.py +141 -0
  112. package/skills/torusguard/payload/core/call_graph.py +184 -0
  113. package/skills/torusguard/payload/core/clustering.py +275 -0
  114. package/skills/torusguard/payload/core/confidence.py +120 -0
  115. package/skills/torusguard/payload/core/cross_file_taint.py +101 -0
  116. package/skills/torusguard/payload/core/exploit_checker.py +317 -0
  117. package/skills/torusguard/payload/core/formatter.py +351 -0
  118. package/skills/torusguard/payload/core/governance.py +210 -0
  119. package/skills/torusguard/payload/core/identity.py +104 -0
  120. package/skills/torusguard/payload/core/import_resolver.py +91 -0
  121. package/skills/torusguard/payload/core/incremental.py +102 -0
  122. package/skills/torusguard/payload/core/lifecycle.py +137 -0
  123. package/skills/torusguard/payload/core/models.py +425 -0
  124. package/skills/torusguard/payload/core/parallel.py +56 -0
  125. package/skills/torusguard/payload/core/parser.py +202 -0
  126. package/skills/torusguard/payload/core/rechecker.py +107 -0
  127. package/skills/torusguard/payload/core/replay_trace.py +178 -0
  128. package/skills/torusguard/payload/core/rules_registry.py +131 -0
  129. package/skills/torusguard/payload/core/run_folder.py +60 -0
  130. package/skills/torusguard/payload/core/run_manager.py +163 -0
  131. package/skills/torusguard/payload/core/runtime_evidence.py +175 -0
  132. package/skills/torusguard/payload/core/runtime_validator.py +246 -0
  133. package/skills/torusguard/payload/core/safety_gate.py +139 -0
  134. package/skills/torusguard/payload/core/sarif.py +189 -0
  135. package/skills/torusguard/payload/core/stack_profiler.py +184 -0
  136. package/skills/torusguard/payload/core/symbol_table.py +91 -0
  137. package/skills/torusguard/payload/core/taint.py +133 -0
  138. package/skills/torusguard/payload/core/taint_graph.py +235 -0
  139. package/skills/torusguard/payload/core/taint_rules.py +268 -0
  140. package/skills/torusguard/payload/core/v070_reporter.py +102 -0
  141. package/skills/torusguard/payload/core/v070_workflow.py +339 -0
  142. package/skills/torusguard/payload/core/v6_reporter.py +180 -0
  143. package/skills/torusguard/payload/core/v6_workflow.py +221 -0
  144. package/skills/torusguard/payload/core/watcher.py +58 -0
  145. package/skills/torusguard/payload/rules/TG-INPUT-007-unvalidated-redirect.md +53 -0
  146. package/skills/torusguard/payload/rules/TG-INPUT-008-insecure-deserialization.md +52 -0
  147. package/skills/torusguard/payload/rules/container/TG-CONT-001-root-user-execution.md +50 -0
  148. package/skills/torusguard/payload/rules/container/TG-CONT-002-docker-socket-mount.md +47 -0
  149. package/skills/torusguard/payload/rules/container/TG-CONT-003-privileged-container-mode.md +53 -0
  150. package/skills/torusguard/payload/rules/container/TG-CONT-004-build-arg-secret-exposure.md +43 -0
  151. package/skills/torusguard/payload/rules/git/TG-GIT-001-historical-secret-in-git-commit.md +44 -0
  152. package/skills/torusguard/payload/rules/git/TG-GIT-002-plaintext-credentials-in-git-config.md +41 -0
  153. package/skills/torusguard/payload/rules/git/TG-GIT-003-sensitive-tracked-file-gitignore-breach.md +40 -0
  154. package/skills/torusguard/payload/rules/rag/TG-RAG-001-untrusted-rag-context-injection.md +72 -0
  155. package/skills/torusguard/payload/rules/rag/TG-RAG-002-autonomous-llm-tool-unsandboxed-call.md +51 -0
  156. package/skills/torusguard/payload/rules/rag/TG-RAG-003-unpartitioned-vector-tenant-lookup.md +51 -0
  157. package/skills/torusguard/payload/rules/redos/TG-REDOS-001-catastrophic-exponential-backtracking.md +46 -0
  158. package/skills/torusguard/payload/rules/redos/TG-REDOS-002-unbounded-nested-quantifier.md +43 -0
  159. package/skills/torusguard/payload/rules_catalog.json +338 -518
  160. package/skills/torusguard/payload/scripts/__pycache__/term_ui.cpython-314.pyc +0 -0
  161. package/skills/torusguard/payload/scripts/audit_runner.py +108 -10
  162. package/skills/torusguard/payload/scripts/finding_scorer.py +43 -13
  163. package/skills/torusguard/payload/scripts/manifest_builder.py +1 -1
  164. package/skills/torusguard/payload/skills/torusguard/SKILL.md +74 -25
  165. package/skills/torusguard/payload/skills/torusguard/bootstrap.py +57 -24
  166. package/skills/torusguard/payload/skills/torusguard/references/csharp-security.md +41 -41
  167. package/skills/torusguard/payload/skills/torusguard/references/go-security.md +41 -41
  168. package/skills/torusguard/payload/skills/torusguard/references/java-security.md +40 -40
  169. package/skills/torusguard/payload/skills/torusguard/references/polyglot-security-matrix.md +25 -25
  170. package/skills/torusguard/payload/skills/torusguard/references/rust-security.md +40 -40
  171. package/skills/torusguard/payload/skills/torusguard-ai-guard/SKILL.md +95 -0
  172. package/skills/torusguard/payload/skills/torusguard-apply/SKILL.md +60 -34
  173. package/skills/torusguard/payload/skills/torusguard-audit/SKILL.md +131 -57
  174. package/skills/torusguard/payload/skills/torusguard-authorize/SKILL.md +48 -6
  175. package/skills/torusguard/payload/skills/torusguard-container/SKILL.md +94 -0
  176. package/skills/torusguard/payload/skills/torusguard-exploit-check/SKILL.md +50 -6
  177. package/skills/torusguard/payload/skills/torusguard-full/SKILL.md +62 -19
  178. package/skills/torusguard/payload/skills/torusguard-git-mine/SKILL.md +92 -0
  179. package/skills/torusguard/payload/skills/torusguard-harden/SKILL.md +81 -50
  180. package/skills/torusguard/payload/skills/torusguard-init/SKILL.md +61 -14
  181. package/skills/torusguard/payload/skills/torusguard-ocr-scan/SKILL.md +94 -0
  182. package/skills/torusguard/payload/skills/torusguard-recheck/SKILL.md +71 -18
  183. package/skills/torusguard/payload/skills/torusguard-redos/SKILL.md +91 -0
  184. package/skills/torusguard/payload/skills/torusguard-report/SKILL.md +50 -9
  185. package/skills/torusguard/payload/skills/torusguard-status/SKILL.md +63 -10
  186. package/skills/torusguard/payload/skills/torusguard-verify/SKILL.md +52 -10
  187. package/skills/torusguard/payload/skills/torusguard-web-validate/SKILL.md +53 -8
  188. package/skills/torusguard/payload/workflows/ai-guard.md +31 -0
  189. package/skills/torusguard/payload/workflows/apply.md +31 -62
  190. package/skills/torusguard/payload/workflows/audit.md +35 -55
  191. package/skills/torusguard/payload/workflows/authorize.md +27 -50
  192. package/skills/torusguard/payload/workflows/container.md +29 -0
  193. package/skills/torusguard/payload/workflows/exploit-check.md +28 -50
  194. package/skills/torusguard/payload/workflows/git-mine.md +25 -0
  195. package/skills/torusguard/payload/workflows/harden.md +28 -52
  196. package/skills/torusguard/payload/workflows/init.md +27 -56
  197. package/skills/torusguard/payload/workflows/memory.md +18 -23
  198. package/skills/torusguard/payload/workflows/ocr-scan.md +25 -0
  199. package/skills/torusguard/payload/workflows/recheck.md +28 -46
  200. package/skills/torusguard/payload/workflows/redos.md +27 -0
  201. package/skills/torusguard/payload/workflows/report.md +39 -62
  202. package/skills/torusguard/payload/workflows/status.md +31 -55
  203. package/skills/torusguard/payload/workflows/torusguard-audit.md +35 -55
  204. package/skills/torusguard/payload/workflows/verify.md +29 -49
  205. package/skills/torusguard/payload/workflows/web-validate.md +22 -45
  206. package/skills/torusguard/references/csharp-security.md +41 -0
  207. package/skills/torusguard/references/go-security.md +41 -0
  208. package/skills/torusguard/references/java-security.md +40 -0
  209. package/skills/torusguard/references/polyglot-security-matrix.md +25 -0
  210. package/skills/torusguard/references/rust-security.md +40 -0
  211. package/skills/torusguard-ai-guard/SKILL.md +95 -0
  212. package/skills/torusguard-apply/SKILL.md +60 -34
  213. package/skills/torusguard-audit/SKILL.md +130 -57
  214. package/skills/torusguard-authorize/SKILL.md +48 -6
  215. package/skills/torusguard-container/SKILL.md +94 -0
  216. package/skills/torusguard-exploit-check/SKILL.md +50 -6
  217. package/skills/torusguard-full/SKILL.md +62 -19
  218. package/skills/torusguard-git-mine/SKILL.md +92 -0
  219. package/skills/torusguard-harden/SKILL.md +81 -50
  220. package/skills/torusguard-init/SKILL.md +61 -14
  221. package/skills/torusguard-ocr-scan/SKILL.md +94 -0
  222. package/skills/torusguard-recheck/SKILL.md +71 -18
  223. package/skills/torusguard-redos/SKILL.md +91 -0
  224. package/skills/torusguard-report/SKILL.md +50 -9
  225. package/skills/torusguard-status/SKILL.md +63 -10
  226. package/skills/torusguard-verify/SKILL.md +52 -10
  227. package/skills/torusguard-web-validate/SKILL.md +53 -8
@@ -1,16 +1,14 @@
1
1
  ---
2
2
  description: Governed patch application with pre-apply rollback snapshots and Human Gate authorization.
3
- tools: Read, Grep, Glob, Bash, Edit, Write
4
- version: 1.4.0
3
+ tools: Read, Grep, Glob, Bash, Edit, Write, run_command
4
+ version: 2.0.0
5
5
  agent: remediator
6
6
  lifecycle-phase: Phase 5 (Patch Application)
7
7
  required-skills:
8
8
  - torusguard-apply
9
9
  scripts-binding:
10
- - .torusguard/scripts/apply_runner.py
11
- - .torusguard/scripts/report_sync.py
12
- - .torusguard/scripts/run_manager.py
13
- - .torusguard/scripts/diff_guard.py
10
+ - internal/apply/apply.go
11
+ - cmd/torusguard/main.go
14
12
  ---
15
13
 
16
14
  # /torusguard apply — Governed Patch Application & Rollback Snapshot
@@ -20,91 +18,62 @@ $ARGUMENTS
20
18
  ---
21
19
 
22
20
  ## Objective
23
- Governed patch application with pre-apply rollback snapshots and Human Gate authorization.
21
+ Safely apply approved remediation bundles to disk source files, creating an automated byte-for-byte pre-apply backup snapshot (`.bak`) in `.torusguard/snapshots/<run_id>/`, asserting syntax validity, and distilling passing patterns into Golden Fix Recipes.
24
22
 
25
- Supported CLI flags:
26
- - `npx torusguard apply [--target <dir>]` : Apply candidate patches with confirmation prompt
27
- - `npx torusguard apply --diff` : Preview unified diffs without modifying files on disk
28
- - `npx torusguard apply --selective` : Interactively review and approve patches one by one
29
- - `npx torusguard apply --verify` : Trigger immediate differential AST recheck post-apply
30
- - `npx torusguard apply --list-snapshots` : List available historical pre-apply backup snapshots
31
- - `npx torusguard apply --yes` / `-y` : Non-interactive auto-approval mode
23
+ ---
24
+
25
+ ## Tri-Mode Execution
26
+
27
+ | Mode | Command / Tool | Execution Method |
28
+ | :--- | :--- | :--- |
29
+ | **Mode A: Terminal CLI** | `torusguard apply candidate.patch [--yes]` | Shell execution of patch applier with snapshot creation. |
30
+ | **Mode B: AI Chat Slash** | `/torusguard apply` | Guided conversational application with explicit Human Gate approval. |
31
+ | **Mode C: Native MCP Tool** | Autonomous Agent Flow | Formulates patch with `torusguard_harden`, awaits Human Gate, invokes CLI. |
32
32
 
33
33
  ---
34
34
 
35
35
  ## Mandatory Pre-Flight Context Inspection
36
36
 
37
37
  Inspect bundle validity and file safety before modifying disk code:
38
- 1. **Bundle Verification:** Assert `patch.diff` exists in active run's remediation folder.
39
- 2. **Pre-Apply Snapshot:** Save a byte-for-byte backup copy (`.bak` or `.torusguard/snapshots/<run_id>/`) prior to editing.
38
+ 1. **Bundle Verification:** Assert `candidate.patch` or semantic `patch.json` exists.
39
+ 2. **Pre-Apply Snapshot:** Save a byte-for-byte backup copy (`.torusguard/snapshots/<run_id>/<rel_path>.bak`) prior to editing.
40
40
  3. **Uncommitted Changes:** Check git status; ensure target file has clean baseline.
41
41
  4. **Ponytail Check:** Re-verify that patch additions $\le 35$ and deletions $\le 25$.
42
42
  5. **Human Gate:** Confirm operator approval before committing edits to disk.
43
- 6. **Workspace Cleanliness:** Verify git working tree has no uncommitted merge conflicts.
44
- 7. **Execution Privilege:** Verify write access to targeted file locations.
45
-
46
- ---
47
-
48
- ## When to Use /torusguard apply
49
-
50
- | Trigger Scenario | Recommended Action |
51
- | :--- | :--- |
52
- | Applying an approved remediation patch to disk | Run `/torusguard apply` |
53
- | Generating patch diff without modifying disk | Run `/torusguard harden` |
54
- | Verifying that patch eliminated flaw without regression | Run `/torusguard recheck` |
55
- | Reverting an applied patch | Restore from `.bak` snapshot |
56
- | Checking workspace status | Run `/torusguard status` |
57
43
 
58
44
  ---
59
45
 
60
46
  ## Living Report Invariant
61
47
  - Applied patches create pre-apply `.bak` snapshots in `.torusguard/snapshots/<run_id>/`.
62
48
  - Finding statuses transition in `security_report.md` to `APPLIED 🔵`.
63
- - Instant rollback available via `npx torusguard rollback`.
64
-
65
- ## Execution Steps
66
-
67
- 1. **Load Remediation Bundle:** Read `patch.diff` and metadata from active run directory.
68
- 2. **Audit Patch Invariants:** Run `python .torusguard/scripts/diff_guard.py <patch.diff>`.
69
- 3. **Create Rollback Backup:** Copy target file to `.torusguard/runs/<run_id>/.torusguard/snapshots/<run_id>/<filename>.bak`.
70
- 4. **Apply Minimal Diff:** Execute precise surgical edit using `replace_file_content` or `patch`.
71
- 5. **Assert Syntax & Integrity:** Check that modified file compiles cleanly without syntax errors.
72
- 6. **Log Application Ledger:** Record timestamp, original SHA-256, and patched SHA-256 in `apply-log.json`.
49
+ - Instant rollback available via `torusguard rollback`.
73
50
 
74
51
  ---
75
52
 
76
- ## Failure Recovery
77
-
78
- - **Syntax Error After Patch:** Instantly revert target file from `.bak` backup snapshot.
79
- - **Merge / Context Conflict:** Re-run `/torusguard harden` to regenerate diff against latest disk lines.
80
- - **Missing Backup File:** Do not apply patch if backup copy cannot be written.
81
- - **Halt Trigger:** Abort if git working tree is dirty on conflicting lines.
82
-
83
- ---
84
-
85
- ## Hallucination Guard
53
+ ## Execution Steps
86
54
 
87
- - ❌ Never apply code changes without creating an exact pre-apply rollback backup first.
88
- - ❌ Never touch files not explicitly listed in the approved `patch.diff`.
89
- - ✅ Always verify syntax compilation immediately after modifying source files.
55
+ 1. **Load Remediation Bundle:** Read `candidate.patch` or `patch.json`.
56
+ 2. **Obtain Human Gate:** Confirm user approval to modify target source file.
57
+ 3. **Create Rollback Backup:** Capture `.bak` in `.torusguard/snapshots/<run_id>/`.
58
+ 4. **Apply Surgical Edit:** Run `torusguard apply <patch> --yes` or apply semantic reflection.
59
+ 5. **Assert Syntax & Integrity:** Check that modified file compiles cleanly (`go test ./...`, syntax lint).
60
+ 6. **Recommend Recheck:** Run `torusguard recheck` or `/torusguard recheck`.
90
61
 
91
62
  ---
92
63
 
93
64
  ## Output Card Format
94
65
 
95
66
  ```markdown
96
- ### 🚀 TorusGuard Patch Application
97
- - **Finding Addressed:** `TG-XXX-HASH`
98
- - **File Patched:** `src/path/to/file.py`
99
- - **Rollback Backup:** `.torusguard/runs/<run_id>/.torusguard/snapshots/<run_id>/<file>.bak`
100
- - **Churn Applied:** +[Additions] / -[Deletions] lines
101
- - **Syntax Check:** PASSED (clean compile)
102
- - **Status:** APPLIED — run `/torusguard recheck` to verify fix
67
+ ### 🚀 TorusGuard Patch Applied Successfully
68
+ - **Target File:** `src/path/to/file`
69
+ - **Backup Snapshot:** `.torusguard/snapshots/<run_id>/<file>.bak`
70
+ - **Rollback Command:** `torusguard rollback`
71
+ - **Next Step:** Run `/torusguard recheck` to verify closure
103
72
  ```
104
73
 
105
74
  ---
106
75
 
107
76
  ## Next Steps
108
77
 
109
- 1. Run `/torusguard recheck` to perform differential audit on the modified file.
110
- 2. Run test suites to verify that business logic and regressions remain intact.
78
+ 1. Run `/torusguard recheck` or `torusguard recheck` to verify closure and zero regressions.
79
+ 2. If unexpected behavior occurs, run `torusguard rollback`.
@@ -1,55 +1,47 @@
1
1
  ---
2
- description: Static security AST scanning, stable line-shift invariant fingerprinting, root-cause clustering, and 0-100 confidence scoring.
3
- tools: Read, Grep, Glob, Bash, Write
4
- version: 1.4.0
2
+ description: Taint-aware static security AST scanning, cross-file interprocedural dataflow, 86+ rules across 22 families, and 7-signal calibrated confidence scoring.
3
+ tools: Read, Grep, Glob, Bash, Write, run_command
4
+ version: 2.0.0
5
5
  agent: auditor
6
6
  lifecycle-phase: Phase 2 (Static Audit & Clustering)
7
7
  required-skills:
8
8
  - torusguard-audit
9
9
  scripts-binding:
10
10
  - .torusguard/scripts/audit_runner.py
11
- - .torusguard/scripts/report_sync.py
12
- - .torusguard/scripts/run_manager.py
13
11
  - .torusguard/scripts/finding_scorer.py
12
+ - .torusguard/core/cross_file_taint.py
13
+ - .torusguard/core/confidence.py
14
+ - .torusguard/core/incremental.py
14
15
  ---
15
16
 
16
- # /torusguard audit — Static Security Code Scan & Clustering
17
+ # /torusguard audit — Deep Taint-Aware Static Security Code Scan & Clustering
17
18
 
18
19
  $ARGUMENTS
19
20
 
20
21
  ---
21
22
 
22
23
  ## Objective
23
- Static security AST scanning, stable fingerprinting, root-cause clustering, throughput telemetry, and 0-100 scoring.
24
-
25
- Supported CLI flags:
26
- - `npx torusguard audit [--target <dir>]` : Specify project root directory
27
- - `npx torusguard audit --watch` / `-w` : Continuous watch mode, re-scanning on file change
28
- - `npx torusguard audit --sarif` : Automatically export OASIS SARIF v2.1.0 log
29
- - `npx torusguard audit --severity <critical|high|medium|low>` : Floor filter for findings
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.
30
25
 
31
26
  ---
32
27
 
33
- ## Mandatory Pre-Flight Context Inspection
28
+ ## Tri-Mode Execution
34
29
 
35
- Inspect workspace prerequisites before launching static audit:
36
- 1. **Init State (`torusguard.json`):** Assert repository is initialized.
37
- 2. **Active Rules (`rules/active/`):** Confirm rule definitions exist.
38
- 3. **Exclusions:** Assert `node_modules/`, `.venv/`, `dist/`, `.git/` are skipped.
39
- 4. **Run Folder:** Allocate isolated folder in `.torusguard/runs/`.
40
- 5. **Syntax Check:** Check for syntax errors before parsing ASTs.
30
+ | Mode | Command / Tool | Execution Method |
31
+ | :--- | :--- | :--- |
32
+ | **Mode A: Terminal CLI** | `torusguard audit [--incremental] [--watch] [--json]` | Shell execution of TorusGuard audit engine. |
33
+ | **Mode B: AI Chat Slash** | `/torusguard audit` | Conversational guided audit with bounded context inspection. |
34
+ | **Mode C: Native MCP Tool** | `torusguard_audit` | Autonomous agent tool invocation via stdio JSON-RPC. |
41
35
 
42
36
  ---
43
37
 
44
- ## When to Use /torusguard audit
38
+ ## Mandatory Pre-Flight Context Inspection
45
39
 
46
- | Trigger Scenario | Recommended Action |
47
- | :--- | :--- |
48
- | First-time scan of repository or new branch | Run `/torusguard audit` |
49
- | Pre-commit review and PR security checks | Run `/torusguard audit` |
50
- | Uninitialized project | Run `/torusguard init` first |
51
- | Live endpoint or runtime probing | Run `/torusguard web-validate` |
52
- | Differential check after patch | Run `/torusguard recheck` |
40
+ Inspect workspace prerequisites before launching static audit:
41
+ 1. **Init State (`torusguard.json`):** Assert repository is initialized or run `torusguard init`.
42
+ 2. **Active Rules (`rules/`):** Confirm rule definitions exist across the 22 architectural families.
43
+ 3. **Exclusions:** Assert `node_modules/`, `.venv/`, `dist/`, `.git/` are skipped.
44
+ 4. **Syntax Check:** Check for syntax errors before parsing ASTs.
53
45
 
54
46
  ---
55
47
 
@@ -57,31 +49,19 @@ Inspect workspace prerequisites before launching static audit:
57
49
  - Audit discoveries automatically synchronize to `security_report.md` at workspace root.
58
50
  - Findings transition into `OPEN 🔴` status with stable invariant fingerprints.
59
51
 
60
- ## Execution Steps
61
-
62
- 1. **Allocate Run Folder:** Run `python .torusguard/scripts/run_manager.py create audit`.
63
- 2. **Scan Codebase ASTs:** Match active rules against source trees.
64
- 3. **Compute Stable Fingerprints:** Hash AST context to produce stable IDs.
65
- 4. **Cluster Root Causes:** Group findings sharing identical sinks.
66
- 5. **Score Confidence (0–100):** Run `python .torusguard/scripts/finding_scorer.py --run <run_dir>`.
67
- 6. **Emit Artifacts:** Write `findings.md`, `findings.json`, and `summary.md`.
68
-
69
52
  ---
70
53
 
71
- ## Failure Recovery
72
-
73
- - **Zero Rules Active:** Re-run `/torusguard init` to activate rules.
74
- - **AST Parse Error:** Log syntax error on malformed file, skip, and continue.
75
- - **Scorer Failure:** Ensure Python 3.10+; verify finding JSON structure.
76
- - **Halt Trigger:** Abort if run folder cannot be allocated or disk write fails.
77
-
78
- ---
79
-
80
- ## Hallucination Guard
54
+ ## Execution Steps
81
55
 
82
- - ❌ Never invent finding IDs without AST line hashing.
83
- - ❌ Never flag test fixtures as critical security flaws.
84
- - ✅ Always calculate scores using `.torusguard/scripts/finding_scorer.py`.
56
+ 1. **Launch Audit Scan:**
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.
59
+ - **Mode C (MCP):** Call `torusguard_audit` with `{"target": "."}`.
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.
85
65
 
86
66
  ---
87
67
 
@@ -89,12 +69,12 @@ Inspect workspace prerequisites before launching static audit:
89
69
 
90
70
  ```markdown
91
71
  ### 🔎 TorusGuard Static Audit Results
92
- - **Run ID:** `run-YYYYMMDD-HHMMSS-audit`
93
- - **Files Scanned:** [Count] source files
72
+ - **Files Scanned:** [Count] source files ([Changed] changed)
73
+ - **Taint Paths Confirmed:** [Count] verified dataflows
94
74
  - **Total Findings:** [Count] ([Critical] Critical, [High] High)
95
75
  - **Root Cause Clusters:** [Count] architectural issues
96
- - **Confidence:** [Score]/100
97
- - **Artifact:** `.torusguard/runs/<run_id>/findings.md`
76
+ - **Confidence:** [Score]/100 (Evidence-Chain Calibrated)
77
+ - **Living Report:** `security_report.md`
98
78
  ```
99
79
 
100
80
  ---
@@ -102,4 +82,4 @@ Inspect workspace prerequisites before launching static audit:
102
82
  ## Next Steps
103
83
 
104
84
  1. Run `/torusguard verify` to validate exploitability and review evidence.
105
- 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,14 +1,14 @@
1
1
  ---
2
2
  description: Legal scope definition, target ownership proof verification, and safety boundary enforcement for runtime validation.
3
- tools: Read, Grep, Glob, Bash, Write
4
- version: 1.3.6
3
+ tools: Read, Grep, Glob, Bash, Write, run_command
4
+ version: 2.0.0
5
5
  agent: reviewer
6
6
  lifecycle-phase: Phase 1 (Authorization Gate)
7
7
  required-skills:
8
8
  - torusguard-authorize
9
9
  scripts-binding:
10
- - .torusguard/scripts/report_sync.py
11
- - .torusguard/scripts/safety_gate.py
10
+ - internal/validate/validate.go
11
+ - cmd/torusguard/main.go
12
12
  ---
13
13
 
14
14
  # /torusguard authorize — Legal Scope & Safety Gate
@@ -18,7 +18,17 @@ $ARGUMENTS
18
18
  ---
19
19
 
20
20
  ## Objective
21
- Legal scope definition, target ownership proof verification, and safety boundary enforcement.
21
+ Legal scope definition, target ownership proof verification, and safety boundary enforcement for runtime validation.
22
+
23
+ ---
24
+
25
+ ## Tri-Mode Execution
26
+
27
+ | Mode | Command / Tool | Execution Method |
28
+ | :--- | :--- | :--- |
29
+ | **Mode A: Terminal CLI** | `torusguard authorize` | Interactive boundary setup and cryptographic token generation. |
30
+ | **Mode B: AI Chat Slash** | `/torusguard authorize` | Conversational parameter collection and scope validation. |
31
+ | **Mode C: Native MCP Tool** | Safety Gate Guard | Administrative gatekeeper ensuring strict safety boundaries before probes. |
22
32
 
23
33
  ---
24
34
 
@@ -27,52 +37,20 @@ Legal scope definition, target ownership proof verification, and safety boundary
27
37
  Inspect authorization parameters and environment safety before executing:
28
38
  1. **Config Record (`.torusguard/config/torusguard.json`):** Assert repository is initialized.
29
39
  2. **Current Scope (`.torusguard/config/scope.json`):** Inspect active allowed targets, paths, and TTL expiry.
30
- 3. **Environment Classification:** Assert target is local or staging (`localhost`, `127.0.0.1`, `*.local`, `*.staging.*`). Production targets require explicit approval.
40
+ 3. **Environment Classification:** Assert target is local or staging (`localhost`, `127.0.0.1`, `*.staging.*`).
31
41
  4. **Destructive Guard:** Ensure state-changing operations (`DELETE`, bulk drops) remain blocked by default.
32
- 5. **Ownership Proof:** Verify target ownership token or local process binding.
33
- 6. **TTL Window:** Ensure authorization window does not exceed 24 hours.
34
-
35
- ---
36
-
37
- ## When to Use /torusguard authorize
38
-
39
- | Trigger Scenario | Recommended Action |
40
- | :--- | :--- |
41
- | Preparing for live HTTP probes or API validation | Run `/torusguard authorize` |
42
- | Updating allowed hosts, path prefixes, or rate limits | Run `/torusguard authorize` |
43
- | Static-only security audit | Skip authorize; run `/torusguard audit` |
44
- | Checking active legal scope status | Run `/torusguard status` |
45
- | Expired authorization window | Re-run `/torusguard authorize` |
42
+ 5. **TTL Window:** Ensure authorization window does not exceed 24 hours.
46
43
 
47
44
  ---
48
45
 
49
46
  ## Execution Steps
50
47
 
51
- 1. **Capture Scope Parameters:** Collect target URL, allowed paths, forbidden prefixes, and max request budget.
52
- 2. **Validate Host Ownership:** Verify target is local or matches authorized test domains.
53
- 3. **Invoke Safety Gate:**
54
- ```bash
55
- python .torusguard/scripts/safety_gate.py check --url <target_url>
56
- ```
57
- 4. **Write Scope File (`.torusguard/config/scope.json`):** Save authorized targets, valid TTL timestamp, and request rate caps.
58
- 5. **Confirm Scope Binding:** Verify `.torusguard/config/scope.json` parses as valid JSON against schema.
59
-
60
- ---
61
-
62
- ## Failure Recovery
63
-
64
- - **Unreachable Host:** Verify local server is running on the specified port.
65
- - **Production Target Warning:** If target resolves to an external production host, halt and request operator override.
66
- - **Malformed JSON:** Re-initialize `scope.json` from `.torusguard/schemas/auth-boundary.schema.json`.
67
- - **Halt Trigger:** Abort immediately if user provides wildcard target (`*`) or third-party domain.
68
-
69
- ---
70
-
71
- ## Hallucination Guard
72
-
73
- - ❌ Never proceed with runtime probing without an explicit, valid `.torusguard/config/scope.json`.
74
- - ❌ Never authorize destructive HTTP methods (`DELETE`, `DROP`) under default non-destructive policy.
75
- - ✅ Always validate targets through `.torusguard/scripts/safety_gate.py`.
48
+ 1. **Trigger Authorization:**
49
+ - **Mode A (CLI):** Run `torusguard authorize`.
50
+ - **Mode B (Chat):** Collect target host URL and allowed prefixes.
51
+ 2. **Generate Token:** Persist cryptographic authorization token into `.torusguard/auth.json`.
52
+ 3. **Write Scope Record:** Persist authorized targets and expiration TTL into `.torusguard/config/scope.json`.
53
+ 4. **Confirm Readiness:** Prepare environment for `/torusguard web-validate`.
76
54
 
77
55
  ---
78
56
 
@@ -81,9 +59,8 @@ Inspect authorization parameters and environment safety before executing:
81
59
  ```markdown
82
60
  ### 🔒 TorusGuard Authorization Gate
83
61
  - **Target URL:** [Target Host or URL]
84
- - **Environment:** [Localhost / Staging / Container]
85
- - **Allowed Paths:** [Path prefixes or all authorized]
86
- - **Rate Limit:** [Max requests / concurrency limit]
62
+ - **Environment:** [Localhost / Staging]
63
+ - **Session TTL:** 24 Hours
87
64
  - **Scope File:** `.torusguard/config/scope.json`
88
65
  - **Status:** AUTHORIZED — ready for `/torusguard web-validate`
89
66
  ```
@@ -92,5 +69,5 @@ Inspect authorization parameters and environment safety before executing:
92
69
 
93
70
  ## Next Steps
94
71
 
95
- 1. Run `/torusguard audit` to scan codebase for AST security vulnerabilities.
96
- 2. Run `/torusguard web-validate` to begin safe, authorized endpoint validation.
72
+ 1. Run `/torusguard web-validate` to begin safe, authorized endpoint validation.
73
+ 2. Run `/torusguard audit` to scan codebase for AST vulnerabilities.
@@ -0,0 +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,15 +1,14 @@
1
1
  ---
2
2
  description: Safe, bounded, single-step exploitability confirmation across 5 standard verification statuses.
3
- tools: Read, Grep, Glob, Bash, Write
4
- version: 1.3.6
3
+ tools: Read, Grep, Glob, Bash, Write, run_command
4
+ version: 2.0.0
5
5
  agent: validator
6
6
  lifecycle-phase: Phase 3c (Exploitability Check)
7
7
  required-skills:
8
8
  - torusguard-exploit-check
9
9
  scripts-binding:
10
- - .torusguard/scripts/report_sync.py
11
- - .torusguard/scripts/safety_gate.py
12
- - .torusguard/scripts/finding_scorer.py
10
+ - internal/validate/validate.go
11
+ - cmd/torusguard/main.go
13
12
  ---
14
13
 
15
14
  # /torusguard exploit-check — Bounded Exploitability Confirmation
@@ -19,62 +18,43 @@ $ARGUMENTS
19
18
  ---
20
19
 
21
20
  ## Objective
22
- Safe, bounded, single-step exploitability confirmation across 5 standard verification statuses.
21
+ Safe, bounded, single-step exploitability confirmation using inert canary tokens without data loss or weaponized execution.
23
22
 
24
23
  ---
25
24
 
26
- ## Mandatory Pre-Flight Context Inspection
25
+ ## Tri-Mode Execution
27
26
 
28
- Inspect authorization parameters and probe safety constraints:
29
- 1. **Scope Check (`scope.json`):** Assert endpoint is authorized.
30
- 2. **Approved Probes:** Use benign canaries (SQLi math, HTML marker, unauth read).
31
- 3. **Destructive Ban:** Strictly prohibit drops, DOS, or weaponized payloads.
32
- 4. **Safety Gate:** Verify probe with `safety_gate.py` prior to dispatch.
33
- 5. **Bound:** Limit to single non-destructive HTTP request per finding.
34
- 6. **Audit Trail:** Inject `X-TorusGuard-AuthID` header on all outbound requests.
27
+ | Mode | Command / Tool | Execution Method |
28
+ | :--- | :--- | :--- |
29
+ | **Mode A: Terminal CLI** | `torusguard exploit-check [--url <url>] [--finding <id>]` | Terminal execution of sentinel canary prober. |
30
+ | **Mode B: AI Chat Slash** | `/torusguard exploit-check` | Conversational exploitability triage and status classification. |
31
+ | **Mode C: Native MCP Tool** | Bounded Probe Engine | Safe probe execution guarded by inert tokens and safety gate. |
35
32
 
36
33
  ---
37
34
 
38
- ## When to Use /torusguard exploit-check
35
+ ## Mandatory Pre-Flight Context Inspection
39
36
 
40
- | Trigger Scenario | Recommended Action |
41
- | :--- | :--- |
42
- | Confirming whether a flaw is practically exploitable | Run `/torusguard exploit-check` |
43
- | Upgrading Medium confidence finding to Confirmed | Run `/torusguard exploit-check` |
44
- | Verifying IDOR or tenant isolation boundaries | Run `/torusguard exploit-check` |
45
- | Routine endpoint header inspection | Run `/torusguard web-validate` |
46
- | Applying approved remediation patch | Run `/torusguard apply` |
37
+ Inspect authorization parameters and probe safety constraints:
38
+ 1. **Scope Check (`scope.json`):** Assert endpoint is authorized.
39
+ 2. **Approved Probes:** Use benign canaries (SQLi math identity `' OR 1=1--`, HTML marker `<tg-canary-tag>`).
40
+ 3. **Destructive Ban:** Strictly prohibit drops, DOS, or weaponized payloads.
41
+ 4. **Bound:** Limit to single non-destructive HTTP request per finding.
42
+ 5. **Audit Trail:** Inject `X-TorusGuard-AuthID` header on all outbound requests.
47
43
 
48
44
  ---
49
45
 
50
46
  ## Execution Steps
51
47
 
52
- 1. **Verify Authorization Scope:** Confirm target host and route in `scope.json`.
53
- 2. **Select Safe Canary:** Choose inert mathematical sentinel or unauth GET.
54
- 3. **Validate With Safety Gate:**
55
- ```bash
56
- python .torusguard/scripts/safety_gate.py check --url <target_url> --payload <canary>
57
- ```
58
- 4. **Dispatch Bounded Single Probe:** Send request with header `X-TorusGuard-AuthID`.
59
- 5. **Classify Status:** Evaluate response against 5 outcomes: `Confirmed`, `Needs Review`, `Not Reproducible`, `Blocked by Controls`, `Out of Scope`.
60
- 6. **Emit Artifacts:** Write `exploit-check.md` and update `findings.json`.
61
-
62
- ---
63
-
64
- ## Failure Recovery
65
-
66
- - **Connection Refused:** Verify target server is running locally on port.
67
- - **Safety Gate Block:** If `Manual Only`, halt automated probe and request human review.
68
- - **Ambiguous Response:** Mark finding as `Needs Review`; never assume exploit without proof.
69
- - **Halt Trigger:** Abort if probe causes server 500 error or unexpected crash.
70
-
71
- ---
72
-
73
- ## Hallucination Guard
74
-
75
- - ❌ Never classify a vulnerability as `Confirmed` without direct sentinel reflection.
76
- - ❌ Never execute brute force attacks or automated password spraying.
77
- - ✅ Always provide reproducible curl commands with redacted credentials.
48
+ 1. **Trigger Exploit Check:**
49
+ - **Mode A (CLI):** Run `torusguard exploit-check --url http://localhost:3000 --finding TG-SEC-001`.
50
+ - **Mode B (Chat):** Review response to inert canary probe.
51
+ 2. **Classify Status:** Evaluate response against 5 canonical outcomes:
52
+ - `Confirmed`: Canary reflected or secondary tenant data leaked.
53
+ - `Not Reproducible`: Endpoint responded with 401/403 or sanitized input.
54
+ - `Needs Review`: Ambiguous status code or incomplete response.
55
+ - `Blocked by Controls`: WAF or rate limiter stopped probe.
56
+ - `Out of Scope`: Target endpoint is not authorized.
57
+ 3. **Update Living Report:** Record outcome in `security_report.md`.
78
58
 
79
59
  ---
80
60
 
@@ -84,10 +64,8 @@ Inspect authorization parameters and probe safety constraints:
84
64
  ### 🎯 TorusGuard Exploitability Confirmation
85
65
  - **Target Route:** `[METHOD] /path`
86
66
  - **Finding ID:** `TG-XXX-HASH`
87
- - **Canary Used:** [Inert Math Sentinel / Unauth Read]
88
67
  - **Status:** [Confirmed / Not Reproducible / Blocked]
89
68
  - **Evidence:** [Response snippet demonstrating leak or block]
90
- - **Replay Curl:** `curl -X [METHOD] http://localhost:PORT/path ...`
91
69
  ```
92
70
 
93
71
  ---
@@ -0,0 +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`.