@@ -145,6 +145,37 @@ Blast radius is nearly impossible to auto-detect. Note any hints:
145145
146146Flag that user confirmation is ** required** .
147147
148+ ### 2f. LLM Runtime Integration Detection
149+
150+ Grep for LLM SDK imports and agentic patterns using the patterns in the
151+ ` LLM Runtime Integration ` section of ` .claude/skills/shared/risk-model.md ` .
152+
153+ Report findings with evidence:
154+
155+ ```
156+ LLM Runtime scan for {module}:
157+ LLM SDK imports: 3 files
158+ src/chat/client.ts:1 — imports "openai"
159+ src/summarize.ts:2 — imports "@anthropic-ai/sdk"
160+ Generative patterns (L2+): 2 files
161+ src/chat/client.ts:14 — matches "messages.create"
162+ Tool use / agentic patterns (L3+): 0 matches
163+ Code-execution sandbox (L4): 0 matches
164+ → Auto-detected hint: L2 (Generative)
165+ ```
166+
167+ If ** no** LLM imports are found:
168+
169+ ```
170+ LLM Runtime scan for {module}:
171+ No LLM SDK imports found.
172+ → Auto-detected hint: L0 (No LLM)
173+ ```
174+
175+ Auto-detection produces only a ** hint** — the user must always confirm the
176+ level explicitly in Step 3. A library import alone is ambiguous (could be
177+ test code, data-science notebooks, build tooling, or production).
178+
148179---
149180
150181## Step 3 — Interactive Confirmation
@@ -203,18 +234,49 @@ Data Sensitivity: Auto-detected score 2 (General PII)
203234 [Keep 2] / [Upgrade to 3: Sensitive PII] / [Upgrade to 4: PHI/PCI]
204235```
205236
237+ ### 3d. LLM Runtime Integration Confirmation (ALWAYS ask)
238+
239+ Auto-detection produces only a hint — ** always** ask the user to confirm,
240+ even if L0 was detected (the user may know about planned future LLM use).
241+
242+ Present the hint with evidence, then ask:
243+
244+ ```
245+ LLM Runtime Integration for {module}:
246+ Auto-detected hint: L2 (Generative)
247+ Evidence: openai + @anthropic-ai/sdk imported, messages.create pattern found in src/chat/client.ts
248+
249+ How does this module use LLMs at runtime?
250+ [0] No LLM — classical software, no LLM at runtime
251+ [1] Classify — passive use: sentiment, intent, embeddings
252+ [2] Generate — generative output: chat, summaries
253+ [3] Tool Use — function calling, LLM triggers actions
254+ [4] Agentic — autonomous loops, code execution, self-modification
255+
256+ Suggested: [2]
257+ ```
258+
259+ Remind the user of the tier implications before they answer:
260+
261+ > ** Note:** L3 forces at least Tier 3, L4 forces at least Tier 4, regardless
262+ > of the code dimensions. A coding agent that could run ` rm -rf ` is
263+ > safety-critical by definition.
264+
206265---
207266
208267## Step 4 — Tier Calculation and Output
209268
210269### 4a. Calculate Tier
211270
212271```
213- Tier = max(codeType, language, deployment, data, blastRadius)
214- Mapping: max <= 1 → Tier 1, max <= 2 → Tier 2, max <= 3 → Tier 3, max = 4 → Tier 4
272+ base = max(codeType, language, deployment, data, blastRadius)
273+ baseTier = base <= 1 ? 1 : base <= 2 ? 2 : base <= 3 ? 3 : 4
274+ floor = llmRuntimeLevel >= 4 ? 4 : llmRuntimeLevel >= 3 ? 3 : 1
275+ tier = max(baseTier, floor)
215276```
216277
217- Present the result:
278+ Present the result. If the LLM Runtime modifier ** lifted** the tier
279+ above the base, make that explicit:
218280
219281```
220282{module} Risk Assessment:
@@ -223,10 +285,26 @@ Present the result:
223285 Deployment: 2 (Public-facing app)
224286 Data Sensitivity: 2 (General PII)
225287 Blast Radius: 1 (Performance / DoS)
288+ LLM Runtime: L0 (No LLM)
226289
227290 → Tier 3 — determined by Code Type = 3
228291```
229292
293+ Example with modifier lift:
294+
295+ ```
296+ {module} Risk Assessment:
297+ Code Type: 2 (Business Logic)
298+ Language: 2 (Dynamically typed)
299+ Deployment: 2 (Public-facing app)
300+ Data Sensitivity: 1 (Internal business data)
301+ Blast Radius: 2 (Data loss recoverable)
302+ LLM Runtime: L4 (Agentic)
303+
304+ Base Tier: 2 — Moderate
305+ → Tier 4 — lifted from Tier 2 by LLM Runtime L4 (Agentic)
306+ ```
307+
230308### 4b. Scan Existing Mitigations
231309
232310Before writing, scan for mitigation signals as listed in the shared risk model.
0 commit comments