AI. You can give feedback on each finding with thumbs up or thumbs down, and the agent uses that feedback in later scans.
To improve detection results, you can add AI context rules. The detection agent treats these rules as trusted facts about your codebase. This helps it confirm genuine vulnerabilities, eliminate false positives, and account for behavior it cannot infer from the code alone. See Improve AI SAST results with context to use rules and feedback before and after a scan.
AI SAST scans in CI/CD
You can run AI SAST scans as part of your CI/CD pipelines by adding the--ai-sast flag to your endorctl scan command in the following platforms:
- GitHub Actions
- GitLab
- Jenkins
- Google Cloud Build
- Azure DevOps
- Bitbucket Pipelines
- Buildkite
- CircleCI
AI SAST scans in SCM apps
The Endor Labs GitHub, GitLab, Bitbucket, and Azure DevOps apps can run AI SAST scans without any CI configuration. Select AI SAST as a scanner on the integration, and both scheduled scans and pull request scans include it. To configure AI SAST scans:- Install the Endor Labs SCM app for your source provider:
- Under Scanners, select AI SAST. To add AI SAST to an integration you already installed, edit that integration and select AI SAST.
ENDOR_SCAN_AI_SAST=true to the Environment Variables, and then associate the scan profile with the project. Use this method to enable AI SAST for specific projects rather than for every repository in the integration. To turn AI SAST off for a project, set ENDOR_SCAN_AI_SAST=false in its scan profile. This turns AI SAST off even when ENDOR_SCAN_ENABLE includes ai-sast.
AI SAST runs only on scans of the repository’s default branch and on pull requests that target it. Scans of other branches skip AI SAST.
Time limit and scan summary
An AI SAST scan has a six-hour time limit. If a scan reaches this limit, it skips the remaining code and retains findings from the code it already scanned. endorctl completes the scan withPARTIAL_SUCCESS and a warning explaining why. Scans also return PARTIAL_SUCCESS if some code segments fail or the index is incomplete.
At the end of each scan, endorctl prints a summary of the code segments scanned, served from the cache, and remaining.
AI SAST PR scans
You can run AI SAST incrementally on pull requests to show only the new findings introduced by the change, rather than rescanning the whole repository on every PR. AI SAST PR scans require an established baseline scan on the target branch and deduplicate findings against that baseline. After the pull request lands, they merge accepted findings back into the baseline. See AI SAST PR scans for prerequisites, supported integrations, and setup steps. You can configure AI SAST PR scans through:- endorctl
- CI pipelines:
- SCM apps:
AI SAST diff scans
A local diff scan runs the AI SAST detection agent against the diff in your working tree without using a baseline. Use it for ad-hoc review during development. Developers can use AI SAST diff scans to find issues in their code without waiting for a pull request scan. Run them from your terminal to get fast feedback while you are still writing the change. Diff scans use Git locally and do not need an Endor Labs baseline. Endor Labs does not deduplicate diff scan findings against any prior scan, so findings may overlap with issues that already exist on the target branch. Use diff scans for early exploration on a feature branch, and use AI SAST PR scans for the official review signal on a pull request. A diff scan supports two modes through the--diff-scope flag:
--diff-scope=local: Scan the files you have edited, added, or staged in your working tree but not yet committed. Use this for a pre-commit review.--diff-scope=baseline: Scan the files that differ between your current checkout and the repository’s default branch. Use this to review all changes on your feature branch before you open a PR.
--diff-scope. AI SAST PR scans analyze only the changed code.
When you run a security review through the Endor Labs MCP server, the MCP tools set
--diff-scope for you based on the review type. See MCP Server.--diff-scope with --dry-run. The scan passes if it completes without warnings or errors and generates at least one AI SAST finding.