torusguard 0.9.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.
- package/.torusguard/.manifest.json +95 -0
- package/.torusguard/ARCHITECTURE.md +168 -0
- package/.torusguard/TORUSGUARD.md +145 -0
- package/.torusguard/agents/auditor.md +41 -0
- package/.torusguard/agents/profiler.md +49 -0
- package/.torusguard/agents/remediator.md +41 -0
- package/.torusguard/agents/reviewer.md +39 -0
- package/.torusguard/agents/validator.md +46 -0
- package/.torusguard/config/scope.json +24 -0
- package/.torusguard/config/slash-commands.json +102 -0
- package/.torusguard/config/torusguard.json +30 -0
- package/.torusguard/references/django-security.md +43 -0
- package/.torusguard/references/drf-security.md +20 -0
- package/.torusguard/references/express-security.md +103 -0
- package/.torusguard/references/fastapi-security.md +20 -0
- package/.torusguard/references/firebase-security.md +78 -0
- package/.torusguard/references/flask-security.md +20 -0
- package/.torusguard/references/nextjs-security.md +96 -0
- package/.torusguard/references/react-vite-security.md +97 -0
- package/.torusguard/references/sqlalchemy-security.md +16 -0
- package/.torusguard/references/supabase-security.md +84 -0
- package/.torusguard/rules/README.md +62 -0
- package/.torusguard/rules/TORUSGUARD.md +145 -0
- package/.torusguard/rules/active/.gitkeep +0 -0
- package/.torusguard/rules/active/TG-DIFF-001.md +20 -0
- package/.torusguard/rules/active/TG-DIFF-002.md +20 -0
- package/.torusguard/rules/active/TG-DIFF-003.md +19 -0
- package/.torusguard/runs/.gitkeep +0 -0
- package/.torusguard/schemas/authorization.schema.json +81 -0
- package/.torusguard/schemas/confidence.schema.json +72 -0
- package/.torusguard/schemas/evidence.schema.json +66 -0
- package/.torusguard/schemas/finding.schema.json +164 -0
- package/.torusguard/schemas/provenance.schema.json +46 -0
- package/.torusguard/schemas/remediation.schema.json +59 -0
- package/.torusguard/schemas/retest.schema.json +53 -0
- package/.torusguard/schemas/runtime-evidence.schema.json +72 -0
- package/.torusguard/scripts/__pycache__/diff_guard.cpython-311.pyc +0 -0
- package/.torusguard/scripts/__pycache__/monorepo_detector.cpython-311.pyc +0 -0
- package/.torusguard/scripts/diff_guard.py +171 -0
- package/.torusguard/scripts/finding_scorer.py +86 -0
- package/.torusguard/scripts/manifest_builder.py +130 -0
- package/.torusguard/scripts/monorepo_detector.py +164 -0
- package/.torusguard/scripts/run_manager.py +89 -0
- package/.torusguard/scripts/safety_gate.py +64 -0
- package/.torusguard/scripts/sarif_exporter.py +116 -0
- package/.torusguard/scripts/stack_detect.py +152 -0
- package/.torusguard/skills/torusguard/SKILL.md +37 -0
- package/.torusguard/skills/torusguard/bootstrap.py +158 -0
- package/.torusguard/skills/torusguard/references/auth-and-sessions.md +56 -0
- package/.torusguard/skills/torusguard/references/business-logic-and-abuse.md +23 -0
- package/.torusguard/skills/torusguard/references/cache-and-sensitive-responses.md +10 -0
- package/.torusguard/skills/torusguard/references/client-code-exposure.md +55 -0
- package/.torusguard/skills/torusguard/references/csrf-and-cross-origin.md +11 -0
- package/.torusguard/skills/torusguard/references/dependency-and-supply-chain.md +22 -0
- package/.torusguard/skills/torusguard/references/django-security.md +43 -0
- package/.torusguard/skills/torusguard/references/drf-security.md +20 -0
- package/.torusguard/skills/torusguard/references/fastapi-security.md +20 -0
- package/.torusguard/skills/torusguard/references/flask-security.md +20 -0
- package/.torusguard/skills/torusguard/references/frontend-no-db.md +53 -0
- package/.torusguard/skills/torusguard/references/graphql-security.md +12 -0
- package/.torusguard/skills/torusguard/references/input-and-injection.md +51 -0
- package/.torusguard/skills/torusguard/references/mass-assignment-and-property-auth.md +22 -0
- package/.torusguard/skills/torusguard/references/platform-hardening.md +56 -0
- package/.torusguard/skills/torusguard/references/python-dependencies.md +16 -0
- package/.torusguard/skills/torusguard/references/python-security-overview.md +12 -0
- package/.torusguard/skills/torusguard/references/rate-limit-and-abuse.md +57 -0
- package/.torusguard/skills/torusguard/references/secrets-and-config.md +64 -0
- package/.torusguard/skills/torusguard/references/sqlalchemy-security.md +16 -0
- package/.torusguard/skills/torusguard/references/ssrf-and-outbound-requests.md +46 -0
- package/.torusguard/skills/torusguard/references/webhook-security.md +15 -0
- package/.torusguard/skills/torusguard/references/websocket-security.md +12 -0
- package/.torusguard/skills/torusguard-apply/SKILL.md +46 -0
- package/.torusguard/skills/torusguard-audit/SKILL.md +70 -0
- package/.torusguard/skills/torusguard-authorize/SKILL.md +47 -0
- package/.torusguard/skills/torusguard-exploit-check/SKILL.md +64 -0
- package/.torusguard/skills/torusguard-full/SKILL.md +70 -0
- package/.torusguard/skills/torusguard-harden/SKILL.md +63 -0
- package/.torusguard/skills/torusguard-init/SKILL.md +52 -0
- package/.torusguard/skills/torusguard-recheck/SKILL.md +53 -0
- package/.torusguard/skills/torusguard-report/SKILL.md +54 -0
- package/.torusguard/skills/torusguard-status/SKILL.md +42 -0
- package/.torusguard/skills/torusguard-verify/SKILL.md +55 -0
- package/.torusguard/skills/torusguard-web-validate/SKILL.md +64 -0
- package/.torusguard/templates/audit-report.template.md +54 -0
- package/.torusguard/templates/authorization.template.md +34 -0
- package/.torusguard/templates/finding-card.template.md +32 -0
- package/.torusguard/templates/remediation-bundle.template.md +35 -0
- package/.torusguard/workflows/apply.md +95 -0
- package/.torusguard/workflows/audit.md +93 -0
- package/.torusguard/workflows/authorize.md +95 -0
- package/.torusguard/workflows/exploit-check.md +97 -0
- package/.torusguard/workflows/harden.md +93 -0
- package/.torusguard/workflows/init.md +95 -0
- package/.torusguard/workflows/recheck.md +95 -0
- package/.torusguard/workflows/report.md +95 -0
- package/.torusguard/workflows/status.md +95 -0
- package/.torusguard/workflows/verify.md +95 -0
- package/.torusguard/workflows/web-validate.md +95 -0
- package/LICENSE +21 -0
- package/README.md +319 -0
- package/bin/torusguard.js +110 -0
- package/install.py +98 -0
- package/package.json +48 -0
- package/skills/torusguard/SKILL.md +41 -0
- package/skills/torusguard/__pycache__/bootstrap.cpython-311.pyc +0 -0
- package/skills/torusguard/bootstrap.py +256 -0
- package/skills/torusguard/payload/.manifest.json +95 -0
- package/skills/torusguard/payload/ARCHITECTURE.md +168 -0
- package/skills/torusguard/payload/TORUSGUARD.md +145 -0
- package/skills/torusguard/payload/agents/auditor.md +41 -0
- package/skills/torusguard/payload/agents/profiler.md +49 -0
- package/skills/torusguard/payload/agents/remediator.md +41 -0
- package/skills/torusguard/payload/agents/reviewer.md +39 -0
- package/skills/torusguard/payload/agents/validator.md +46 -0
- package/skills/torusguard/payload/config/scope.json +24 -0
- package/skills/torusguard/payload/config/slash-commands.json +102 -0
- package/skills/torusguard/payload/config/torusguard.json +30 -0
- package/skills/torusguard/payload/references/django-security.md +43 -0
- package/skills/torusguard/payload/references/drf-security.md +20 -0
- package/skills/torusguard/payload/references/express-security.md +103 -0
- package/skills/torusguard/payload/references/fastapi-security.md +20 -0
- package/skills/torusguard/payload/references/firebase-security.md +78 -0
- package/skills/torusguard/payload/references/flask-security.md +20 -0
- package/skills/torusguard/payload/references/nextjs-security.md +96 -0
- package/skills/torusguard/payload/references/react-vite-security.md +97 -0
- package/skills/torusguard/payload/references/sqlalchemy-security.md +16 -0
- package/skills/torusguard/payload/references/supabase-security.md +84 -0
- package/skills/torusguard/payload/rules/README.md +62 -0
- package/skills/torusguard/payload/rules/TORUSGUARD.md +145 -0
- package/skills/torusguard/payload/rules/active/.gitkeep +0 -0
- package/skills/torusguard/payload/rules/active/TG-DIFF-001.md +20 -0
- package/skills/torusguard/payload/rules/active/TG-DIFF-002.md +20 -0
- package/skills/torusguard/payload/rules/active/TG-DIFF-003.md +19 -0
- package/skills/torusguard/payload/schemas/authorization.schema.json +81 -0
- package/skills/torusguard/payload/schemas/confidence.schema.json +72 -0
- package/skills/torusguard/payload/schemas/evidence.schema.json +66 -0
- package/skills/torusguard/payload/schemas/finding.schema.json +164 -0
- package/skills/torusguard/payload/schemas/provenance.schema.json +46 -0
- package/skills/torusguard/payload/schemas/remediation.schema.json +59 -0
- package/skills/torusguard/payload/schemas/retest.schema.json +53 -0
- package/skills/torusguard/payload/schemas/runtime-evidence.schema.json +72 -0
- package/skills/torusguard/payload/scripts/diff_guard.py +171 -0
- package/skills/torusguard/payload/scripts/finding_scorer.py +86 -0
- package/skills/torusguard/payload/scripts/manifest_builder.py +130 -0
- package/skills/torusguard/payload/scripts/monorepo_detector.py +164 -0
- package/skills/torusguard/payload/scripts/run_manager.py +89 -0
- package/skills/torusguard/payload/scripts/safety_gate.py +64 -0
- package/skills/torusguard/payload/scripts/sarif_exporter.py +116 -0
- package/skills/torusguard/payload/scripts/stack_detect.py +152 -0
- package/skills/torusguard/payload/skills/torusguard/SKILL.md +37 -0
- package/skills/torusguard/payload/skills/torusguard/bootstrap.py +158 -0
- package/skills/torusguard/payload/skills/torusguard/references/auth-and-sessions.md +56 -0
- package/skills/torusguard/payload/skills/torusguard/references/business-logic-and-abuse.md +23 -0
- package/skills/torusguard/payload/skills/torusguard/references/cache-and-sensitive-responses.md +10 -0
- package/skills/torusguard/payload/skills/torusguard/references/client-code-exposure.md +55 -0
- package/skills/torusguard/payload/skills/torusguard/references/csrf-and-cross-origin.md +11 -0
- package/skills/torusguard/payload/skills/torusguard/references/dependency-and-supply-chain.md +22 -0
- package/skills/torusguard/payload/skills/torusguard/references/django-security.md +43 -0
- package/skills/torusguard/payload/skills/torusguard/references/drf-security.md +20 -0
- package/skills/torusguard/payload/skills/torusguard/references/fastapi-security.md +20 -0
- package/skills/torusguard/payload/skills/torusguard/references/flask-security.md +20 -0
- package/skills/torusguard/payload/skills/torusguard/references/frontend-no-db.md +53 -0
- package/skills/torusguard/payload/skills/torusguard/references/graphql-security.md +12 -0
- package/skills/torusguard/payload/skills/torusguard/references/input-and-injection.md +51 -0
- package/skills/torusguard/payload/skills/torusguard/references/mass-assignment-and-property-auth.md +22 -0
- package/skills/torusguard/payload/skills/torusguard/references/platform-hardening.md +56 -0
- package/skills/torusguard/payload/skills/torusguard/references/python-dependencies.md +16 -0
- package/skills/torusguard/payload/skills/torusguard/references/python-security-overview.md +12 -0
- package/skills/torusguard/payload/skills/torusguard/references/rate-limit-and-abuse.md +57 -0
- package/skills/torusguard/payload/skills/torusguard/references/secrets-and-config.md +64 -0
- package/skills/torusguard/payload/skills/torusguard/references/sqlalchemy-security.md +16 -0
- package/skills/torusguard/payload/skills/torusguard/references/ssrf-and-outbound-requests.md +46 -0
- package/skills/torusguard/payload/skills/torusguard/references/webhook-security.md +15 -0
- package/skills/torusguard/payload/skills/torusguard/references/websocket-security.md +12 -0
- package/skills/torusguard/payload/skills/torusguard-apply/SKILL.md +46 -0
- package/skills/torusguard/payload/skills/torusguard-audit/SKILL.md +70 -0
- package/skills/torusguard/payload/skills/torusguard-authorize/SKILL.md +47 -0
- package/skills/torusguard/payload/skills/torusguard-exploit-check/SKILL.md +64 -0
- package/skills/torusguard/payload/skills/torusguard-full/SKILL.md +70 -0
- package/skills/torusguard/payload/skills/torusguard-harden/SKILL.md +63 -0
- package/skills/torusguard/payload/skills/torusguard-init/SKILL.md +52 -0
- package/skills/torusguard/payload/skills/torusguard-recheck/SKILL.md +53 -0
- package/skills/torusguard/payload/skills/torusguard-report/SKILL.md +54 -0
- package/skills/torusguard/payload/skills/torusguard-status/SKILL.md +42 -0
- package/skills/torusguard/payload/skills/torusguard-verify/SKILL.md +55 -0
- package/skills/torusguard/payload/skills/torusguard-web-validate/SKILL.md +64 -0
- package/skills/torusguard/payload/templates/audit-report.template.md +54 -0
- package/skills/torusguard/payload/templates/authorization.template.md +34 -0
- package/skills/torusguard/payload/templates/finding-card.template.md +32 -0
- package/skills/torusguard/payload/templates/remediation-bundle.template.md +35 -0
- package/skills/torusguard/payload/workflows/apply.md +95 -0
- package/skills/torusguard/payload/workflows/audit.md +93 -0
- package/skills/torusguard/payload/workflows/authorize.md +95 -0
- package/skills/torusguard/payload/workflows/exploit-check.md +97 -0
- package/skills/torusguard/payload/workflows/harden.md +93 -0
- package/skills/torusguard/payload/workflows/init.md +95 -0
- package/skills/torusguard/payload/workflows/recheck.md +95 -0
- package/skills/torusguard/payload/workflows/report.md +95 -0
- package/skills/torusguard/payload/workflows/status.md +95 -0
- package/skills/torusguard/payload/workflows/verify.md +95 -0
- package/skills/torusguard/payload/workflows/web-validate.md +95 -0
- package/skills/torusguard/references/auth-and-sessions.md +56 -0
- package/skills/torusguard/references/business-logic-and-abuse.md +23 -0
- package/skills/torusguard/references/cache-and-sensitive-responses.md +10 -0
- package/skills/torusguard/references/client-code-exposure.md +55 -0
- package/skills/torusguard/references/csrf-and-cross-origin.md +11 -0
- package/skills/torusguard/references/dependency-and-supply-chain.md +22 -0
- package/skills/torusguard/references/django-security.md +43 -0
- package/skills/torusguard/references/drf-security.md +20 -0
- package/skills/torusguard/references/fastapi-security.md +20 -0
- package/skills/torusguard/references/flask-security.md +20 -0
- package/skills/torusguard/references/frontend-no-db.md +53 -0
- package/skills/torusguard/references/graphql-security.md +12 -0
- package/skills/torusguard/references/input-and-injection.md +51 -0
- package/skills/torusguard/references/mass-assignment-and-property-auth.md +22 -0
- package/skills/torusguard/references/platform-hardening.md +56 -0
- package/skills/torusguard/references/python-dependencies.md +16 -0
- package/skills/torusguard/references/python-security-overview.md +12 -0
- package/skills/torusguard/references/rate-limit-and-abuse.md +57 -0
- package/skills/torusguard/references/secrets-and-config.md +64 -0
- package/skills/torusguard/references/sqlalchemy-security.md +16 -0
- package/skills/torusguard/references/ssrf-and-outbound-requests.md +46 -0
- package/skills/torusguard/references/webhook-security.md +15 -0
- package/skills/torusguard/references/websocket-security.md +12 -0
- package/skills/torusguard-apply/SKILL.md +46 -0
- package/skills/torusguard-audit/SKILL.md +70 -0
- package/skills/torusguard-authorize/SKILL.md +47 -0
- package/skills/torusguard-exploit-check/SKILL.md +64 -0
- package/skills/torusguard-full/SKILL.md +70 -0
- package/skills/torusguard-harden/SKILL.md +63 -0
- package/skills/torusguard-init/SKILL.md +52 -0
- package/skills/torusguard-recheck/SKILL.md +53 -0
- package/skills/torusguard-report/SKILL.md +54 -0
- package/skills/torusguard-status/SKILL.md +42 -0
- package/skills/torusguard-verify/SKILL.md +55 -0
- package/skills/torusguard-web-validate/SKILL.md +64 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Executive posture reporting, cluster analysis, signed compliance audit, and OASIS SARIF v2.1.0 structured export.
|
|
3
|
+
tools: Read, Grep, Glob, Bash, Write
|
|
4
|
+
version: 0.9.2
|
|
5
|
+
agent: reviewer
|
|
6
|
+
lifecycle-phase: Phase 7 (Reporting & SARIF Export)
|
|
7
|
+
required-skills:
|
|
8
|
+
- torusguard-report
|
|
9
|
+
scripts-binding:
|
|
10
|
+
- .torusguard/scripts/sarif_exporter.py
|
|
11
|
+
- .torusguard/scripts/run_manager.py
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# /torusguard report โ Unified Security Posture Report & SARIF Export
|
|
15
|
+
|
|
16
|
+
$ARGUMENTS
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Objective
|
|
21
|
+
Executive posture reporting, cluster analysis, signed compliance audit, and SARIF v2.1.0 export.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Mandatory Pre-Flight Context Inspection
|
|
26
|
+
|
|
27
|
+
Inspect run records and reporting parameters before generating release artifacts:
|
|
28
|
+
1. **Active Run Records:** Ensure target run folder contains `findings.json` or `findings.md`.
|
|
29
|
+
2. **SARIF v2.1.0 Schema:** Validate output structure against official OASIS SARIF standard.
|
|
30
|
+
3. **Multi-Analysis Category:** Tag static findings under category `torusguard/static` to prevent CI collision.
|
|
31
|
+
4. **Secret Masking:** Ensure zero unredacted authorization tokens or API keys appear in report.
|
|
32
|
+
5. **Role Boundary:** Enforce reviewer agent sign-off before archiving run results.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## When to Use /torusguard report
|
|
37
|
+
|
|
38
|
+
| Trigger Scenario | Recommended Action |
|
|
39
|
+
| :--- | :--- |
|
|
40
|
+
| Concluding a security review cycle or audit milestone | Run `/torusguard report` |
|
|
41
|
+
| Exporting SARIF v2.1.0 logs for GitHub Code Scanning | Run `/torusguard report` |
|
|
42
|
+
| Sharing executive posture summaries with stakeholders | Run `/torusguard report` |
|
|
43
|
+
| Applying code modifications | Run `/torusguard apply` |
|
|
44
|
+
| Re-checking modified files | Run `/torusguard recheck` |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Execution Steps
|
|
49
|
+
|
|
50
|
+
1. **Aggregate Lifecycle Data:** Load all finding cards, verification traces, and recheck logs.
|
|
51
|
+
2. **Export OASIS SARIF v2.1.0:**
|
|
52
|
+
```bash
|
|
53
|
+
python .torusguard/scripts/sarif_exporter.py --run <run_dir> --output <run_dir>/results.sarif
|
|
54
|
+
```
|
|
55
|
+
3. **Compile Executive Markdown Report:** Generate `report.md` with executive summary, posture score, and metrics.
|
|
56
|
+
4. **Sign Off Run Manifest:** Update `.torusguard/runs/<run_id>/manifest.json` with final status counts.
|
|
57
|
+
5. **Archive Results:** Confirm artifacts (`report.md`, `results.sarif`, `summary.md`) are saved on disk.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Failure Recovery
|
|
62
|
+
|
|
63
|
+
- **SARIF Schema Error:** Re-run `sarif_exporter.py` with schema validation flag to locate invalid properties.
|
|
64
|
+
- **Empty Findings List:** Emit valid clean report indicating zero security vulnerabilities detected.
|
|
65
|
+
- **Missing Run Folder:** Point script to latest valid timestamped run in `.torusguard/runs/`.
|
|
66
|
+
- **Halt Trigger:** Abort if unredacted private secrets are detected in output text.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Hallucination Guard
|
|
71
|
+
|
|
72
|
+
- โ Never invent vulnerability counts not backed by actual findings in the run ledger.
|
|
73
|
+
- โ Never generate invalid SARIF JSON with missing physical location URIs.
|
|
74
|
+
- โ
Always export standard-compliant SARIF v2.1.0 with AST line fingerprints.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Output Card Format
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
### ๐ TorusGuard Security Posture Report
|
|
82
|
+
- **Run ID:** `run-YYYYMMDD-HHMMSS`
|
|
83
|
+
- **Total Findings:** [Count] ([Fixed] Fixed, [Open] Open)
|
|
84
|
+
- **Security Posture Score:** [Score]/100
|
|
85
|
+
- **SARIF v2.1.0 Export:** `.torusguard/runs/<run_id>/results.sarif`
|
|
86
|
+
- **Executive Report:** `.torusguard/runs/<run_id>/report.md`
|
|
87
|
+
- **Status:** COMPLETE โ report published
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Next Steps
|
|
93
|
+
|
|
94
|
+
1. Upload `results.sarif` to GitHub Code Scanning via `.github/workflows/`.
|
|
95
|
+
2. Share `report.md` with engineering stakeholders and project maintainers.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Read-only diagnostic overview of workspace security posture, active configuration, rules catalog, and run history.
|
|
3
|
+
tools: Read, Grep, Glob, Bash
|
|
4
|
+
version: 0.9.2
|
|
5
|
+
agent: reviewer
|
|
6
|
+
lifecycle-phase: System / Diagnostics
|
|
7
|
+
required-skills:
|
|
8
|
+
- torusguard-status
|
|
9
|
+
scripts-binding:
|
|
10
|
+
- .torusguard/scripts/run_manager.py
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# /torusguard status โ Workspace Security Posture & Diagnostic Overview
|
|
14
|
+
|
|
15
|
+
$ARGUMENTS
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Objective
|
|
20
|
+
Read-only diagnostic overview of workspace security posture, active configuration, and run history.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Mandatory Pre-Flight Context Inspection
|
|
25
|
+
|
|
26
|
+
Inspect workspace state and configuration records prior to status display:
|
|
27
|
+
1. **Config State (`.torusguard/config/torusguard.json`):** Confirm workspace initialization and read detected stack.
|
|
28
|
+
2. **Active Rules Directory (`.torusguard/rules/active/`):** Count active rule files.
|
|
29
|
+
3. **Run Folder Ledger (`.torusguard/runs/`):** Check run history and locate latest `manifest.json`.
|
|
30
|
+
4. **Scope Record (`.torusguard/config/scope.json`):** Check whether runtime authorization TTL is active or expired.
|
|
31
|
+
5. **Read-Only Invariant:** Ensure command performs zero file modifications or disk mutations.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## When to Use /torusguard status
|
|
36
|
+
|
|
37
|
+
| Trigger Scenario | Recommended Action |
|
|
38
|
+
| :--- | :--- |
|
|
39
|
+
| Checking workspace configuration and active security posture | Run `/torusguard status` |
|
|
40
|
+
| Reviewing recent audit runs and finding counts | Run `/torusguard status` |
|
|
41
|
+
| Checking active legal scope authorization TTL | Run `/torusguard status` |
|
|
42
|
+
| Initializing workspace for the first time | Run `/torusguard init` |
|
|
43
|
+
| Executing full security scan | Run `/torusguard audit` |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Execution Steps
|
|
48
|
+
|
|
49
|
+
1. **Read Configuration:** Load `.torusguard/config/torusguard.json`; extract stack, version, and enabled rule count.
|
|
50
|
+
2. **Enumerate Active Rules:** Count rule files physically present in `.torusguard/rules/active/`.
|
|
51
|
+
3. **Inspect Run History:**
|
|
52
|
+
```bash
|
|
53
|
+
python .torusguard/scripts/run_manager.py list
|
|
54
|
+
```
|
|
55
|
+
4. **Evaluate Scope Expiry:** Parse `.torusguard/config/scope.json`; report if TTL is valid or expired.
|
|
56
|
+
5. **Print Status Overview:** Render complete workspace diagnostic overview card.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Failure Recovery
|
|
61
|
+
|
|
62
|
+
- **Uninitialized Workspace:** If config is missing, prompt user to execute `/torusguard init`.
|
|
63
|
+
- **Zero Runs Found:** Display clean status card noting no historical audit runs exist yet.
|
|
64
|
+
- **Corrupt Config File:** Report parsing error and recommend re-running `/torusguard init`.
|
|
65
|
+
- **Halt Trigger:** Abort command if read access to `.torusguard/` is denied.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Hallucination Guard
|
|
70
|
+
|
|
71
|
+
- โ Never display fabricated finding counts not substantiated by run manifests.
|
|
72
|
+
- โ Never execute modifying shell commands or edit source code during status inspection.
|
|
73
|
+
- โ
Always report factual file counts from `.torusguard/rules/active/` and `.torusguard/runs/`.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Output Card Format
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
### ๐ก๏ธ TorusGuard Workspace Status
|
|
81
|
+
- **Version:** v0.9.2
|
|
82
|
+
- **Framework Detected:** [Stack or None]
|
|
83
|
+
- **Active Rules:** [Count] rules active in `.torusguard/rules/active/`
|
|
84
|
+
- **Total Runs:** [Count] historical runs recorded
|
|
85
|
+
- **Latest Run:** `run-YYYYMMDD-HHMMSS` ([Findings Count] findings)
|
|
86
|
+
- **Scope Status:** [Authorized (TTL Active) / Expired / Unconfigured]
|
|
87
|
+
- **Health Posture:** [GOOD / ACTION NEEDED]
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Next Steps
|
|
93
|
+
|
|
94
|
+
1. Run `/torusguard audit` to scan codebase for security vulnerabilities.
|
|
95
|
+
2. Run `/torusguard authorize` to configure or refresh live target scope.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Evidence sufficiency verification, live disk line match audit, and finding score refinement.
|
|
3
|
+
tools: Read, Grep, Glob, Bash, Write
|
|
4
|
+
version: 0.9.2
|
|
5
|
+
agent: validator
|
|
6
|
+
lifecycle-phase: Phase 3a (Evidence Verification)
|
|
7
|
+
required-skills:
|
|
8
|
+
- torusguard-verify
|
|
9
|
+
scripts-binding:
|
|
10
|
+
- .torusguard/scripts/finding_scorer.py
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# /torusguard verify โ Evidence Verification & Score Refinement
|
|
14
|
+
|
|
15
|
+
$ARGUMENTS
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Objective
|
|
20
|
+
Evidence sufficiency verification, live disk line match audit, and finding score refinement.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Mandatory Pre-Flight Context Inspection
|
|
25
|
+
|
|
26
|
+
Inspect finding records and evidence integrity before verification:
|
|
27
|
+
1. **Latest Run Records (`.torusguard/runs/`):** Locate most recent audit run directory.
|
|
28
|
+
2. **Finding Files:** Confirm `findings.md` or `findings.json` exists in the target run folder.
|
|
29
|
+
3. **Live File Drift:** Assert cited source files have not been edited or relocated on disk.
|
|
30
|
+
4. **Scoring Model Calibration:** Ensure `finding_scorer.py` evaluates all 5 rubric dimensions.
|
|
31
|
+
5. **Role Boundary:** Enforce validator role; do not apply code modifications during verification.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## When to Use /torusguard verify
|
|
36
|
+
|
|
37
|
+
| Trigger Scenario | Recommended Action |
|
|
38
|
+
| :--- | :--- |
|
|
39
|
+
| Auditing whether static findings are valid code flaws | Run `/torusguard verify` |
|
|
40
|
+
| Upgrading Medium confidence finding to Confirmed | Run `/torusguard verify` |
|
|
41
|
+
| No audit run executed yet | Run `/torusguard audit` first |
|
|
42
|
+
| Running live network requests against endpoints | Run `/torusguard web-validate` |
|
|
43
|
+
| Generating patch after verification | Run `/torusguard harden` |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Execution Steps
|
|
48
|
+
|
|
49
|
+
1. **Locate Target Findings:** Load active findings from latest run directory.
|
|
50
|
+
2. **Live Disk Line Match:** Read current code at cited line ranges; verify AST snippet matches.
|
|
51
|
+
3. **Audit Evidence Sufficiency:** Assess whether taint path is unbroken and caller context is exposed.
|
|
52
|
+
4. **Refine Confidence Scores:**
|
|
53
|
+
```bash
|
|
54
|
+
python .torusguard/scripts/finding_scorer.py --run <run_dir> --verify
|
|
55
|
+
```
|
|
56
|
+
5. **Classify Status:** Assign verified state (`Confirmed`, `Plausible`, or `False Positive / Disputed`).
|
|
57
|
+
6. **Emit Verification Ledger:** Write `verified-evidence.md` into the active run folder.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Failure Recovery
|
|
62
|
+
|
|
63
|
+
- **Missing Run Folder:** Run `/torusguard audit` first to produce a valid run baseline.
|
|
64
|
+
- **Line Drift Detected:** Flag line mismatch; scan nearby lines (ยฑ25) for relocated AST sink.
|
|
65
|
+
- **Malformed Finding JSON:** Repair JSON structure using finding schema before scoring.
|
|
66
|
+
- **Halt Trigger:** Abort if cited files are completely deleted from disk.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Hallucination Guard
|
|
71
|
+
|
|
72
|
+
- โ Never confirm a finding if the cited sink has already been sanitized by middleware.
|
|
73
|
+
- โ Never bump confidence score without documenting unbroken taint source-to-sink flow.
|
|
74
|
+
- โ
Always anchor line matches to live disk reads using `view_file`.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Output Card Format
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
### ๐งช TorusGuard Evidence Verification
|
|
82
|
+
- **Run ID:** `run-YYYYMMDD-HHMMSS-audit`
|
|
83
|
+
- **Findings Evaluated:** [Count] findings
|
|
84
|
+
- **Confirmed Real:** [Count] verified flaws
|
|
85
|
+
- **Downgraded / False Positives:** [Count] filtered out
|
|
86
|
+
- **Refined Mean Score:** [Score]/100
|
|
87
|
+
- **Ledger:** `.torusguard/runs/<run_id>/verified-evidence.md`
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Next Steps
|
|
93
|
+
|
|
94
|
+
1. Run `/torusguard web-validate` if live endpoint probing is required.
|
|
95
|
+
2. Run `/torusguard harden` to build surgical patch bundles for verified flaws.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Authorized HTTP probing, token redaction, transparent audit header injection, and replay trace capture.
|
|
3
|
+
tools: Read, Grep, Glob, Bash, Write
|
|
4
|
+
version: 0.9.2
|
|
5
|
+
agent: validator
|
|
6
|
+
lifecycle-phase: Phase 3b (Runtime Web Validation)
|
|
7
|
+
required-skills:
|
|
8
|
+
- torusguard-web-validate
|
|
9
|
+
scripts-binding:
|
|
10
|
+
- .torusguard/scripts/safety_gate.py
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# /torusguard web-validate โ Bounded HTTP Probing & Session Capture
|
|
14
|
+
|
|
15
|
+
$ARGUMENTS
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Objective
|
|
20
|
+
Authorized HTTP probing, token redaction, transparent audit header injection, and replay capture.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Mandatory Pre-Flight Context Inspection
|
|
25
|
+
|
|
26
|
+
Inspect authorization parameters and safety limits before sending HTTP requests:
|
|
27
|
+
1. **Active Scope (`.torusguard/config/scope.json`):** Assert target host and path are authorized with valid TTL.
|
|
28
|
+
2. **Safety Gate Classification:** Test proposed endpoint against `.torusguard/scripts/safety_gate.py`.
|
|
29
|
+
3. **Sensitive Route Guard:** Ensure destructive endpoints (`DELETE`, account drops) are never called automatically.
|
|
30
|
+
4. **Token Redaction Pipeline:** Ensure bearer tokens and session cookies are masked (`Bearer [REDACTED]`).
|
|
31
|
+
5. **Request Budget:** Enforce maximum cap of 50 requests per validation session.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## When to Use /torusguard web-validate
|
|
36
|
+
|
|
37
|
+
| Trigger Scenario | Recommended Action |
|
|
38
|
+
| :--- | :--- |
|
|
39
|
+
| Testing live route accessibility and security headers | Run `/torusguard web-validate` |
|
|
40
|
+
| Verifying cookie security flags (`HttpOnly`, `Secure`, `SameSite`) | Run `/torusguard web-validate` |
|
|
41
|
+
| Checking CORS headers and authentication barriers | Run `/torusguard web-validate` |
|
|
42
|
+
| Pure static source code analysis | Run `/torusguard audit` |
|
|
43
|
+
| Confirming exploitable attack vectors | Run `/torusguard exploit-check` |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Execution Steps
|
|
48
|
+
|
|
49
|
+
1. **Verify Legal Scope:** Check target URL against `.torusguard/config/scope.json`.
|
|
50
|
+
2. **Invoke Safety Gate:**
|
|
51
|
+
```bash
|
|
52
|
+
python .torusguard/scripts/safety_gate.py check --url <target_url> --method GET
|
|
53
|
+
```
|
|
54
|
+
3. **Dispatch Non-Destructive Probe:** Send bounded HTTP request with audit header `X-TorusGuard-AuthID`.
|
|
55
|
+
4. **Redact Sensitive Headers:** Sanitize auth tokens and credentials in request and response objects.
|
|
56
|
+
5. **Write Replay Artifacts:**
|
|
57
|
+
Record sanitized trace in `.torusguard/runs/<run_id>/requests.json` and emit `web-validation.md`.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Failure Recovery
|
|
62
|
+
|
|
63
|
+
- **Target Offline:** Verify local dev server is active and accessible on designated host port.
|
|
64
|
+
- **Safety Gate Rejection (Manual Only):** Halt probe immediately; report endpoint requires human manual test.
|
|
65
|
+
- **Rate Limit / 429:** Back off exponentially (1s, 2s, 4s); stop session if 429 persists.
|
|
66
|
+
- **Halt Trigger:** Abort if target domain deviates from authorized allowlist in `scope.json`.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Hallucination Guard
|
|
71
|
+
|
|
72
|
+
- โ Never dispatch HTTP requests outside domains explicitly listed in `.torusguard/config/scope.json`.
|
|
73
|
+
- โ Never write raw Authorization headers or plaintext secrets to disk.
|
|
74
|
+
- โ
Always include transparent audit headers (`X-TorusGuard-AuthID`).
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Output Card Format
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
### ๐ TorusGuard Web Validation
|
|
82
|
+
- **Target Host:** [Host URL]
|
|
83
|
+
- **Endpoints Probed:** [Count] routes tested
|
|
84
|
+
- **Security Headers:** [CSP / HSTS / CORS status]
|
|
85
|
+
- **Cookie Security:** [HttpOnly / Secure / SameSite status]
|
|
86
|
+
- **Replay Trace:** `.torusguard/runs/<run_id>/replay.json`
|
|
87
|
+
- **Status:** COMPLETED โ non-destructive probe finished
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Next Steps
|
|
93
|
+
|
|
94
|
+
1. Run `/torusguard exploit-check` to confirm if reachable flaws constitute verified exploits.
|
|
95
|
+
2. Run `/torusguard harden` to build surgical remediation diffs.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jenish Lad
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|