Skip to content
GitLab SAST

GitLab SAST

Category: SAST
License: Included with GitLab (Free tier: limited, Premium/Ultimate: full features)
Suphi Cankurt
Suphi Cankurt
+7 Years in AppSec
Updated February 12, 2026
6 min read
Key Takeaways
  • GitLab SAST runs automatically on every commit in CI/CD pipelines with zero external tool configuration required.
  • Advanced SAST uses multi-core scanning enabled by default, with AI-powered false positive detection on Ultimate with GitLab Duo.
  • Diff-based scanning analyzes only changed code in merge requests for faster feedback during code review.
  • Built on industry-standard analyzers like Semgrep, with automatic merge request generation for vulnerability fixes on Ultimate tier.

GitLab SAST provides built-in static application security testing for GitLab repositories. Unlike external SAST tools that require integration, GitLab SAST runs automatically in your CI/CD pipelines with minimal configuration.

For teams already using GitLab, SAST offers a zero-friction security scanning solution with AI-powered features in Ultimate tier.

What is GitLab SAST?

GitLab SAST scans source code for security vulnerabilities on every commit. According to GitLab’s DevSecOps surveys, organizations that shift security left by integrating scanning into CI/CD pipelines detect vulnerabilities significantly earlier in the development lifecycle.

The system uses analyzer containers โ€” Docker images that wrap third-party scanners like Semgrep โ€” to detect issues across multiple programming languages.

When a scan completes, GitLab displays findings directly in merge requests, security dashboards, and vulnerability reports. Developers see security issues alongside other code review feedback without switching tools or platforms.

GitLab Advanced SAST represents the next generation of GitLab’s scanning technology. It provides faster scanning with multi-core support, more accurate detection, and is gradually replacing the legacy Semgrep-based analyzers for all supported languages.

Zero-Config Scanning
Enable SAST by including a template in .gitlab-ci.ymlโ€”no external tools, API keys, or complex configuration required
AI False Positive Detection
GitLab Duo automatically identifies likely false positives in Critical and High severity findings (Ultimate tier)
Automated Fix Generation
Agentic SAST creates merge requests with context-aware code fixes for High and Critical vulnerabilities (Ultimate tier)

Key features

FeatureDetails
Languages (Advanced SAST)C, C++, C#, Go, Java, JavaScript, Python, Ruby, TypeScript
Languages (Standard)Apex, Elixir, Groovy, Kotlin, Objective-C, PHP, Scala, Swift
AnalyzersAdvanced SAST, Semgrep, SpotBugs, Kubesec, PMD Apex, Sobelow
CI templateinclude: template: Jobs/SAST.gitlab-ci.yml
Default excluded pathsspec, test, tests, tmp
Search depth20 (Semgrep), 4 (others)
Runner requirementLinux (Docker or Kubernetes executor, amd64 only)
FIPS supportAvailable via -fips image suffix

Automatic scanning on every commit

GitLab SAST merge request widget showing scan findings

Add GitLab SAST to your project by including the SAST.gitlab-ci.yml template in your .gitlab-ci.yml file. GitLab automatically runs scans on every commit and merge request.

The scanner detects which languages exist in your repository and runs the appropriate analyzers. You don’t configure language-specific settings.

Tier-based feature availability

FeatureFreePremiumUltimate
Basic SAST scanningYesYesYes
JSON report downloadYesYesYes
Advanced SAST engineNoNoYes
MR widget with findingsNoNoYes
Vulnerability managementNoNoYes
Ruleset customizationNoNoYes
AI false positive detectionNoNoYes (Duo add-on)
Agentic fix generationNoNoYes (Duo add-on)

GitLab Advanced SAST

Advanced SAST is GitLab’s proprietary scanning engine with multi-core scanning enabled by default. Enable it with GITLAB_ADVANCED_SAST_ENABLED: "true" in your CI variables.

It currently supports C, C++, C#, Go, Java, JavaScript, Python, Ruby, and TypeScript. Other languages fall back to the Semgrep-based analyzer.

GitLab Advanced SAST CI configuration and pipeline output showing 4-core scan across 1247 files with 2 Critical and 5 High findings

AI-powered false positive detection

For Ultimate tier users with the GitLab Duo add-on, AI analyzes Critical and High severity SAST vulnerabilities to flag likely false positives. Each finding gets a confidence score and explanation, reducing manual triage time.

GitLab Duo AI false positive analysis showing confidence scores for Critical and High findings with explanations

Agentic SAST vulnerability resolution

Also in Ultimate tier with GitLab Duo, agentic SAST automatically generates merge requests that fix High and Critical severity vulnerabilities. The AI uses multi-shot reasoning to understand code context and create fixes that preserve functionality.

GitLab SAST inline vulnerability indicator in merge request diff view

Vulnerability tracking

GitLab vulnerability report showing project security findings

GitLab tracks vulnerabilities across refactoring. If code moves to a different file or line, the vulnerability follows it rather than creating a duplicate. Vulnerabilities also auto-resolve when their associated rules are disabled.

Note: GitLab SAST runs in air-gapped environments with locally-mirrored analyzer images. Configure SECURE_ANALYZERS_PREFIX to point to your internal registry.

Getting started

1
Enable SAST โ€” Add include: - template: Jobs/SAST.gitlab-ci.yml to your .gitlab-ci.yml. Make sure you have a test stage defined.
2
Push a commit โ€” GitLab detects your project languages and runs the right analyzers automatically. No API keys or external tools needed.
3
Review findings โ€” View results in the pipeline Security tab, merge request widget (Ultimate), or download the JSON report artifact.
4
Customize rules โ€” Exclude paths with SAST_EXCLUDED_PATHS, pin analyzer versions with SAST_ANALYZER_IMAGE_TAG, or enable Advanced SAST with GITLAB_ADVANCED_SAST_ENABLED.

GitLab SAST configuration

Most teams adopt GitLab SAST through the CI template. Add a single line to .gitlab-ci.yml and SAST runs on every pipeline:

include:
  - template: Jobs/SAST.gitlab-ci.yml

The template registers analyzer jobs for every language GitLab detects in the repository. You don’t pick analyzers manually โ€” the framework chooses them. Override behavior with CI variables: set SAST_EXCLUDED_PATHS to skip generated code, SAST_EXCLUDED_ANALYZERS to drop a specific scanner (e.g. spotbugs if Java byte-code uploads are restricted), or SECURE_ANALYZERS_PREFIX to pull analyzer images from an air-gapped registry.

For Java projects you can force Semgrep instead of SpotBugs by excluding the byte-code analyzer:

variables:
  SAST_EXCLUDED_ANALYZERS: "spotbugs"

The two configuration models matter for buyer comparisons. The vendored model ships analyzer images alongside the GitLab Runner โ€” convenient and air-gap-friendly, but version pinning lags upstream. The CI-templated model pulls analyzer images at job time from registry.gitlab.com/security-products, which keeps rule packs current at the cost of egress to GitLab’s registry. Most regulated environments mirror the analyzer images locally and pin tags via SAST_ANALYZER_IMAGE_TAG.

GitLab SAST pricing

GitLab publishes list pricing on about.gitlab.com/pricing, so the SAST tier mapping is straightforward to verify before procurement:

  • Free โ€” Semgrep-based SAST scanning runs on every pipeline, with the JSON report artifact available for download. Findings do not appear in the merge request widget or vulnerability dashboard.
  • Premium ($29/user/month at list price) โ€” adds CI/CD compliance dashboards and team-level controls, but the SAST feature set is broadly the same as Free; the Vulnerability Report and MR widget remain Ultimate-only.
  • Ultimate ($99/user/month at list price) โ€” unlocks the Advanced SAST engine, MR widget integration, the Vulnerability Report, ruleset customization, and the GitLab Duo add-on (AI false-positive triage and agentic vulnerability fix generation).

Verify the current per-user/month figure on the GitLab pricing page before committing โ€” list prices update periodically and discounted multi-year contracts are common at the Ultimate tier.

GitLab SAST alternatives

For teams comparing platform-native SAST options or evaluating standalone scanners alongside GitLab, the closest substitutes are:

  • GitHub Advanced Security with CodeQL โ€” query-based SAST built into GitHub Enterprise; preferred when the codebase already lives on GitHub and a single vendor is the goal.
  • Bitbucket Pipelines + Semgrep โ€” works for teams committed to Bitbucket; Semgrep CE provides the analyzer and Bitbucket runs it as a pipeline step.
  • Snyk Code โ€” commercial SAST with the DeepCode AI engine that integrates as a CI job in any platform; chosen when developer-first UX and free-tier access matter more than platform consolidation.
  • Checkmarx One โ€” enterprise SAST with broader language coverage and on-prem/air-gapped deployment; a fit when governance, compliance reporting, and a 35+ language matrix are required.

Browse the SAST tools hub for the full active set.

When to use GitLab SAST

GitLab SAST is the obvious choice if you’re already on GitLab and want security scanning without adding external tools. The zero-config setup means you can go from nothing to scanning in a single commit.

The real value shows up at the Ultimate tier with GitLab Duo, where AI triage and automatic fix generation cut manual work significantly. Free tier users still get basic scanning and JSON reports, but miss the MR integration and vulnerability management features.

For more customizable scanning outside GitLab, standalone tools like Semgrep or Snyk Code work with any CI/CD system. See our what is SAST guide for a broader overview of static analysis testing.

Frequently Asked Questions

What is GitLab SAST?
GitLab SAST is built-in static application security testing that runs automatically in GitLab CI/CD pipelines. It scans source code for vulnerabilities on every commit, displays findings in merge requests and security dashboards, and requires no external tool setup or configuration.
What's the difference between GitLab Free and Ultimate SAST features?
GitLab Free includes basic SAST scanning with manual review of findings. Premium adds security dashboards and team features. Ultimate adds AI-powered false positive detection, automatic vulnerability fix generation via merge requests, and GitLab Duo AI features. Advanced SAST with multi-core scanning is available in all tiers.
How does GitLab SAST compare to standalone tools like Semgrep or Snyk Code?
GitLab SAST uses Semgrep CE and other open-source scanners as underlying analyzers, providing comparable detection. The advantage is zero configuration and native integration with GitLab workflows. Standalone tools offer more customization, broader language support, and work with any CI/CD system.
Does GitLab SAST slow down CI pipelines?
GitLab SAST uses diff-based scanning to analyze only changed files in merge requests, reducing scan time. Multi-core scanning (enabled by default in Advanced SAST) further improves performance. Incremental scanning to skip unchanged code is on the 2026 roadmap for additional speedup.