Documentation Index
Fetch the complete documentation index at: https://docs.semgrep.dev/llms.txt
Use this file to discover all available pages before exploring further.
- Prevent issues from merging into production or default branches. This improves security posture and reduces the growth of the vulnerability backlog.
- Reduce the time and cost to address issues—the earlier a vulnerability is detected, the faster it is to fix.

The content that identifies, explains, and provides remediation guidance for the security issue, such as the Semgrep rule and Semgrep Multimodal (AI) remediation guidance. Semgrep uses rules, which are instructions that detect patterns in your code, such as security issues, bugs, and more. Semgrep generates and reports findings to you whenever it finds code that matches the patterns defined by rules. Semgrep rules also include a message that guides remediation and provides other metadata about the vulnerability, such as its OWASP category, which are presented to the developer. Further improvements to this guidance are made through Semgrep Multimodal. Interface
The developer-native interface where the developer can see the content and triage or remediate the finding, such as Visual Studio Code (VS Code), pre-commit on CLI, or GitHub pull request comments. See all supported interfaces.

Qualities of secure guardrails
Speed
Scans must be quick to successfully integrate into developer workflows without slowing them down. The following table lists the speed of a Semgrep scan in relation to the environment the scan is run in:| Interface | Scope of scan | Analysis | Typical speed |
|---|---|---|---|
| IDE (per keystroke and on save) | Current file | Single-function, single-file | In a few seconds |
CLI on commit (through pre-commit) | Files staged for commit (cross-function, single-file analysis) | Cross-function, single-file | Under 5 minutes |
| PR or MR comments | All committed files and changes in the PR or MR | Cross-function, single-file analysis | Under 5 minutes |
Support for developer interfaces (pre-build)
Guardrails should be able to provide remediation guidance and means to triage findings or give feedback within developer interfaces. Semgrep supports the following interfaces:| Interface | Supported providers and apps | Triage and remediation actions |
|---|---|---|
| IDEs | Visual Studio Code (VS Code) |
|
| IDEs | IntelliJ-based IDEs |
|
| PR or MR comments | All GitHub plans |
|
| PR or MR comments | All GitLab plans |
|
| PR or MR comments | All Bitbucket plans |
|
| PR or MR comments | Azure DevOps Cloud |
|
CLI through pre-commit | Most terminal emulator apps |
|



Customizability
Every organization has its own secure coding practices. Customizability ensures that the tool can adapt to the unique needs of an organization. Semgrep provides customizability through:- Custom rules: You can create custom rules and deploy them as guardrails. Learn more about Semgrep rule structure in the next section.
- Memories: this feature allows you to add and save additional context when Semgrep Multimodal provides remediation. For example, you can provide organization-specific public keys, which Semgrep Multimodal remembers.
Remediation guidance
Remediation guidance can come in three forms:- The rule’s
message - AI-generated remediation guidance through Semgrep Multimodal
- The rule’s
fix
- Customize remediation through your organization-specific rules.
- Writing your own rules provides you with a means to tailor Semgrep to your organization with or without Multimodal.
- Write and deploy guardrails of your own.
Click to view a line-by-line explanation of each field in the sample rule.
Click to view a line-by-line explanation of each field in the sample rule.
The rule message
This description explains why the finding was generated and outlines general advice on resolving the issue. Messages notify developers in all interfaces where you’ve deployed a guardrail.
AI-generated remediation guidance and code suggestions (Semgrep Multimodal)
This is a tailored, step-by-step outline of what a developer must change to fix the insecure code. The guidance makes use of the Semgrep rule, AI’s understanding of code, and a prompt tree that incorporates inputs such as:- Prior triage decisions
- Custom instructions
- Broader context of the file

INFO
- Within developer-native interfaces, Semgrep Multimodal only appears in PR or MR comments. Multimodal guidance does not appear in the IDE or
pre-commit. - You can adjust when the guidance is shown to developers based on the level of confidence in the guidance.
The rule’s human-written fix (fix)
Sometimes a rule can resolve a finding by replacing an insecure function with a secure one. These rules make use of Semgrep’s Rule-defined fix feature, which lets rule-writers provide a human-written deterministic fix, as opposed to Semgrep’s Autofix feature which is AI powered.
Semgrep Multimodal does not provide a code snippet suggestion when a human-written fix is provided in the rule.
Deploy secure guardrails
Prerequisites
For AppSec engineers
- You have completed a Semgrep core deployment.
- Your Policies page should have at least one rule.
For developers
- You must have a Semgrep account.
- You must have joined your Semgrep organization.
- To use Semgrep with your IDE, you must install the extension for the IDE and sign in to Semgrep through the extension.
- To use Semgrep with
pre-commit, you must install and set uppre-commit, then sign in to Semgrep through the CLI.
| Interface | Semgrep Code | Semgrep Secrets | Semgrep Supply Chain |
|---|---|---|---|
| IDE | To notify developers of findings from a rule, add the rule to your Policies. | To notify developers of findings from a rule, add the rule to your Policies. | Coming soon |
| PR or MR comments | To notify developers, a rule must be in Comment mode; you can configure your Policies to include only high confidence, high severity rules. | To notify developers, a rule must be in Comment mode; you can configure your Policies to include only high confidence, high severity rules. | Developers receive comments about any reachable vulnerability of high or critical severity. |
CLI through pre-commit | To notify developers of findings from a rule, add the rule to your Policies. | To notify developers of findings from a rule, add the rule to your Policies. | Developers are notified of all findings by default. |
Next steps
- Learn about secure defaults and their implementation in Semgrep.
- Create custom rules that you can deploy as guardrails.