Supply Chain Autofix does not require Semgrep Multimodal or Upgrade Guidance (beta). You can open an Autofix PR or MR even if Upgrade Guidance is disabled or has not finished running. When Upgrade Guidance analysis has completed, Semgrep can include that information in the PR or MR description.
Open an Autofix PR or MR
1
In Semgrep AppSec Platform, go to Supply Chain.
2
Select a finding.
3
Click Fix > Open Autofix PR.
- If Autofix is unavailable for the finding, Open Autofix PR is disabled. Hover over it to see why. See When Supply Chain Autofix is available.
- If an Autofix PR or MR already exists for the finding, the menu shows View Autofix PR instead.
When Supply Chain Autofix is available
To use Supply Chain Autofix, you must meet the following requirements:Project requirements
- Enable Semgrep Supply Chain scans.
- Run a full scan on a connected repository.
- The project uses a supported ecosystem: JavaScript or Python.
- The finding is open and has a fixed version to upgrade to.
- If Upgrade Guidance has analyzed the upgrade, it did not find dependency conflicts or build errors. See How Upgrade Guidance results affect Autofix.
Repository requirements
- The repository is connected to a source code manager, and the project isn’t archived in Semgrep or in your source code manager.
- Semgrep has code access to the repository and the following write permissions, so that it can push a branch and open a PR or MR. See Grant read and write access.
- GitHub: Contents: Read and write and Pull requests: Read and write
- GitLab:
write_repository
- You have permission to triage findings in the repository.
Environment-specific requirements
- If Semgrep connects to your SCM through the Semgrep Network Broker, upgrade to Network Broker 0.45.2 or later and set
allowCodeAccesstotruefor that SCM. This setting defaults tofalse. Older broker versions return a 403 allowlist error. See Use Semgrep Network Broker with Autofix. - If the dependency is in a private registry, connect the registry to Semgrep.
How Upgrade Guidance results affect Autofix
You don’t need Upgrade Guidance to use Autofix. If Upgrade Guidance has analyzed the upgrade, its result affects Autofix as follows:- The upgrade isn’t possible: if the package manager reports dependency conflicts or build errors for the upgrade, Autofix is unavailable. Review the upgrade guidance on the finding for details.
- Semgrep can’t determine whether the upgrade is safe: you can still open an Autofix PR or MR from the Fix menu, but Semgrep warns that the change may introduce breaking changes. The Autofix button in the upgrade guidance section of the finding isn’t shown.
What the PR or MR contains
Always included
The PR or MR always includes:- Changes to the manifest or lockfile needed to upgrade the dependency.
- The dependency version Semgrep selected.
- A summary of the finding’s severity and reachability.
- Details about the vulnerability and links to its CVE references.
- Relevant dependency release notes, changelogs, and commits.
Included when Upgrade Guidance is available
If Upgrade Guidance analysis has completed by the time you open the PR or MR, the description can also include affected files and functions and guidance on potential breaking changes. If analysis is still in progress or Upgrade Guidance is disabled, that information is not included. For upgrade analysis without opening a PR or MR, see Upgrade Guidance (beta).Troubleshooting
If Autofix is unavailable for a finding, Open Autofix PR is disabled in the Fix menu.- Hover over Open Autofix PR to see why it’s disabled, then review the project requirements.
- If Open Autofix PR shows View instructions to enable, Semgrep is missing repository permissions. Click it to see the setup instructions, and review the repository requirements and environment-specific requirements.
- Common configuration issues include missing Contents: Read and write or Pull requests: Read and write access, a Network Broker older than 0.45.2 or
allowCodeAccessleft atfalse, and a private registry that is not connected to Semgrep.