@shiftleftpt/sbd-toe-mcp 0.6.3 → 0.7.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 (32) hide show
  1. package/assets/agent-guide.md +106 -24
  2. package/data/publish/algolia_entities_records_enriched.json +25370 -2
  3. package/data/publish/canonical_controls.json +1239 -0
  4. package/data/publish/canonical_requirements_s7.json +1859 -0
  5. package/data/publish/canonical_roles_s5.json +138 -0
  6. package/data/publish/lifecycle_user_stories.json +6558 -0
  7. package/data/publish/mitigated_threats.json +6945 -0
  8. package/data/publish/practice_assignments.json +16266 -0
  9. package/data/publish/sbdtoe-ontology.yaml +696 -0
  10. package/dist/backend/semantic-index-gateway.js +1 -1
  11. package/dist/index.js +230 -10
  12. package/dist/index.js.map +1 -1
  13. package/dist/resources/sbd-toe-resources.js +6 -1
  14. package/dist/resources/sbd-toe-resources.js.map +1 -1
  15. package/dist/tools/consult-security-requirements.d.ts +38 -0
  16. package/dist/tools/consult-security-requirements.js +115 -0
  17. package/dist/tools/consult-security-requirements.js.map +1 -0
  18. package/dist/tools/get-guide-by-role.d.ts +38 -0
  19. package/dist/tools/get-guide-by-role.js +109 -0
  20. package/dist/tools/get-guide-by-role.js.map +1 -0
  21. package/dist/tools/get-threat-landscape.d.ts +44 -0
  22. package/dist/tools/get-threat-landscape.js +116 -0
  23. package/dist/tools/get-threat-landscape.js.map +1 -0
  24. package/dist/tools/map-review-scope.js +5 -0
  25. package/dist/tools/map-review-scope.js.map +1 -1
  26. package/dist/tools/ontology-loader.d.ts +104 -0
  27. package/dist/tools/ontology-loader.js +206 -0
  28. package/dist/tools/ontology-loader.js.map +1 -0
  29. package/dist/tools/resolve-entities.d.ts +26 -0
  30. package/dist/tools/resolve-entities.js +143 -0
  31. package/dist/tools/resolve-entities.js.map +1 -0
  32. package/package.json +4 -1
@@ -49,32 +49,116 @@ Use when the user asks *what the manual says*, what applies, how to classify a p
49
49
  what controls or artefacts are required, or whether something is aligned with the manual.
50
50
 
51
51
  ```
52
- search_sbd_toe_manual ← conceptual questions, narrative context
53
- map_sbd_toe_applicability ← which chapters/controls apply to this project
54
- get_sbd_toe_chapter_brief ← what a specific chapter covers (phases, artefacts, topics)
55
- list_sbd_toe_chapters ← chapter discovery and navigation
56
- query_sbd_toe_entities ← specific controls (CTRL-*), artefacts (ART-*), practices
52
+ search_sbd_toe_manual ← conceptual questions, narrative context
53
+ map_sbd_toe_applicability ← which chapters/controls apply to this project
54
+ get_sbd_toe_chapter_brief ← what a specific chapter covers (phases, artefacts, topics)
55
+ list_sbd_toe_chapters ← chapter discovery and navigation
56
+ query_sbd_toe_entities ← specific controls (CTRL-*), artefacts (ART-*), practices
57
+
58
+ consult_security_requirements ← deterministic: requirements + controls for a risk level
59
+ params: risk_level (L1|L2|L3), concerns? (string[])
60
+ returns: requirements[], controls[], active_domains[],
61
+ active_categories[], rule_trace[]
62
+
63
+ resolve_entities ← low-level ontology filter engine
64
+ params: record_type, filters? (dot-notation), limit?
65
+ use for: enumerating roles, finding controls by domain,
66
+ listing requirements by category, exploring the ontology
57
67
  ```
58
68
 
69
+ **Prefer `consult_security_requirements` over `search_sbd_toe_manual`** when the question
70
+ is structured ("what requirements apply at L2?", "which controls are active for auth?").
71
+ Use `search_sbd_toe_manual` for narrative/conceptual questions.
72
+
73
+ #### Valid `concerns` values (ontology-controlled vocabulary)
74
+
75
+ | concern | Categories resolved | Meaning |
76
+ |---|---|---|
77
+ | `auth` | AUT, ACC, SES | Authentication, access control, sessions |
78
+ | `logging` | LOG | Audit logging, monitoring |
79
+ | `validation` | VAL, ERR | Input validation, error handling |
80
+ | `api` | API | API security |
81
+ | `config` | CFG | Configuration & environment hardening |
82
+ | `integrity` | INT | Integrity & integration |
83
+ | `distribution` | DST | Supply chain, packaging |
84
+ | `ide` | IDE | Development environment |
85
+ | `requirements` | REQ | Security requirements in SDLC |
86
+ | `architecture` | ARC | Secure architecture |
87
+ | `iac` | IAC | Infrastructure-as-Code |
88
+ | `encryption` | ENC | Cryptography & sensitive data |
89
+
90
+ Pass concerns as exact lowercase strings from the table above.
91
+
59
92
  ### GUIDE mode
60
93
  Use when the user asks *how to implement, design, structure, document, or review* something
61
94
  according to the manual.
62
95
 
63
96
  ```
64
97
  1. Obtain applicable guidance first (CONSULT mode)
65
- 2. Then apply it to generate, structure, or review the artefact
98
+ 2. Then apply that guidance to generate, structure, or review the artefact
66
99
 
67
- generate_document structured document skeleton for a type + risk level
68
- plan_sbd_toe_repo_governance ← governance plan for a repository
100
+ plan_sbd_toe_repo_governance list artefacts the manual identifies, grouped by chapter
69
101
  map_sbd_toe_review_scope ← which SbD-ToE bundles to review given changed files
102
+
103
+ get_guide_by_role ← deterministic: practice assignments + user stories
104
+ params: risk_level (L1|L2|L3), role? (string), phase? (string)
105
+ returns: assignments[], by_role{}, by_phase{}, user stories joined
106
+ use for: "what should a developer do at L2?",
107
+ "what practices apply in the design phase?"
108
+
109
+ get_threat_landscape ← deterministic: threats relevant to a risk level / concern set
110
+ params: risk_level (L1|L2|L3), concerns? (string[])
111
+ returns: threats[] with mitigation_confidence + mitigated_by[]
112
+ NOTE: runs consult internally — do NOT call consult first
113
+ use for: threat modelling context, "what threats apply to auth?"
70
114
  ```
71
115
 
116
+ #### Valid `role` values for `get_guide_by_role`
117
+
118
+ Canonical role IDs (pass exact or common alias — resolved automatically):
119
+
120
+ `developer` · `appsec` · `devops` · `grc` · `qa` · `security_champion` · `software_architect`
121
+ · `product_owner` · `scrum_master` · `team_lead` · `ciso` · `executive_management`
122
+ · `ops` · `pentester` · `compliance` · `auditor` · `ir` · `sre`
123
+
124
+ #### Interpreting tool output
125
+
126
+ | Field | What to communicate |
127
+ |---|---|
128
+ | `rule_trace` contains `CONCERNS_FILTER_REQUIREMENTS` | Tell user scope was narrowed to the specified concerns |
129
+ | `mitigation_confidence: "heuristic"` | Flag as inferred linkage — not structural evidence |
130
+ | `mitigation_confidence: "derived"` | Structural chapter-match — reliable |
131
+ | `assignments: []` / `threats: []` | Say "manual-grounded: not applicable in this scope" — do not invent |
132
+ | `active_domains` | List the security domains active at this risk level |
133
+
134
+ #### Pattern for complex answers (threat model / security plan / checklist)
135
+
136
+ 1. `consult_security_requirements(risk_level, concerns?)` — anchor active requirements & controls
137
+ 2. `get_threat_landscape(risk_level, concerns?)` — relevant threats + mitigating controls
138
+ 3. `get_guide_by_role(risk_level, role?, phase?)` — practices per role/phase
139
+ 4. Generate document grounded on steps 1–3 — label each claim as manual-grounded
140
+
141
+ > **The MCP surfaces what the manual says — the LLM generates content.**
142
+ > Use CONSULT tools to retrieve artefact descriptions, required sections, and controls.
143
+ > Then generate the actual document, template, or checklist based on that grounded context.
144
+
72
145
  > In governance, assessment, or planning tasks: **present the target artefact plan before
73
146
  > modifying any files.**
74
147
  >
75
148
  > In implementation tasks: **obtain applicable secure implementation guidance before
76
149
  > generating code** when security-relevant behaviour is involved.
77
150
 
151
+ ### SETUP mode
152
+ Use when the user wants to configure their AI client to use SbD-ToE natively.
153
+
154
+ ```
155
+ generate_sbd_toe_skill ← returns canonical skill/instructions content from sbd://toe/agent-guide
156
+ save to the appropriate file for the client:
157
+ Claude Code → .claude/skills/sbd-toe.md
158
+ GitHub Copilot → .github/copilot-instructions.md
159
+ Cursor → .cursorrules
160
+ ```
161
+
78
162
  ---
79
163
 
80
164
  ## Epistemic standards
@@ -132,16 +216,26 @@ Always distinguish between:
132
216
 
133
217
  ### By question type
134
218
 
135
- | Question | Tool |
219
+ | Question | Approach |
136
220
  |---|---|
137
221
  | "What is X?" / "How does Y work?" | `search_sbd_toe_manual` |
138
222
  | "What applies to my project?" | `map_sbd_toe_applicability` → `get_sbd_toe_chapter_brief` |
139
223
  | "What does chapter N cover?" | `get_sbd_toe_chapter_brief` |
140
224
  | "List all chapters" | `list_sbd_toe_chapters` |
141
225
  | "Find control / artefact / practice" | `query_sbd_toe_entities` |
142
- | "Generate a threat model / checklist / plan" | `generate_document` |
143
- | "Governance plan for this repo" | `plan_sbd_toe_repo_governance` |
226
+ | "What requirements apply at L1/L2/L3?" | `consult_security_requirements(risk_level)` |
227
+ | "Which controls are active for auth / logging / …?" | `consult_security_requirements(risk_level, concerns=[…])` |
228
+ | "What threats apply to this project?" | `get_threat_landscape(risk_level)` |
229
+ | "What threats are relevant for auth / logging / …?" | `get_threat_landscape(risk_level, concerns=[…])` |
230
+ | "What should a developer / architect / … do?" | `get_guide_by_role(risk_level, role=…)` |
231
+ | "What practices apply in design / implement / …?" | `get_guide_by_role(risk_level, phase=…)` |
232
+ | "What roles exist in the manual?" | `resolve_entities(record_type="role")` |
233
+ | "List all controls in domain X" | `resolve_entities(record_type="control", filters={domain: X})` |
234
+ | "Generate a threat model / checklist / plan" | `get_threat_landscape` + `get_guide_by_role` → then generate content |
235
+ | "What artefacts does the manual require?" | `plan_sbd_toe_repo_governance` |
236
+ | "Governance plan for this repo" | `plan_sbd_toe_repo_governance` → generate plan from returned artefact list |
144
237
  | "What to review given these changed files?" | `map_sbd_toe_review_scope` |
238
+ | "Set up SbD-ToE for this client / create a skill" | `generate_sbd_toe_skill` |
145
239
 
146
240
  ---
147
241
 
@@ -151,8 +245,8 @@ Always distinguish between:
151
245
  |---|---|
152
246
  | `sbd://toe/agent-guide` | This document — full operational guide |
153
247
  | `sbd://toe/index-compact` | Full chapter map as JSON — fast structured lookup |
154
- | `sbd://toe/skill-template/{riskLevel}/{projectRole}` | Role + risk specific instructions |
155
248
  | `sbd://toe/chapter-applicability/{riskLevel}` | Active/excluded chapters for a risk level |
249
+ | `sbd://toe/ontology` | Full ontology YAML — domain_mapping, concerns, inference rules |
156
250
 
157
251
  ---
158
252
 
@@ -165,18 +259,6 @@ Always distinguish between:
165
259
 
166
260
  ---
167
261
 
168
- ## `generate_document` types
169
-
170
- | type | Description |
171
- |---|---|
172
- | `classification-template` | Application risk classification document |
173
- | `threat-model-template` | Threat model with required sections per risk level |
174
- | `checklist` | Security checklist for the risk level |
175
- | `training-plan` | Security training plan |
176
- | `secure-config` | Secure configuration reference |
177
-
178
- ---
179
-
180
262
  ## Chapter reference
181
263
 
182
264
  | chapterId | Title | Min level | Domains |