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: docs/semgrep-appsec-platform/dashboard.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -171,10 +171,10 @@ A low or 0 value for **Total net new** is ideal as it indicates that findings ar
171
171
172
172
## Secure guardrails
173
173
174
-
This provides an overview of how secure guardrails in **PR or MR comments** are used in your organization. Other guardrail interfaces, such as the IDE or `pre-commit`, are not counted in this section.
174
+
This provides an overview of how secure guardrails in **PR or MR comments** are used in your organization, as well as how often [Semgrep Assistant, if enabled, filters out false positives](/semgrep-assistant/overview#noise-filtering) and suppresses PR or MR comments, reducing noise for developers. Other guardrail interfaces, such as the IDE or `pre-commit`, are not counted in this section.
_**Figure**. Secure guardrails pane. Hover over the charts to view data for that point in time._
177
+
_**Figure**. Secure guardrails pane. Hover over the charts to view data for that point in time. Click on Filtered by Assistant data to view filtered findings on Code > Pre-production._
178
178
179
179
### Key metrics
180
180
@@ -191,7 +191,7 @@ _**Figure**. Secure guardrails pane. Hover over the charts to view data for that
191
191
| Chart | Description |
192
192
| ------- | ------ |
193
193
| Secure guardrails adoption | Percent of new findings shown to developers over the specified time period. An upward or stable trend is better. |
194
-
| Guardrails activity | This chart displays a breakdown of the status of findings shown to developers; whether they were ignored, fixed, or remained open. A greater **Fixed** value is better. |
194
+
| Guardrails activity | This chart displays a breakdown of the status of findings shown to developers; whether they were ignored, fixed, remained open, or [filtered by Assistant](/semgrep-assistant/overview#noise-filtering). A greater **Fixed** value is better. |
Copy file name to clipboardexpand all lines: docs/semgrep-assistant/getting-started.md
+58-14
Original file line number
Diff line number
Diff line change
@@ -55,9 +55,9 @@ Semgrep Assistant requires [read access to your code in GitHub](https://docs.git
55
55
4. When prompted, click **Continue** to allow redirection to GitHub to finalize app creation. Follow the instructions to finish creating and installing a private `semgrep-app`.
56
56
4. You are redirected to Semgrep AppSec Platform's **Source Code Managers** page. Navigate back to the **Deployment** page. Under the **Assistant** section, verify that all of the features are enabled:
57
57
1.**Allow code snippets in AI prompts**: Required for Semgrep to auto-triage findings, provide AI remediation guidance, and tag findings with code context.
58
-
2.**Auto-triage for Code**: Enable notifications whenever Assistant suggests that a finding may be safe to ignore. You can include notifications in your PR and MR comments, or you can receive them through Slack notifications.
59
-
3.**Autofix suggestions for Code**: Enable Assistant-generated autofix suggestions in comments from Assistant. You can also set the minimum confidence level for Assistant-written fixes if the Semgrep rule doesn't include a human-written autofix.
2.**Weekly priority emails**: Enable weekly emails to all organization admins with information on Assistant's top three backlog tasks across all findings.
59
+
3.**Noise filter for Code PR/MR comments**: Enable the filtering of findings flagged as false positives. You can choose to suppress any PR or MR comments Semgrep might push, or you can choose to show developers information regarding false positives using PR or MR comments.
60
+
4.**Remediation**: Enable Assistant-generated autofix suggestions in comments from Assistant. You can also set the minimum confidence level for Assistant-written fixes if the Semgrep rule doesn't include a human-written autofix.
61
61
62
62
</TabItem>
63
63
@@ -82,19 +82,19 @@ Semgrep Assistant requires the **API scope** to run in both GitLab SaaS and GitL
82
82
1. Follow the on-screen instructions to complete the setup process.
83
83
2. Navigate back to the **Deployment** page. Under the **Assistant** section, verify that all of the features are enabled:
84
84
1.**Allow code snippets in AI prompts**: Required for Semgrep to auto-triage findings, provide AI remediation guidance, and tag findings with code context.
85
-
2.**Autofix suggestions for Code**: Enable autofix suggestions in comments from Assistant. You can also set the minimum confidence level for Assistant-written fixes if the Semgrep rule doesn't include a human-written autofix.
86
-
3.**Auto-triage for Code**: Enable notifications whenever Assistant suggests that a finding may be safe to ignore. You can include notifications in your PR and MR comments, or you can receive them through Slack notifications.
2.**Weekly priority emails**: Enable weekly emails to all organization admins with information on Assistant's top three backlog tasks across all findings.
86
+
3.**Noise filter for Code PR/MR comments**: Enable the filtering of findings flagged as false positives. You can choose to suppress any PR or MR comments Semgrep might push, or you can choose to show developers information regarding false positives using PR or MR comments.
87
+
4.**Remediation**: Enable Assistant-generated autofix suggestions in comments from Assistant. You can also set the minimum confidence level for Assistant-written fixes if the Semgrep rule doesn't include a human-written autofix.
88
88
89
89
</TabItem>
90
90
</Tabs>
91
91
92
-
### Enable autofix suggestions
92
+
### Enable remediation
93
93
94
-
Assistant autofix allows you to receive AI-generated code snippets to remediate true positives. Perform the following to enable it:
94
+
Assistant remediation allows you to receive AI-generated code snippets for true positives. Perform the following to enable it:
95
95
96
96
1. Sign in to Semgrep AppSec Platform, and navigate to **Settings > Deployment**.
97
-
2. In the **Assistant** section, click the *Autofix suggestions for Code** <iclass="fa-solid fa-toggle-large-on"></i> if it is not yet enabled.
97
+
2. In the **Assistant** section, click the **Remediation** <iclass="fa-solid fa-toggle-large-on"></i> if it is not yet enabled.
98
98
3.*Optional*: Select a **confidence level** in the drop-down box. This value determines the level of quality at which the autofix code appears as a suggestion. A lower confidence level means that Semgrep Assistant displays the autofix suggestion even when the code quality may be incorrect.
99
99
:::tip
100
100
Semgrep recommends setting a low confidence level since even incorrect suggestions may be useful starting points for triage and remediation.
@@ -118,16 +118,37 @@ Semgrep Assistant messages only appear in your PR comments for rules that are se
* You have selected PR/MR comments in **Semgrep AppSec Platform > Settings > Deployment** in the **Code** section.
120
120
121
+
### Enable weekly priority emails
122
+
123
+
If [weekly priority emails](/semgrep-assistant/overview/#weekly-priority-emails), which allows organization admins to receive information on top backlog tasks according to Assistant, isn't enabled for your deployment, you can do so as follows:
124
+
125
+
1. Sign in to Semgrep AppSec Platform, and navigate to **Settings > Deployment**.
126
+
2. In the **Assistant** section, click the **Weekly priority emails** <iclass="fa-solid fa-toggle-large-on"></i> if it is not yet enabled.
127
+
128
+
### Enable noise filtering
129
+
130
+
Assistant is [over 95% accurate in categorizing Semgrep Code findings as false positives](/semgrep-assistant/metrics.md), so you can minimize the number of findings shown by enabling **Noise filter for Code PR/MR comments**. To do so:
131
+
132
+
1. Sign in to Semgrep AppSec Platform, and navigate to **Settings > Deployment**.
133
+
2. In the **Assistant** section, click the **Noise filter for Code PR/MR comments** <iclass="fa-solid fa-toggle-large-on"></i> if it is not yet enabled.
134
+
3. Select whether you want to enable PR or MR comments:
135
+
1.**Don’t leave a PR/MR comment**: Hide Semgrep’s comments on findings that are likely to be false positives. These findings are available for security review on the [**Code > Pre-production backlog** page](https://semgrep.dev/orgs/-/findings?tab=open&last_opened=All+time&backlog=preprod). Comments still appear for rules in [**Block** mode](/semgrep-code/policies#block-a-pr-or-mr-through-rule-modes).
136
+
2.**Include a notification in the PR/MR comment**: Show developers likely false positive findings in PR/MR comments, but include a note explaining why Assistant thinks the finding may be safe to ignore.
137
+
138
+
Findings filtered out by Assistant can be reviewed at any time in Semgrep by going to the [**Code > Pre-production backlog** page](https://semgrep.dev/orgs/-/findings?tab=open&last_opened=All+time&backlog=preprod). Semgrep also allows you to agree with the filtering to close the finding or disagree to reopen.
139
+
121
140
## Add Memories (beta)
122
141
123
-
Assistant Memories allows AppSec teams and developers to tailor Assistant's remediation guidance to their organization's standards and defaults on a per-project, per-rule basis. Whenever Assistant gives a suggested fix, you can provide feedback by adding custom instructions.
142
+
Assistant Memories allows admins to tailor Assistant's remediation guidance to their organization's standards and defaults on a per-project, per-rule basis. You can provide feedback by adding custom instructions whenever Assistant gives a suggested fix.
124
143
125
-
Memories are enabled by default for all Assistant users.
144
+
Memories are enabled by default for all organizations with Assistant enabled.
126
145
127
-
To add a memory:
146
+
### Add a memory based on Assistant's suggested fix
128
147
129
-
1. Identify the specific instance of **Assistant's suggested fix** that you want to modify. These can be found in the finding details page or in the PR or MR comment.
130
-
2. Click **Customize fix** to open an input box, and enter your preferred remediation approaches and secure defaults for the project. The suggestion you provide can be as general as "Use AWS Secrets Manager to manage secrets."
148
+
To add a memory modifying a suggested fix presented by Assistant:
149
+
150
+
1. Identify the specific instance of **Assistant's suggested fix** that you want to modify. These can be found on the finding details page or in the PR or MR comment.
151
+
2. Click **Customize fix** to open an input box, and enter your preferred remediation approaches and secure defaults for the project. Your suggestion can be as general as "Use AWS Secrets Manager to manage secrets."
131
152

132
153
***Figure***. Assistant’s suggested fix for a hardcoded secret in the user’s code.
133
154
3. Click **Save and regenerate**.
@@ -139,6 +160,29 @@ To add a memory:
139
160
140
161
While Assistant Memories is in **public beta**, memories are scoped to remediation guidance on a per-project and per-rule basis. A saved memory only affects future guidance for findings triggered by the same rule in the same project.
141
162
163
+
### Add memory during triage
164
+
165
+
If you identify findings that are safe to ignore and write triage notes indicating why this is so, Assistant can store this information as a memory and use it when assessing whether a similar finding should be shown to developers in the future. Assistant also takes that memory, reanalyzes similar findings in your backlog, and suggests issues that may be safe to close.
166
+
167
+
To add a memory during triage:
168
+
169
+
1. Identify the specific finding you want to modify, and open up its finding details page.
170
+
2. Change the status of the finding to **Ignored**, and optionally, select an **Ignore reason** and provide **Comments** on why you're changing the finding's status as **Ignored**.
171
+
3. Click **Ignore & add memory**.
172
+
4. In the **Create memory** dialog:
173
+
1. In **Memory**, provide the organization-specific reason why the finding is a false positive. If you provided a comment when setting the status of the finding, Semgrep copies the comment into this field. Your suggestion can be as general as "When there's a function that sanitizes user input, SQL injection is mitigated and developers shouldn't see the finding." Note that Assistant may modify the Memory's text for clarity after you save your changes.
174
+
2. Provide the **Projects** to which this memory should be applied.
175
+
3. Provide the **Rules** to which this memory should be applied.
176
+
4. Select the **Apply to <spanclassName="placeholder">X</span> existing findings in scope** box if you would like Semgrep to apply this memory to any existing findings automatically.
177
+
5. Click **Add memory** to save your changes.
178
+

179
+
***Figure***. User-provided instructions for generating a memory during the triage process.
180
+
181
+
### View Memories
182
+
183
+
1. Sign in to [Semgrep AppSec Platform](https://semgrep.dev/login?return_path=/manage/projects) and navigate to [<iclass="fa-solid fa-gear"></i> **Settings > Deployment**](https://semgrep.dev/orgs/-/settings).
184
+
2. In the **Assistant** section, click the <iclass="fa-solid fa-gear"></i> **icon** next to **Customize with memories**. This opens a list of your organization's Memories for review.
185
+
142
186
### Remove Memories
143
187
144
188
1. Sign in to [Semgrep AppSec Platform](https://semgrep.dev/login?return_path=/manage/projects) and navigate to [<iclass="fa-solid fa-gear"></i> **Settings > Deployment**](https://semgrep.dev/orgs/-/settings).
description: Learn about Semgrep Assistant metrics and methodology.
6
+
tags:
7
+
- Deployment
8
+
- Semgrep Assistant
9
+
---
10
+
11
+
# Semgrep Assistant metrics and methodology
12
+
13
+
Semgrep's metrics for evaluating Semgrep Assistant's performance are derived from two sources:
14
+
15
+
-**User feedback** on Assistant recommendations within the product
16
+
-**Internal triage and benchmarking** conducted by Semgreps security research team
17
+
18
+
This methodology ensures that Assistant is evaluated from both a user's and expert's perspective. This gives Semgrep's product and engineering teams a holistic view into Assistant's real-world performance.
19
+
20
+
## User feedback (real-world dataset)
21
+
22
+
User feedback shows the aggregated and anonymized performance of Assistant across **more than 1000 customers**, providing a comprehensive real-world dataset.
23
+
24
+
Users are prompted in-line to "thumbs up" or "thumbs down" Assistant suggestions as they receive Assistant suggestions in their PR or MR. This ensures that sampling bias is reduced, as both developers and AppSec engineers can provide feedback.
25
+
26
+
**Results as of Jan 10, 2024:**
27
+
28
+
<table>
29
+
<tr>
30
+
<td>Customers in dataset</td>
31
+
<td><b>1000+</b></td>
32
+
</tr>
33
+
<tr>
34
+
<td>Findings analyzed</td>
35
+
<td><b>250,000+</b></td>
36
+
</tr>
37
+
<tr>
38
+
<td>Human-agree rate</td>
39
+
<td><b>92%</b></td>
40
+
</tr>
41
+
<tr>
42
+
<td>Median time to resolution</td>
43
+
<td><b>22% faster than baseline</b></td>
44
+
</tr>
45
+
<tr>
46
+
<td>Average time saved per finding</td>
47
+
<td><b>30 minutes</b></td>
48
+
</tr>
49
+
</table>
50
+
51
+
## Internal benchmarks
52
+
53
+
Internal benchmarks for Assistant use a process in which a rotating team of security engineers conduct periodic reviews of findings and their Assistant generated triage recommendations or remediation guidance. This is the same process used to evaluate Semgrep's SAST engine and rule performance.
54
+
55
+
Internal benchmarks for Assistant run on the same dataset used by Semgrep's security research team to analyze Semgrep rule performance. This means the dataset is not prone to cherry-picked findings that are easier for AI to analyze, and accurately represents real-world performance across a variety of contexts.
56
+
57
+
<table>
58
+
<tr>
59
+
<td>Findings analyzed</td>
60
+
<td><b>2000+</b></td>
61
+
</tr>
62
+
<tr>
63
+
<td>Average reduction in findings[^1]</td>
64
+
<td><b>20%</b></td>
65
+
</tr>
66
+
<tr>
67
+
<td>False positive confidence rate[^2]</td>
68
+
<td><b>96%</b></td>
69
+
</tr>
70
+
<tr>
71
+
<td>Remediation guidance confidence rate[^3]</td>
72
+
<td><b>80%</b></td>
73
+
</tr>
74
+
</table>
75
+
76
+
[^1]:The average % of SAST findings that Assistant filters out as noise.
77
+
78
+
[^2]:False positive confidence rate measures how often Assistant is correct when it identifies a false positive. **A high confidence rate means users can trust when Assistant identifies a false positive - it does not mean that Assistant catches all false positives.**
79
+
80
+
[^3]:Remediation guidance is rated on a binary scale of "helpful" / "not helpful".
Copy file name to clipboardexpand all lines: docs/semgrep-assistant/overview.md
+12-3
Original file line number
Diff line number
Diff line change
@@ -91,10 +91,19 @@ Auto-triage recommendations are available in Semgrep AppSec Platform's **Finding
91
91

92
92
_**Figure.** Semgrep Assistant auto-triage in the Findings page._
93
93
94
-
Assistant's suggestions to ignore findings are also surfaced in PR or MR comments, so developers can triage an issue without switching contexts, as well as being sent through Slack.
94
+
Assistant's suggestions to ignore findings are also surfaced in PR or MR comments, so developers can triage an issue directly without leaving their PR or MR.
95
95
96
-

97
-
_**Figure.** Semgrep Assistant auto-triage in a Slack notification._
96
+
### Weekly priority emails
97
+
98
+
Semgrep sends weekly emails with information on Assistant's top three backlog tasks across all findings. Unlike other Assistant features, these suggestions can include information for all Semgrep products that you have enabled. The emails are sent out on Monday to all organization admins.
99
+
100
+
### Noise filtering (beta)
101
+
102
+
Noise filtering increases developer velocity by reducing interruptions from potential false positives. With Noise Filtering, Assistant evaluates each finding to determine if it's a true positive using additional context. If Assistant thinks a finding may be a false positive, it prevents a PR comment from being posted in the developer workflow.
103
+
104
+
Security teams can review filtered findings at any time on Semgrep's [**Code > Pre-production** page](https://semgrep.dev/orgs/-/findings?tab=open&last_opened=All+time&backlog=preprod). Semgrep also allows you to agree or disagree with the filtering. If you agree with the suggestion, Semgrep closes the finding, but if you disagree, Semgrep reopens the finding.
105
+
106
+
Assistant is [over 95% accurate in categorizing Semgrep Code findings as false positives](/semgrep-assistant/metrics.md).
0 commit comments