Skip to main content

Enable Semgrep Assistant

This article walks you through enabling Semgrep Assistant for your deployment.

Prerequisites

Semgrep Assistant extends normal Semgrep capabilities by providing contextually aware AI-generated suggestions. In order to build that context, it requires GitHub permissions in addition to the standard permissions required for Semgrep.

Semgrep Assistant requires read access to your code in GitHub. This is done through a private Semgrep GitHub app that you install during Assistant setup. This private Semgrep GitHub app:

  • Is fully under your control so you can revoke access or specific permissions at any time by visiting Settings > Applications in GitHub.
  • Only accesses source code repositories on a file-by-file basis; it does not need or request org-level access to your codebase.
  • Can be configured to limit its scope to specific repositories. You do not need to give read access to all repositories in your GitHub organization.

Enable Assistant

  1. Sign in to Semgrep AppSec Platform.
  2. Click Settings.
  3. In the Assistant section, click the Allow code snippets in AI prompts toggle. Semgrep Assistant setup button This launches the Set up Semgrep Assistant prompt.
  4. Select a source code manager (SCM) by clicking github.com.
  5. Semgrep provides you with information on why Assistant requires access to your source code. Click Accept & Enable Assistant to proceed.
  6. You are redirected to the page where you can add a GitHub Private App that grants Semgrep read access to your code.
    1. Enter your GitHub information. Select whether you're installing the app on an organization or Personal Account, and provide its name.
    2. Click Review permissions to see the permissions requested by Semgrep.
    3. Click Register GitHub App to proceed.
    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.
  7. 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:
    1. Allow code snippets in AI prompts: Required for Semgrep to auto-triage findings, provide AI remediation guidance, and tag findings with code context.
    2. Weekly priority emails: Enable weekly emails to all organization admins with information on Assistant's top three backlog tasks across all findings.
    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.
    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.

Once you have enabled Semgrep Assistant, you can customize your deployment by enabling or disabling the Assistant features that best fit your software development lifecycle.


Not finding what you need in this doc? Ask questions in our Community Slack group, or see Support for other ways to get help.