@securityreviewai/securityreview-kit 0.1.19 → 0.1.20
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
CHANGED
|
@@ -23,7 +23,10 @@ When invoked:
|
|
|
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
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. **
|
|
26
|
+
4. **Identify guardrails for the payload** — Do **not** call `get_guardrails` here. Guardrails were already fetched at session start (per the Vibe Guardrails rule) and applied during code generation. From the parent agent context, identify:
|
|
27
|
+
- Which **existing** guardrails (originally fetched from `get_guardrails`) were applied to the code in this session.
|
|
28
|
+
- Which guardrails the IDE agent **created on the fly** (`ide_generated`) based on gaps found during threat modeling or code review.
|
|
29
|
+
Include all of these in the `guardrails_applied` payload field. Do not re-fetch or re-call `get_guardrails`.
|
|
27
30
|
5. **Build the event payload** — Construct a JSON object for `create_ai_ide_event` conforming to the **Event Payload Schema** below.
|
|
28
31
|
6. **Upload the payload** using `security-review-mcp`:
|
|
29
32
|
- Call `create_ai_ide_event` with the JSON payload.
|
|
@@ -55,7 +58,13 @@ The `create_ai_ide_event` payload MUST be a JSON object with the following struc
|
|
|
55
58
|
"threat_name": "<string — short threat title>",
|
|
56
59
|
"pwnisms_category": "<string — one of: Product, Workload, Network, IAM, Secrets, Monitoring, Supply Chain>",
|
|
57
60
|
"severity": "<string — Critical | High | Medium | Low>",
|
|
58
|
-
"mitigation_applied": "<string — what was done to address the threat>"
|
|
61
|
+
"mitigation_applied": "<string — what was done to address the threat>",
|
|
62
|
+
"code_snippet": {
|
|
63
|
+
"file_path": "<string — relative path to the actual source file where mitigation is implemented>",
|
|
64
|
+
"language": "<string — programming language>",
|
|
65
|
+
"snippet": "<string — the exact source code lines implementing the mitigation, max 30 lines, must be grounded in the actual codebase not invented>",
|
|
66
|
+
"explanation": "<string — how this specific code addresses the threat>"
|
|
67
|
+
}
|
|
59
68
|
}
|
|
60
69
|
],
|
|
61
70
|
"best_practises_achieved": [
|
|
@@ -93,7 +102,7 @@ The `create_ai_ide_event` payload MUST be a JSON object with the following struc
|
|
|
93
102
|
| `summary` | Yes | 2-5 sentences |
|
|
94
103
|
| `developer_name` | Yes | From API/user context (never read from git config) |
|
|
95
104
|
| `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 |
|
|
105
|
+
| `threats_mitigated` | Yes | Array, may be empty `[]` if no threats were identified. Each entry must include a `code_snippet` grounded in actual source code |
|
|
97
106
|
| `best_practises_achieved` | Yes | Array of strings, may be empty `[]` |
|
|
98
107
|
| `secure_code_snippets` | Yes | Array, may be empty `[]` |
|
|
99
108
|
| `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 |
|
|
@@ -101,8 +110,10 @@ The `create_ai_ide_event` payload MUST be a JSON object with the following struc
|
|
|
101
110
|
### Constraints
|
|
102
111
|
|
|
103
112
|
- Every `threats_mitigated` entry must map to one of the 7 PWNISMS categories.
|
|
104
|
-
- `
|
|
105
|
-
- `
|
|
113
|
+
- Every `threats_mitigated` entry must include a `code_snippet`. The snippet must be taken from the actual source code written or modified in this session — never fabricated. If no code was written for a threat (e.g. it was addressed architecturally), set `snippet` to an empty string and explain in `explanation`.
|
|
114
|
+
- `secure_code_snippets` must not exceed 50 lines per snippet; `threats_mitigated[].code_snippet.snippet` must not exceed 30 lines; truncate with a comment if needed.
|
|
115
|
+
- Do not call `get_guardrails` during CTM sync. Guardrails are fetched once at session start; identify which ones were applied from the parent agent context.
|
|
116
|
+
- `guardrails_applied` entries with `source: "existing"` must reference guardrails by the exact `title` they had when fetched at session start.
|
|
106
117
|
- `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
118
|
- `developer_name` and `developer_email` must come from API/runtime user context only; do not derive them from git config.
|
|
108
119
|
- Never invent values for any field; use empty strings or empty arrays when data is unavailable.
|