You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: commands/security/analyze.toml
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ The core principle is to trace untrusted or sensitive data from its entry point
16
16
Your primary objective during the **"SAST Recon on [file]"** task is to identify and flag **every potential Source of untrusted or sensitive input**.
17
17
18
18
* **Action:** Scan the entire file for code that brings external or sensitive data into the application.
19
-
* **Trigger:** The moment you identify a `Source`, you **MUST** immediately rewrite the `SECURITY_ANALYSIS_TODO.md` file and add a new, indented sub-task:
19
+
* **Trigger:** The moment you identify a `Source`, you **MUST** immediately update your todos using the `write_todos` tool. Add a new, indented sub-task:
20
20
* `- [ ] Investigate data flow from [variable_name] on line [line_number]`.
21
21
* You are not tracing or analyzing the flow yet. You are only planting flags for later investigation. This ensures you scan the entire file and identify all potential starting points before diving deep.
22
22
@@ -37,15 +37,15 @@ For EVERY task, you MUST follow this procedure. This loop separates high-level s
37
37
38
38
1. **Phase 0: Initial Planning**
39
39
* **Action:** First, understand the high-level task from the user's prompt.
40
-
* **Action:** If it does not already exist, create a new folder named `.gemini_security` in the user's workspace.
41
-
* **Action:** Create a new file named `SECURITY_ANALYSIS_TODO.md` in `.gemini_security`, and write the initial, high-level objectives from the prompt into it.
42
-
* **Action:** Create a new, empty file named `DRAFT_SECURITY_REPORT.md` in `.gemini_security`.
43
-
* **Action"** Prep yourself using the following possible notes files under `.gemini_security/`. If they do not exist, skip them.
40
+
* **Action:** If it does not already exist, create a new folder named `.gemini_security_new` in the user's workspace.
41
+
* **Action:** Use the `write_todos` tool to write the initial, high-level objectives from the prompt.
42
+
* **Action:** Create a new, empty file named `DRAFT_SECURITY_REPORT.md` in `.gemini_security_new`.
43
+
* **Action"** Prep yourself using the following possible notes files under `.gemini_security_new/`. If they do not exist, skip them.
44
44
* `vuln_allowlist.txt`: The allowlist file has vulnerabilities to ignore during your scan. If you match a vulernability to this file, notify the user and skip it in your scan.
45
45
46
46
2. **Phase 1: Dynamic Execution & Planning**
47
-
* **Action:** Read the `SECURITY_ANALYSIS_TODO.md` file and execute the first task about determinig the scope of the analysis.
48
-
* **Action (Plan Refinement):** After identifying the scope, rewrite `SECURITY_ANALYSIS_TODO.md` to replace the generic "analyze files" task with a specific **Reconnaissance Task** for each file (e.g., `- [ ] SAST Recon on fileA.js`).
47
+
* **Action:** Read your todo list and execute the first task about determinig the scope of the analysis.
48
+
* **Action (Plan Refinement):** After identifying the scope, rewrite your todo list using 'write_todos' to replace the generic "analyze files" task with a specific **Reconnaissance Task** for each file (e.g., `- [ ] SAST Recon on fileA.js`).
49
49
50
50
3. **Phase 2: The Two-Pass Analysis Loop**
51
51
* This is the core execution loop for analyzing a single file.
@@ -63,7 +63,7 @@ For EVERY task, you MUST follow this procedure. This loop separates high-level s
63
63
* **Action:** Repeat this Recon -> Investigate loop until all tasks and sub-tasks are complete.
64
64
65
65
4. **Phase 3: Final Review & Refinement**
66
-
* **Action:** This phase begins when all analysis tasks in `SECURITY_ANALYSIS_TODO.md` are complete.
66
+
* **Action:** This phase begins when all analysis tasks in your todo list are complete.
67
67
* **Action:** Read the entire `DRAFT_SECURITY_REPORT.md` file.
68
68
* **Action:** Critically review **every single finding** in the draft against the **"High-Fidelity Reporting & Minimizing False Positives"** principles and its five-question checklist.
69
69
* **Action:** You must use the `gemini-cli-security` MCP server to get the line numbers for each finding. For each vulnerability you have found, you must call the `find_line_numbers` tool with the `filePath` and the `snippet` of the vulnerability. You will then add the `startLine` and `endLine` to the final report.
@@ -72,10 +72,10 @@ For EVERY task, you MUST follow this procedure. This loop separates high-level s
72
72
5. **Phase 4: Final Reporting & Cleanup**
73
73
* **Action:** Output the final, reviewed report as your response to the user.
74
74
* **Action:** If, after the review, no vulnerabilities remain, your final output **MUST** be the standard "clean report" message specified by the task prompt.
75
-
* **Action:** Remove the temporary files (`SECURITY_ANALYSIS_TODO.md` and `DRAFT_SECURITY_REPORT.md`) from the `.gemini_security/` directory. Only remove these files and do not remove any other user files under any circumstances.
75
+
* **Action:** Remove the temporary file `DRAFT_SECURITY_REPORT.md` from the `.gemini_security_new/` directory. Only remove these files and do not remove any other user files under any circumstances.
76
76
77
77
78
-
### Example of the Workflow in `SECURITY_ANALYSIS_TODO.md`
78
+
### Example todo-list workflow
79
79
80
80
1. **Initial State:**
81
81
```markdown
@@ -97,7 +97,7 @@ For EVERY task, you MUST follow this procedure. This loop separates high-level s
97
97
98
98
**Step 1: Initial Planning**
99
99
100
-
Your first action is to create a `SECURITY_ANALYSIS_TODO.md` file with the following exact, high-level plan. This initial plan is fixed and must not be altered. When writing files always use absolute paths (e.g., `/path/to/file`).
100
+
Your first action is to create a todo list using 'write_todos' with the following exact, high-level plan. This initial plan is fixed and must not be altered. When writing files always use absolute paths (e.g., `/path/to/file`).
101
101
102
102
- [ ] Define the audit scope.
103
103
- [ ] Conduct a two-pass SAST analysis on all files within scope.
@@ -112,10 +112,10 @@ You will now begin executing the plan. The following are your precise instructio
112
112
* After using the tool, provide the user a list of changed files. If the list of files is empty, ask the user to provide files to be scanned.
113
113
114
114
2. **Immediately after defining the scope, you must refine your plan:**
115
-
* You will rewrite the `SECURITY_ANALYSIS_TODO.md` file.
115
+
* You will rewrite the todo list using 'write_todos' .
116
116
* Out of Scope Files: Files that are primarily used for managing dependencies like lockfiles (e.g., `package-lock.json`, `package.json` `yarn.lock`, `go.sum`) should be considered out of scope and **must be omitted from the plan entirely**, as they contain no actionable code to review.
117
117
* You **MUST** replace the line `- [ ] Conduct a two-pass SAST analysis on all files within scope.` with a specific **"SAST Recon on [file]"** task for each file you discovered in the previous step.
118
118
119
119
After completing these two initial tasks, continue executing the dynamically generated plan according to your **Core Operational Loop**.
0 commit comments