Customize Semgrep Assistant
You can customize Semgrep Assistant by enabling and using the features detailed on this page.
Remediation
Assistant remediation allows you to receive AI-generated code snippets for true positives. Perform the following to enable it:
- Sign in to Semgrep AppSec Platform, and navigate to Settings > Deployment.
- In the Assistant section, click the Remediation if it is not yet enabled.
- 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.
Semgrep recommends setting a low confidence level since even incorrect suggestions may be useful starting points for triage and remediation.
Auto-triage
Auto-triage allows you to get notifications whenever Assistant indicates a finding may be safe to ignore. You can enable auto-triage, if it isn't already, as follows:
- Sign in to Semgrep AppSec Platform, and navigate to Settings > Deployment.
- In the Assistant section, click the Auto-triage for Code if it is not yet enabled.
- Select whether you want alerts included in your PR/MR comments and Slack notifications.
Figure. MR comment from Semgrep Assistant in GitLab.
Missing PR and comments
Semgrep Assistant messages only appear in your PR comments for rules that are set to Comment or Block mode on the Rule Management page. Ensure that:
- You have set rules to Comment or Block mode.
- You have selected PR/MR comments in Semgrep AppSec Platform > Settings > Deployment in the Code section.
Weekly priority emails
Weekly priority emails allows organization admins to receive information on top backlog tasks according to Assistant. If this feature isn't enabled for your deployment, you can do so as follows:
- Sign in to Semgrep AppSec Platform, and navigate to Settings > Deployment.
- In the Assistant section, click the Weekly priority emails if it is not yet enabled.
Noise filtering
Assistant is over 95% accurate in categorizing Semgrep Code findings as false positives, so you can minimize the number of findings shown by enabling Noise filter for Code PR/MR comments. To do so:
- Sign in to Semgrep AppSec Platform, and navigate to Settings > Deployment.
- In the Assistant section, click the Noise filter for Code PR/MR comments if it is not yet enabled.
- Select whether you want to enable PR or MR comments:
- 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. Comments still appear for rules in Block mode.
- 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.
Findings filtered out by Assistant can be reviewed at any time in Semgrep by going to the Code > Pre-production backlog page. Semgrep also allows you to agree with the filtering to close the finding or disagree to reopen.
Add Memories (beta)
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.
Memories are enabled by default for all organizations with Assistant enabled.
Add a memory based on Assistant's suggested fix
To add a memory modifying a suggested fix presented by Assistant:
- 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.
- 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."