@securityreviewai/securityreview-kit 0.1.17 → 0.1.19
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/package.json +1 -1
- package/src/generators/rules/content.js +7 -0
- package/src/generators/rules/content.md +23 -4
- package/src/generators/rules/ctm_sync.md +85 -16
- package/src/generators/rules/ctm_sync_rule.md +20 -14
- package/src/generators/rules/cursor.js +9 -0
- package/src/generators/rules/guardrails_rule.md +86 -0
- package/src/generators/rules/hooks.json +1 -1
- package/src/generators/rules/skill.md +109 -16
package/package.json
CHANGED
|
@@ -64,6 +64,13 @@ export function getThreatModellingSkillContent(options = {}) {
|
|
|
64
64
|
return readTemplate('skill.md', options);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Returns the vibe guardrails always-applied rule markdown.
|
|
69
|
+
*/
|
|
70
|
+
export function getGuardrailsRuleContent(options = {}) {
|
|
71
|
+
return readTemplate('guardrails_rule.md', options);
|
|
72
|
+
}
|
|
73
|
+
|
|
67
74
|
/**
|
|
68
75
|
* Returns the hooks.json content for Cursor session hooks.
|
|
69
76
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
### When NOT to apply
|
|
8
8
|
|
|
9
|
-
Skip PWNISMS and the MCP flow entirely for tasks that have **no security surface**:
|
|
9
|
+
Skip PWNISMS, guardrails, and the MCP flow entirely for tasks that have **no security surface**:
|
|
10
10
|
|
|
11
11
|
- Documentation-only changes (README, comments, changelogs)
|
|
12
12
|
- Code formatting, linting, or style fixes
|
|
@@ -18,6 +18,18 @@ Skip PWNISMS and the MCP flow entirely for tasks that have **no security surface
|
|
|
18
18
|
If in doubt, do a quick mental scan: *does this change touch auth, input handling, secrets, network, data storage, or dependencies?* If **no**, skip. If **yes** or **maybe**, apply.
|
|
19
19
|
|
|
20
20
|
**MANDATORY POST THREAT MODELLING** ALWAYS invoke `ctm_sync` immediately after threat modelling is generated or updated. This is required on every threat-model run.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Two pillars of security enforcement
|
|
25
|
+
|
|
26
|
+
This workflow enforces security through two complementary pillars:
|
|
27
|
+
|
|
28
|
+
1. **Secure by Design (PWNISMS)** — Universal threat-category analysis applied to every security-relevant task. Identifies risks and drives architectural/design-level mitigations.
|
|
29
|
+
2. **Secure by Code (Vibe Guardrails)** — Project-specific coding dos and don'ts fetched from SRAI via `get_guardrails`. Enforces concrete implementation rules derived from prior threat reviews, compliance requirements, and team decisions.
|
|
30
|
+
|
|
31
|
+
Both pillars are **mandatory** for any code-generation task with a security surface. PWNISMS catches broad threats; guardrails enforce project-specific coding standards.
|
|
32
|
+
|
|
21
33
|
---
|
|
22
34
|
|
|
23
35
|
## MCP Enhancement — `security-review-mcp`
|
|
@@ -66,7 +78,13 @@ Rather than fetching the entire profile at once, walk through each reasoning blo
|
|
|
66
78
|
- For each requirement relevant to the task, call `get_profile_compliance_requirement` for full details.
|
|
67
79
|
- Map these to security objectives and ensure your implementation meets them.
|
|
68
80
|
|
|
69
|
-
10. **
|
|
81
|
+
10. **Fetch Vibe Guardrails** — Call `get_guardrails` with `project_id`.
|
|
82
|
+
- Load all project-specific coding guardrails (dos and don'ts).
|
|
83
|
+
- Separate into `must` (mandatory requirements) and `must_not` (hard prohibitions).
|
|
84
|
+
- Keep these in context for the entire code-generation task.
|
|
85
|
+
- Cross-reference with PWNISMS findings: if a threat has no corresponding guardrail, flag it as a candidate for a new guardrail.
|
|
86
|
+
|
|
87
|
+
11. **Check for existing reviews** — Call `list_reviews`. If a completed review exists, pull context:
|
|
70
88
|
- `get_threat_scenarios` — Cross-reference with your PWNISMS findings
|
|
71
89
|
- `get_countermeasures` — Apply recommended mitigations
|
|
72
90
|
- `get_components` — Understand the system architecture
|
|
@@ -74,11 +92,11 @@ Rather than fetching the entire profile at once, walk through each reasoning blo
|
|
|
74
92
|
- `get_security_objectives` — Understand compliance requirements
|
|
75
93
|
- `get_findings` — Review aggregated security insights
|
|
76
94
|
|
|
77
|
-
|
|
95
|
+
12. **No review exists?** Create one:
|
|
78
96
|
- Upload context via `create_document_from_content`
|
|
79
97
|
- `create_review` → `start_workflow` → poll `get_workflow_status`
|
|
80
98
|
|
|
81
|
-
|
|
99
|
+
13. **After threat modeling (ALWAYS / POST threat modelling)** — Invoke `ctm_sync` agent and upload the required CTM data (including guardrail compliance and proposed guardrails).
|
|
82
100
|
|
|
83
101
|
### CTM sync — chat session and workflows (all IDEs)
|
|
84
102
|
|
|
@@ -94,6 +112,7 @@ When running `ctm_sync` (dedicated agent/command where available, or the same st
|
|
|
94
112
|
|---|---|
|
|
95
113
|
| **Projects** | `list_projects`, `find_project_by_name`, `create_project`, `get_project` |
|
|
96
114
|
| **Profile Exploration** | `get_project_profile_description`, `list_profile_technology_categories`, `get_project_profile_technology_category`, `list_project_profile_architecture_notes`, `list_project_profile_user_groups`, `list_project_profile_language_stacks`, `list_project_profile_security_controls`, `get_project_profile_security_control`, `list_profile_compliance_requirements`, `get_profile_compliance_requirement` |
|
|
115
|
+
| **Guardrails** | `get_guardrails` |
|
|
97
116
|
| **Documents** | `list_documents`, `create_document_from_content`, `upload_document`, `link_external_document` |
|
|
98
117
|
| **Reviews** | `create_review`, `list_reviews`, `get_review`, `get_review_overview` |
|
|
99
118
|
| **Workflow** | `start_workflow`, `get_workflow_status`, `start_next_workflow_job`, `start_workflow_job`, `retry_workflow_job` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ctm_sync
|
|
3
|
-
description: Command/workflow triggered whenever a threat model is generated or updated. Builds and uploads CTM sync details through security-review-mcp.
|
|
3
|
+
description: Command/workflow triggered whenever a threat model is generated or updated, or guardrails are proposed/modified. Builds and uploads CTM sync details and guardrail updates through security-review-mcp.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# CTM Sync Workflow
|
|
@@ -21,21 +21,13 @@ When invoked:
|
|
|
21
21
|
- **If none exists:** call `create_ai_ide_workflow` with:
|
|
22
22
|
- `project_id`
|
|
23
23
|
- `name`: a short, meaningful heading derived from the **high-level feature or topic** being worked on in this session (e.g. `"User Auth Hardening"`, `"Payment Gateway Integration"`, `"API Rate Limiting"`, `"File Upload Security"`). Use 2–5 words, title-case. Do **not** use sequential labels like `session1/session2`. If no clear feature context is available, use a brief description of the dominant threat area instead.
|
|
24
|
-
- `description`: must include `chat_session_id:<chat_session_id>` so future syncs can attach to this workflow. Add a brief human-readable note if helpful.
|
|
24
|
+
- `description`: must include `chat_session_id:<chat_session_id>` so future syncs can attach to this workflow. Add a brief human-readable note if helpful. Do not add the word ctm anywhere.
|
|
25
25
|
- Store the returned `workflow_id` for the upload step.
|
|
26
|
-
4.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- `
|
|
30
|
-
|
|
31
|
-
- `developer_name` = fetch from git config unless explicitly specified by user
|
|
32
|
-
- `developer_email` = fetch from git config unless explicitly specified by user
|
|
33
|
-
- `threats_mitigated`
|
|
34
|
-
- `best_practises_achieved`
|
|
35
|
-
- `secure_code_snippets`
|
|
36
|
-
5. Upload the payload using `security-review-mcp`:
|
|
37
|
-
- Use the tool `create_ai_ide_event`
|
|
38
|
-
6. **Push a project profile update** — After the event is created, derive project profile data from the current threat model context and call `update_vibe_project_profile` with `project_id` and the following fields:
|
|
26
|
+
4. **Fetch current guardrails** — Call `get_guardrails` with `project_id` to retrieve the project's current vibe guardrails. These inform the `guardrails_applied` field in the event payload.
|
|
27
|
+
5. **Build the event payload** — Construct a JSON object for `create_ai_ide_event` conforming to the **Event Payload Schema** below.
|
|
28
|
+
6. **Upload the payload** using `security-review-mcp`:
|
|
29
|
+
- Call `create_ai_ide_event` with the JSON payload.
|
|
30
|
+
7. **Push a project profile update** — After the event is created, derive project profile data from the current threat model context and call `update_vibe_project_profile` with `project_id` and the following fields:
|
|
39
31
|
- `description`: a concise summary of the system/project derived from the threat model context (what it does, what data it handles, its overall purpose)
|
|
40
32
|
- `architecture_notes`: a list of architecture observations extracted from the threat model — deployment topology, trust boundaries, data flows, integration points
|
|
41
33
|
- `tech_categories`: a list of technology category labels identified during threat modeling (e.g. `"backend"`, `"frontend"`, `"database"`, `"cloud"`, `"mobile"`)
|
|
@@ -44,10 +36,87 @@ When invoked:
|
|
|
44
36
|
- `language_stacks`: a list of programming languages, runtimes, and major frameworks identified in the codebase or threat model context (e.g. `"Python/FastAPI"`, `"TypeScript/React"`, `"Java/Spring"`)
|
|
45
37
|
- Omit any field for which no data is available in context — do **not** invent values. Pass an empty list `[]` only if the field is reasonably expected but simply unpopulated.
|
|
46
38
|
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Event Payload Schema
|
|
42
|
+
|
|
43
|
+
The `create_ai_ide_event` payload MUST be a JSON object with the following structure. Use this exact schema — do not add, rename, or omit required keys.
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"workflow_id": "<string — resolved or newly created AI IDE workflow id>",
|
|
48
|
+
"chat_session_id": "<string — stable session identifier, same for all events in this chat>",
|
|
49
|
+
"title": "<string — concise title describing what was threat-modeled or implemented, 5-15 words>",
|
|
50
|
+
"summary": "<string — 2-5 sentence summary of the threat model findings, key risks identified, mitigations applied, and any guardrails enforced>",
|
|
51
|
+
"developer_name": "<string — from API/user context provided by MCP or host runtime>",
|
|
52
|
+
"developer_email": "<string — from API/user context provided by MCP or host runtime>",
|
|
53
|
+
"threats_mitigated": [
|
|
54
|
+
{
|
|
55
|
+
"threat_name": "<string — short threat title>",
|
|
56
|
+
"pwnisms_category": "<string — one of: Product, Workload, Network, IAM, Secrets, Monitoring, Supply Chain>",
|
|
57
|
+
"severity": "<string — Critical | High | Medium | Low>",
|
|
58
|
+
"mitigation_applied": "<string — what was done to address the threat>"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"best_practises_achieved": [
|
|
62
|
+
"<string — each entry is a concise statement of a security best practice that was followed during implementation>"
|
|
63
|
+
],
|
|
64
|
+
"secure_code_snippets": [
|
|
65
|
+
{
|
|
66
|
+
"file_path": "<string — relative path to the file>",
|
|
67
|
+
"language": "<string — programming language>",
|
|
68
|
+
"snippet": "<string — the security-relevant code snippet, max 50 lines>",
|
|
69
|
+
"explanation": "<string — why this snippet is security-relevant and what it protects against>"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"guardrails_applied": [
|
|
73
|
+
{
|
|
74
|
+
"title": "<string — guardrail title>",
|
|
75
|
+
"rule_type": "<string — must | must_not>",
|
|
76
|
+
"category": "<string | null — grouping label>",
|
|
77
|
+
"instruction": "<string — the actionable coding directive>",
|
|
78
|
+
"source": "<string — 'existing' if fetched from get_guardrails, 'ide_generated' if newly created by the IDE agent>",
|
|
79
|
+
"satisfied": "<boolean — true if the guardrail was fully satisfied, false if partially or not satisfied>",
|
|
80
|
+
"notes": "<string — optional: how it was applied, why it could not be fully satisfied, or rationale for a new guardrail>"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Field rules
|
|
87
|
+
|
|
88
|
+
| Field | Required | Notes |
|
|
89
|
+
|---|---|---|
|
|
90
|
+
| `workflow_id` | Yes | From step 3 |
|
|
91
|
+
| `chat_session_id` | Yes | From step 2 |
|
|
92
|
+
| `title` | Yes | 5-15 words, descriptive |
|
|
93
|
+
| `summary` | Yes | 2-5 sentences |
|
|
94
|
+
| `developer_name` | Yes | From API/user context (never read from git config) |
|
|
95
|
+
| `developer_email` | Yes | From API/user context (never read from git config) |
|
|
96
|
+
| `threats_mitigated` | Yes | Array, may be empty `[]` if no threats were identified |
|
|
97
|
+
| `best_practises_achieved` | Yes | Array of strings, may be empty `[]` |
|
|
98
|
+
| `secure_code_snippets` | Yes | Array, may be empty `[]` |
|
|
99
|
+
| `guardrails_applied` | Yes | Array of all guardrails enforced during this session — both existing ones from `get_guardrails` and new ones the IDE agent created. Use `source` to distinguish origin. Empty `[]` if none |
|
|
100
|
+
|
|
101
|
+
### Constraints
|
|
102
|
+
|
|
103
|
+
- Every `threats_mitigated` entry must map to one of the 7 PWNISMS categories.
|
|
104
|
+
- `secure_code_snippets` must not exceed 50 lines per snippet; truncate with a comment if needed.
|
|
105
|
+
- `guardrails_applied` entries with `source: "existing"` should reference guardrails fetched in step 4 by their exact `title`.
|
|
106
|
+
- `guardrails_applied` entries with `source: "ide_generated"` are new guardrails the IDE agent created based on gaps found during threat modeling or code review.
|
|
107
|
+
- `developer_name` and `developer_email` must come from API/runtime user context only; do not derive them from git config.
|
|
108
|
+
- Never invent values for any field; use empty strings or empty arrays when data is unavailable.
|
|
109
|
+
- Never omit `chat_session_id` from the payload.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
47
113
|
## Output Contract
|
|
48
114
|
|
|
49
115
|
- Never skip upload when a threat model exists.
|
|
50
116
|
- Never invent missing values; use empty strings/arrays if data is unavailable.
|
|
51
117
|
- Never omit `chat_session_id` from the payload.
|
|
52
118
|
- Never skip the `update_vibe_project_profile` call when profile-relevant data (architecture, tech, users, compliance, languages, or description) can be derived from context.
|
|
53
|
-
- Return a compact confirmation after upload
|
|
119
|
+
- Return a compact confirmation after upload including:
|
|
120
|
+
- Whether an existing workflow was reused or a new named workflow was created
|
|
121
|
+
- Confirmation that the project profile was updated
|
|
122
|
+
- Count of guardrails applied (existing vs IDE-generated)
|
|
@@ -4,19 +4,20 @@ alwaysApply: true
|
|
|
4
4
|
---
|
|
5
5
|
# Continuous Threat Modeling Sync (`ctm_sync`)
|
|
6
6
|
|
|
7
|
-
**Always synchronize threat models after they are (re)generated.**
|
|
7
|
+
**Always synchronize threat models and guardrail compliance after they are (re)generated.**
|
|
8
8
|
|
|
9
9
|
Any time an AI agent:
|
|
10
10
|
- generates a **new threat model**, or
|
|
11
11
|
- **updates** an existing threat model, or
|
|
12
|
-
- performs a **non-trivial extension** of an existing threat model (e.g., adds new threat scenarios, countermeasures, data flows, or components),
|
|
12
|
+
- performs a **non-trivial extension** of an existing threat model (e.g., adds new threat scenarios, countermeasures, data flows, or components), or
|
|
13
|
+
- **applies vibe guardrails** during a code-generation task (existing or IDE-generated) and has guardrail compliance data to report,
|
|
13
14
|
|
|
14
|
-
it **must immediately call** the `ctm_sync` agent to synchronize the latest threat modeling state.
|
|
15
|
+
it **must immediately call** the `ctm_sync` agent to synchronize the latest threat modeling state and guardrail data.
|
|
15
16
|
|
|
16
17
|
This rule applies regardless of:
|
|
17
18
|
- which methodology is used (PWNISMS, STRIDE, OWASP, etc.),
|
|
18
19
|
- which skill or MCP was used to produce the threat model, and
|
|
19
|
-
- whether the threat model is partial, incremental, or
|
|
20
|
+
- whether the threat model is partial, incremental, or "draft" form.
|
|
20
21
|
|
|
21
22
|
If in doubt — **assume this rule applies**.
|
|
22
23
|
|
|
@@ -33,9 +34,13 @@ This rule is **triggered** whenever the assistant:
|
|
|
33
34
|
- Attack trees or abuse cases
|
|
34
35
|
- Structured PWNISMS analysis
|
|
35
36
|
- **Extends or refines** an earlier threat model, e.g.:
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
37
|
+
- "Add more threats for the Payments service"
|
|
38
|
+
- "Update the data flow for the auth system"
|
|
39
|
+
- "Refine the mitigations for threat X"
|
|
40
|
+
- **Enforces guardrails** during code generation and has compliance data:
|
|
41
|
+
- Guardrails were fetched via `get_guardrails` and applied to generated code
|
|
42
|
+
- New guardrails were created by the IDE agent based on gaps found
|
|
43
|
+
- Existing guardrails were flagged as unsatisfiable or conflicting
|
|
39
44
|
|
|
40
45
|
This includes both:
|
|
41
46
|
- Threat modeling done **directly in this conversation**, and
|
|
@@ -45,7 +50,7 @@ This includes both:
|
|
|
45
50
|
|
|
46
51
|
## Required behavior
|
|
47
52
|
|
|
48
|
-
**After completing any threat modeling step that produces or modifies threat content, the assistant must:**
|
|
53
|
+
**After completing any threat modeling step that produces or modifies threat content, or any code-generation step where guardrails were enforced, the assistant must:**
|
|
49
54
|
|
|
50
55
|
1. **Ensure threat modeling output is finalized for this step**
|
|
51
56
|
|
|
@@ -55,26 +60,27 @@ This includes both:
|
|
|
55
60
|
2. **Immediately call the `ctm_sync` agent**
|
|
56
61
|
|
|
57
62
|
- Use the `Task` tool (or equivalent agent launcher) with `subagent_type="ctm_sync"`.
|
|
58
|
-
- **Session routing:** In the prompt (or structured handoff), always include the **current chat
|
|
63
|
+
- **Session routing:** In the prompt (or structured handoff), always include the **current chat's stable `chat_session_id`** — the same id for every `ctm_sync` in this conversation, and a new id for a different chat. Use the IDE/session id when exposed; otherwise generate one UUID at the start of the chat and reuse it. This ensures SRAI attaches events to the correct per-session workflow.
|
|
59
64
|
- Provide a clear, concise description in the `description`/`prompt` fields explaining:
|
|
60
65
|
- What system or component the threat model covers
|
|
61
66
|
- Whether this is a new threat model or an update
|
|
62
|
-
- Where the latest threat content can be found (e.g.,
|
|
67
|
+
- Where the latest threat content can be found (e.g., "from this conversation" or "from the last threat modeling step")
|
|
63
68
|
- The `chat_session_id` value to use for this sync
|
|
69
|
+
- Whether guardrails were applied (existing and/or IDE-generated)
|
|
64
70
|
|
|
65
71
|
**Example invocation (conceptual, not literal code):**
|
|
66
72
|
|
|
67
73
|
Use Task tool with:
|
|
68
74
|
- subagent_type: "ctm_sync"
|
|
69
75
|
- description: "Sync latest threat model for <system/component>"
|
|
70
|
-
- prompt: Brief summary of what was threat-modeled, what artifacts were produced (threat scenarios, countermeasures, components, data dictionary, etc.), and that the agent should upload/update CTM data accordingly.
|
|
76
|
+
- prompt: Brief summary of what was threat-modeled, what artifacts were produced (threat scenarios, countermeasures, components, data dictionary, guardrails applied/proposed, etc.), and that the agent should upload/update CTM data accordingly.
|
|
71
77
|
- readonly: false (it must be allowed to write/update CTM data)
|
|
72
78
|
|
|
73
79
|
3. Let `ctm_sync` complete its work
|
|
74
|
-
|
|
75
|
-
|
|
80
|
+
The assistant should wait for the ctm_sync agent to complete (or reach a healthy steady state) before declaring the threat-modeling step fully done.
|
|
81
|
+
If ctm_sync returns errors that can be reasonably fixed (e.g., missing project name), the assistant should fix the issue and retry once, if possible.
|
|
76
82
|
|
|
77
83
|
Acknowledge completion to the user
|
|
78
84
|
After ctm_sync completes, the assistant should briefly tell the user that:
|
|
79
85
|
Threat modeling is finished for this step, and
|
|
80
|
-
The results have been synchronized via ctm_sync (without leaking internal tooling details beyond what is appropriate for the user
|
|
86
|
+
The results have been synchronized via ctm_sync (without leaking internal tooling details beyond what is appropriate for the user's context).
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
getCtmSyncTriggerRuleContent,
|
|
9
9
|
getCreateIdeWorkflowCommandContent,
|
|
10
10
|
getThreatModellingSkillContent,
|
|
11
|
+
getGuardrailsRuleContent,
|
|
11
12
|
getHooksContent,
|
|
12
13
|
} from './content.js';
|
|
13
14
|
|
|
@@ -38,6 +39,7 @@ function writeCursorCommand(filePath, content) {
|
|
|
38
39
|
export function generate(cwd, options = {}) {
|
|
39
40
|
const baseRulePath = join(cwd, '.cursor', 'rules', 'srai-security-review.mdc');
|
|
40
41
|
const ctmSyncTriggerRulePath = join(cwd, '.cursor', 'rules', 'ctm_sync_rule.mdc');
|
|
42
|
+
const guardrailsRulePath = join(cwd, '.cursor', 'rules', 'guardrails_rule.mdc');
|
|
41
43
|
const ctmSyncWorkflowPath = join(cwd, '.cursor', 'commands', 'ctm_sync.md');
|
|
42
44
|
const ctmSyncAgentPath = join(cwd, '.cursor', 'agents', 'ctm_sync.md');
|
|
43
45
|
const createIdeWorkflowCommandPath = join(cwd, '.cursor', 'commands', 'create-ide-workflow.md');
|
|
@@ -47,6 +49,7 @@ export function generate(cwd, options = {}) {
|
|
|
47
49
|
|
|
48
50
|
const baseRuleContent = getRuleContent(options);
|
|
49
51
|
const ctmSyncTriggerRuleContent = getCtmSyncTriggerRuleContent(options);
|
|
52
|
+
const guardrailsRuleContent = getGuardrailsRuleContent(options);
|
|
50
53
|
const ctmSyncWorkflowContent = getCtmSyncWorkflowContent(options);
|
|
51
54
|
const createIdeWorkflowCommandContent = getCreateIdeWorkflowCommandContent(options);
|
|
52
55
|
const profileCommandContent = getProfileCommandContent(options);
|
|
@@ -59,6 +62,11 @@ export function generate(cwd, options = {}) {
|
|
|
59
62
|
);
|
|
60
63
|
|
|
61
64
|
const ctmSyncTriggerRule = writeCursorCommand(ctmSyncTriggerRulePath, ctmSyncTriggerRuleContent);
|
|
65
|
+
const guardrailsRule = writeCursorRule(
|
|
66
|
+
guardrailsRulePath,
|
|
67
|
+
'Vibe Guardrails — fetch and enforce project-specific secure coding guardrails from SRAI',
|
|
68
|
+
guardrailsRuleContent,
|
|
69
|
+
);
|
|
62
70
|
const ctmSyncWorkflow = writeCursorCommand(ctmSyncWorkflowPath, ctmSyncWorkflowContent);
|
|
63
71
|
const ctmSyncAgent = writeCursorCommand(ctmSyncAgentPath, ctmSyncWorkflowContent);
|
|
64
72
|
const createIdeWorkflowCommand = writeCursorCommand(createIdeWorkflowCommandPath, createIdeWorkflowCommandContent);
|
|
@@ -74,6 +82,7 @@ export function generate(cwd, options = {}) {
|
|
|
74
82
|
return [
|
|
75
83
|
{ ...baseRule, kind: 'rule' },
|
|
76
84
|
{ ...ctmSyncTriggerRule, kind: 'rule' },
|
|
85
|
+
{ ...guardrailsRule, kind: 'rule' },
|
|
77
86
|
{ ...ctmSyncWorkflow, kind: 'command' },
|
|
78
87
|
{ ...ctmSyncAgent, kind: 'agent' },
|
|
79
88
|
{ ...createIdeWorkflowCommand, kind: 'command' },
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Vibe Guardrails — fetch and enforce project-specific secure coding guardrails from SRAI
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Vibe Guardrails — Secure by Code
|
|
7
|
+
|
|
8
|
+
**Enforce project-specific security guardrails during every code-generation task.**
|
|
9
|
+
|
|
10
|
+
This rule complements the PWNISMS threat model ("secure by design") with concrete, project-level coding dos and don'ts ("secure by code"). Guardrails are maintained in SRAI and fetched via the `security-review-mcp` MCP tool `get_guardrails`.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## When this rule applies
|
|
15
|
+
|
|
16
|
+
This rule is **active for every code-generation or code-modification task** — including:
|
|
17
|
+
|
|
18
|
+
- Implementing new features or endpoints
|
|
19
|
+
- Fixing bugs that touch security-relevant code
|
|
20
|
+
- Refactoring code that handles auth, input, secrets, data storage, or network
|
|
21
|
+
- Generating boilerplate, scaffolding, or templates that will run in production
|
|
22
|
+
|
|
23
|
+
### When to skip
|
|
24
|
+
|
|
25
|
+
Skip guardrail enforcement for tasks with **no code output** (documentation, Q&A, formatting, renaming).
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Required behavior
|
|
30
|
+
|
|
31
|
+
### 1. Fetch guardrails at the start of every code task
|
|
32
|
+
|
|
33
|
+
Before writing or modifying code, call `get_guardrails` from `security-review-mcp`:
|
|
34
|
+
|
|
35
|
+
- **Resolve the project** — Use `find_project_by_name` with `name="<SRAI_PROJECT_NAME>"` to obtain `project_id`.
|
|
36
|
+
- **Fetch guardrails** — Call `get_guardrails` with `project_id`.
|
|
37
|
+
- Each guardrail returned has:
|
|
38
|
+
|
|
39
|
+
| Field | Description |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `title` | Short name of the guardrail |
|
|
42
|
+
| `rule_type` | `must` (mandatory) or `must_not` (prohibition) |
|
|
43
|
+
| `category` | Grouping label (e.g. `authentication`, `input_validation`, `secrets`) or `null` |
|
|
44
|
+
| `instruction` | The actionable coding directive |
|
|
45
|
+
| `source_ref` | List of reference links (threat scenarios, compliance docs, etc.) |
|
|
46
|
+
|
|
47
|
+
### 2. Apply guardrails during code generation
|
|
48
|
+
|
|
49
|
+
- **`must` rules (DOs):** Treat as mandatory implementation requirements. Every line of generated code must satisfy all applicable `must` guardrails.
|
|
50
|
+
- **`must_not` rules (DON'Ts):** Treat as hard prohibitions. Generated code must never violate a `must_not` guardrail.
|
|
51
|
+
- If a guardrail conflicts with the user's explicit instruction, **flag the conflict** to the user and ask for confirmation before proceeding.
|
|
52
|
+
- If no guardrails are returned (empty list), proceed normally using baseline PWNISMS controls.
|
|
53
|
+
|
|
54
|
+
### 3. Cross-reference with PWNISMS
|
|
55
|
+
|
|
56
|
+
Guardrails and PWNISMS are complementary:
|
|
57
|
+
|
|
58
|
+
- Guardrails provide **project-specific, concrete rules** derived from prior threat reviews, compliance requirements, and team decisions.
|
|
59
|
+
- PWNISMS provides **universal threat-category coverage** to catch gaps that guardrails may not yet cover.
|
|
60
|
+
- When PWNISMS analysis reveals a gap not covered by any existing guardrail, **create a new guardrail on the fly** and apply it immediately (marked `source: "ide_generated"` in CTM sync).
|
|
61
|
+
|
|
62
|
+
### 4. Report guardrail compliance
|
|
63
|
+
|
|
64
|
+
After code generation, include a brief guardrails compliance summary:
|
|
65
|
+
|
|
66
|
+
- List which guardrails were applied (by title), distinguishing existing vs IDE-generated.
|
|
67
|
+
- Flag any guardrails that could not be fully satisfied and explain why.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Guardrail lifecycle — updates and new guardrails
|
|
72
|
+
|
|
73
|
+
Guardrails are living artifacts. The IDE agent can create, apply, and update them:
|
|
74
|
+
|
|
75
|
+
- **New guardrail**: When threat modeling or code review reveals a recurring security pattern not yet captured, the IDE agent creates and applies a new guardrail on the fly. These are reported to SRAI via CTM sync with `source: "ide_generated"`.
|
|
76
|
+
- **Edit suggestion**: When an existing guardrail is too broad, too narrow, or outdated, suggest an update to the user.
|
|
77
|
+
- All guardrails — existing and IDE-generated — flow into the single `guardrails_applied` array in the CTM sync payload.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Tool Reference
|
|
82
|
+
|
|
83
|
+
| Tool | Purpose |
|
|
84
|
+
|---|---|
|
|
85
|
+
| `get_guardrails` | Fetch project guardrails (requires `project_id`) |
|
|
86
|
+
| `find_project_by_name` | Resolve project by name to get `project_id` |
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"hooks": {
|
|
4
4
|
"sessionStart": [
|
|
5
5
|
{
|
|
6
|
-
"command": "printf '%s\\n' '{\"additional_context\":\"## MANDATORY SECURITY GATE (Session Policy)\\n\\nFor ANY user request that has security impact (auth, crypto, input handling, secrets, network, data storage, dependencies, new APIs/endpoints, or any code handling untrusted data):\\n\\n**Plan order:**\\n1. **PWNISMS threat modeling (
|
|
6
|
+
"command": "printf '%s\\n' '{\"additional_context\":\"## MANDATORY SECURITY GATE (Session Policy)\\n\\nFor ANY user request that has security impact (auth, crypto, input handling, secrets, network, data storage, dependencies, new APIs/endpoints, or any code handling untrusted data):\\n\\n**Plan order:**\\n1. **Fetch Vibe Guardrails (first)** - Call get_guardrails from security-review-mcp to load project-specific coding dos and don\\u0027ts. These are hard constraints on all generated code. Separate into must (mandatory) and must_not (prohibited) rules.\\n2. **PWNISMS threat modeling (second)** - Run threat modeling as a guide before writing code. Use .cursor/skills/threat-modelling/SKILL.md. Cross-reference guardrails with PWNISMS findings to identify gaps. Document findings to inform secure implementation.\\n3. **Implement secure code (third)** - Use the threat model findings AND guardrails as guides to create secure code. Every must guardrail must be satisfied; no must_not guardrail may be violated.\\n4. **ctm_sync (last)** - Push payload to SRAI only after implementation is done. Invoke ctm_sync agent (Task tool, subagent_type=ctm_sync) as the final step. Include all guardrails (existing + IDE-generated) in the guardrails_applied payload field. See .cursor/agents/ctm_sync.md and .cursor/rules/ctm_sync_rule.mdc.\\n\\nNo blocking. No deferral. Guardrails enforce secure code; threat modeling guides the design; ctm_sync runs last to push to SRAI. Both ctm_sync and guardrail compliance are mandatory and should be part of your to-do.\"}'",
|
|
7
7
|
"timeout": 5
|
|
8
8
|
}
|
|
9
9
|
]
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: PWNISMS Threat Modelling
|
|
3
|
-
description:
|
|
3
|
+
description: Security-first threat modelling workflow for code and architecture tasks. Walks all 7 PWNISMS categories, integrates with SRAI project profiles, enforces vibe guardrails (secure by code), and synchronizes findings via CTM sync. Use before, during, and after implementation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# PWNISMS —
|
|
6
|
+
# PWNISMS — Security-First Threat Modelling
|
|
7
7
|
|
|
8
|
-
For EVERY security-relevant task (feature, bug fix, refactor, infra change, architecture design), run a
|
|
8
|
+
For EVERY security-relevant task (feature, bug fix, refactor, infra change, architecture design), run a threat model with PWNISMS.
|
|
9
9
|
|
|
10
10
|
- Walk through all 7 categories explicitly.
|
|
11
11
|
- If a category is not applicable, state it briefly and move on.
|
|
@@ -14,7 +14,32 @@ For EVERY security-relevant task (feature, bug fix, refactor, infra change, arch
|
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Phase 0 — Enrich Context from SRAI
|
|
18
|
+
|
|
19
|
+
Before deep analysis, pull project context from `security-review-mcp` (if available) to ground your threat model in the actual system profile.
|
|
20
|
+
|
|
21
|
+
1. **Resolve the project** — `find_project_by_name` with `name="<SRAI_PROJECT_NAME>"`.
|
|
22
|
+
2. **Fetch project description** — `get_project_profile_description` to understand the system's purpose and data flows.
|
|
23
|
+
3. **Technology categories** — `list_profile_technology_categories` → for each, `get_project_profile_technology_category` to understand specific frameworks, libraries, versions.
|
|
24
|
+
4. **Architecture notes** — `list_project_profile_architecture_notes` for deployment topology, trust boundaries, data flow patterns.
|
|
25
|
+
5. **User groups** — `list_project_profile_user_groups` to map roles and privilege levels.
|
|
26
|
+
6. **Language stacks** — `list_project_profile_language_stacks` for language-specific vulnerability patterns.
|
|
27
|
+
7. **Security controls** — `list_project_profile_security_controls` → for relevant controls, `get_project_profile_security_control` for details.
|
|
28
|
+
8. **Compliance requirements** — `list_profile_compliance_requirements` → for relevant ones, `get_profile_compliance_requirement`.
|
|
29
|
+
9. **Existing reviews** — `list_reviews`. If a completed review exists:
|
|
30
|
+
- `get_threat_scenarios` — prior threats to cross-reference
|
|
31
|
+
- `get_countermeasures` — existing mitigations to leverage
|
|
32
|
+
- `get_components` — system architecture context
|
|
33
|
+
- `get_data_dictionaries` — sensitive data assets
|
|
34
|
+
- `get_security_objectives` — compliance targets
|
|
35
|
+
- `get_findings` — aggregated insights
|
|
36
|
+
10. **Vibe Guardrails** — `get_guardrails` with `project_id` to load project-specific coding dos and don'ts.
|
|
37
|
+
|
|
38
|
+
If SRAI is not available, proceed with whatever context the user provides — files, diffs, PRs, architecture docs.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Phase 1 — Inputs to Gather
|
|
18
43
|
|
|
19
44
|
Collect these quickly before deep analysis:
|
|
20
45
|
|
|
@@ -22,29 +47,41 @@ Collect these quickly before deep analysis:
|
|
|
22
47
|
- **Assets**: What must be protected (PII, credentials, tokens, configs, accounts, workflows)?
|
|
23
48
|
- **Entry points**: How data enters/leaves (HTTP, queues, schedulers, CLI, webhooks, integrations)?
|
|
24
49
|
- **Trust boundaries**: Where data crosses users/services/networks/privilege levels?
|
|
50
|
+
- **Existing guardrails**: What project-specific dos and don'ts apply (from Phase 0, step 10)?
|
|
25
51
|
|
|
26
52
|
If the user provided specific code, diffs, or architecture artifacts, prioritize those as primary evidence.
|
|
27
53
|
|
|
28
54
|
---
|
|
29
55
|
|
|
30
|
-
## Lightweight Workflow (PWNISMS)
|
|
56
|
+
## Phase 2 — Lightweight Workflow (PWNISMS)
|
|
31
57
|
|
|
32
58
|
1. **Clarify scope and assumptions**
|
|
33
59
|
- Define the exact unit of analysis.
|
|
34
60
|
- State assumptions explicitly (auth model, deployment boundary, tenant model, etc.).
|
|
61
|
+
|
|
35
62
|
2. **Map assets and flows**
|
|
36
63
|
- List high-value assets and critical data paths.
|
|
37
64
|
- List entry points and exits across trust boundaries.
|
|
65
|
+
- Note which assets are covered by existing guardrails and which are not.
|
|
66
|
+
|
|
38
67
|
3. **Walk all 7 PWNISMS categories**
|
|
39
68
|
- Identify plausible threats for each category.
|
|
40
69
|
- Keep findings concrete and contextual.
|
|
70
|
+
- For each threat, check if an existing guardrail already addresses it.
|
|
71
|
+
|
|
41
72
|
4. **Prioritize**
|
|
42
73
|
- Select the top 3-7 risks by impact and likelihood.
|
|
74
|
+
- Factor in existing mitigations from SRAI countermeasures and guardrails.
|
|
75
|
+
|
|
43
76
|
5. **Mitigate**
|
|
44
77
|
- Propose concrete, implementable controls for each prioritized risk.
|
|
78
|
+
- Map mitigations to specific guardrails where applicable.
|
|
79
|
+
- If a mitigation represents a recurring pattern, propose it as a new guardrail candidate.
|
|
80
|
+
|
|
45
81
|
6. **Summarize residual risk**
|
|
46
82
|
- Call out remaining risk, trade-offs, and follow-up actions.
|
|
47
83
|
- Call out unknowns instead of silently guessing.
|
|
84
|
+
- Note guardrail gaps — security patterns not yet captured by any guardrail.
|
|
48
85
|
|
|
49
86
|
---
|
|
50
87
|
|
|
@@ -58,6 +95,7 @@ Application and business-logic threats:
|
|
|
58
95
|
- Authorization gaps, privilege escalation, IDOR/BOLA.
|
|
59
96
|
- Business logic abuse, replay/race conditions, unsafe redirects.
|
|
60
97
|
- Error handling that leaks internals.
|
|
98
|
+
- **Guardrail check:** Are there `must` / `must_not` rules for input validation, authorization patterns, error handling?
|
|
61
99
|
|
|
62
100
|
### W — Workload
|
|
63
101
|
|
|
@@ -67,6 +105,7 @@ Compute and infrastructure threats:
|
|
|
67
105
|
- Weak host/orchestrator controls and segmentation.
|
|
68
106
|
- Insecure data storage/backups and DB configuration.
|
|
69
107
|
- Queue/broker abuse and poison-message handling gaps.
|
|
108
|
+
- **Guardrail check:** Are there rules for container security, data-at-rest encryption, workload identity?
|
|
70
109
|
|
|
71
110
|
### N — Network
|
|
72
111
|
|
|
@@ -76,6 +115,7 @@ Network and transport threats:
|
|
|
76
115
|
- Exposed ports/endpoints and permissive ingress/egress.
|
|
77
116
|
- Weak segmentation or lateral movement paths.
|
|
78
117
|
- API-layer abuse controls missing (rate limits, request limits, CORS hardening).
|
|
118
|
+
- **Guardrail check:** Are there rules for TLS enforcement, CORS policy, rate limiting?
|
|
79
119
|
|
|
80
120
|
### I — IAM (Identity & Access Management)
|
|
81
121
|
|
|
@@ -85,6 +125,7 @@ Identity and authorization threats:
|
|
|
85
125
|
- Missing least-privilege RBAC/ABAC.
|
|
86
126
|
- Service-to-service auth gaps.
|
|
87
127
|
- Escalation paths across users, roles, or services.
|
|
128
|
+
- **Guardrail check:** Are there rules for auth mechanisms, session management, privilege boundaries?
|
|
88
129
|
|
|
89
130
|
### S — Secrets
|
|
90
131
|
|
|
@@ -94,6 +135,7 @@ Credential and key management threats:
|
|
|
94
135
|
- Weak rotation, revocation, or token lifetime policies.
|
|
95
136
|
- Over-shared secrets across components.
|
|
96
137
|
- Missing secret manager/KMS controls.
|
|
138
|
+
- **Guardrail check:** Are there `must_not` rules against hardcoded secrets, `must` rules for secret manager usage?
|
|
97
139
|
|
|
98
140
|
### M — Monitoring (Logging & Observability)
|
|
99
141
|
|
|
@@ -103,6 +145,7 @@ Detection and auditability threats:
|
|
|
103
145
|
- Sensitive data leakage in logs.
|
|
104
146
|
- Missing alerts for abuse indicators.
|
|
105
147
|
- Incomplete audit trails or weak log integrity.
|
|
148
|
+
- **Guardrail check:** Are there rules for what must be logged and what must not appear in logs?
|
|
106
149
|
|
|
107
150
|
### S — Supply Chain
|
|
108
151
|
|
|
@@ -113,6 +156,37 @@ Dependency and delivery threats:
|
|
|
113
156
|
- CI/CD pipeline leakage or unreviewed build scripts.
|
|
114
157
|
- Unsigned/unprovenanced artifacts, missing SBOM.
|
|
115
158
|
- Treat AI-generated code as untrusted until validated.
|
|
159
|
+
- **Guardrail check:** Are there rules for dependency pinning, SBOM generation, artifact signing?
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Phase 3 — Guardrail Enforcement (Secure by Code)
|
|
164
|
+
|
|
165
|
+
After completing the PWNISMS analysis and before writing code:
|
|
166
|
+
|
|
167
|
+
1. **Review all fetched guardrails** from `get_guardrails`.
|
|
168
|
+
2. **Classify applicability** — For each guardrail, determine if it applies to the current task.
|
|
169
|
+
3. **Apply during code generation:**
|
|
170
|
+
- `must` rules → mandatory implementation requirements. Every applicable `must` guardrail must be satisfied.
|
|
171
|
+
- `must_not` rules → hard prohibitions. Code must never violate an applicable `must_not` guardrail.
|
|
172
|
+
4. **Flag conflicts** — If a guardrail conflicts with the user's explicit instruction, flag it and ask for confirmation.
|
|
173
|
+
5. **Create new guardrails on the fly** — When PWNISMS analysis or code review reveals a recurring security pattern not captured by existing guardrails, create and apply it as a new guardrail (marked `source: "ide_generated"` in CTM sync). Include `title`, `rule_type` (must/must_not), `category`, `instruction`, and rationale in the notes.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Phase 4 — Security-First Code Generation Rules
|
|
178
|
+
|
|
179
|
+
When implementing code, enforce these baseline controls alongside project guardrails:
|
|
180
|
+
|
|
181
|
+
1. Validate and constrain all untrusted input.
|
|
182
|
+
2. Parameterize all queries and command-like invocations.
|
|
183
|
+
3. Enforce least privilege for users, services, and workloads.
|
|
184
|
+
4. Never hardcode secrets; use managed secret stores.
|
|
185
|
+
5. Encrypt sensitive data in transit and at rest.
|
|
186
|
+
6. Log security-relevant actions without leaking secrets/PII.
|
|
187
|
+
7. Pin and verify dependencies and build artifacts.
|
|
188
|
+
8. Return safe user errors; keep sensitive diagnostics internal.
|
|
189
|
+
9. Add abuse protections (rate limits, lockouts, throttling) on exposed interfaces.
|
|
116
190
|
|
|
117
191
|
---
|
|
118
192
|
|
|
@@ -129,22 +203,38 @@ When discussing designs before code exists:
|
|
|
129
203
|
- Centralized authn/authz and role checks.
|
|
130
204
|
- Secrets manager / KMS for credentials and keys.
|
|
131
205
|
- mTLS or signed requests for service-to-service calls.
|
|
206
|
+
- Review existing guardrails for design-level constraints.
|
|
132
207
|
|
|
133
208
|
---
|
|
134
209
|
|
|
135
|
-
##
|
|
210
|
+
## Phase 5 — CTM Sync (Post Threat Modelling)
|
|
136
211
|
|
|
137
|
-
|
|
212
|
+
**MANDATORY:** After every threat modeling step that produces or modifies threat content, synchronize via `ctm_sync`.
|
|
138
213
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
214
|
+
### What triggers CTM sync
|
|
215
|
+
|
|
216
|
+
- New threat model generated (any form: scenarios, data flows, attack trees, PWNISMS analysis)
|
|
217
|
+
- Existing threat model updated or extended (new threats, refined mitigations, additional components)
|
|
218
|
+
- Guardrails applied during a code-generation task (existing or IDE-generated)
|
|
219
|
+
|
|
220
|
+
### What CTM sync uploads
|
|
221
|
+
|
|
222
|
+
The `ctm_sync` agent builds and pushes an event payload containing:
|
|
223
|
+
|
|
224
|
+
- **Threat model findings**: threats mitigated, PWNISMS categories, severities, mitigations applied
|
|
225
|
+
- **Best practices achieved**: security patterns followed during implementation
|
|
226
|
+
- **Secure code snippets**: security-relevant code with explanations
|
|
227
|
+
- **Guardrails applied**: all guardrails enforced during this session — both existing ones fetched from `get_guardrails` (`source: "existing"`) and new ones the IDE agent created on the fly (`source: "ide_generated"`), each with satisfaction status
|
|
228
|
+
- **Project profile updates**: architecture notes, tech categories, user groups, compliance requirements, language stacks
|
|
229
|
+
|
|
230
|
+
### How to invoke
|
|
231
|
+
|
|
232
|
+
Use the `ctm_sync` agent (Task tool with `subagent_type="ctm_sync"`) with:
|
|
233
|
+
- A clear description of what was threat-modeled
|
|
234
|
+
- The `chat_session_id` for workflow routing
|
|
235
|
+
- Whether this is a new threat model or an update
|
|
236
|
+
|
|
237
|
+
See `.cursor/agents/ctm_sync.md` (or `.cursor/commands/ctm_sync.md`) for the full workflow and payload schema.
|
|
148
238
|
|
|
149
239
|
---
|
|
150
240
|
|
|
@@ -157,5 +247,8 @@ Before finalizing output, confirm:
|
|
|
157
247
|
- [ ] Top risks were prioritized by impact and likelihood.
|
|
158
248
|
- [ ] Mitigations are concrete and actionable.
|
|
159
249
|
- [ ] Residual risk and follow-up actions are stated.
|
|
250
|
+
- [ ] Vibe guardrails were fetched and enforced (all applicable `must`/`must_not` rules satisfied).
|
|
251
|
+
- [ ] Guardrail compliance summary is included in the response (existing + IDE-generated).
|
|
252
|
+
- [ ] CTM sync was invoked to upload threat model and guardrail data.
|
|
160
253
|
|
|
161
254
|
If ANY box cannot be checked, you MUST flag the gap to the user with a specific remediation recommendation before finalizing the code.
|