Safeguard
Compliance•

GitLab security policies: what is the difference between the types?

GitLab has scan execution, merge request approval, pipeline execution and vulnerability management policies. Learn what each does and how they are stored.

Safeguard Security Team
3 min read

GitLab security policies come in four types. Scan execution policies force scans to run. Merge request approval policies require approvals based on scan results. Pipeline execution policies enforce CI jobs. Vulnerability management policies auto-resolve findings that are no longer detected. All require Ultimate.

The four types

Policy typeWhat it enforcesTypical use
Scan executionSecurity scans run in pipelines or on a scheduleMake sure every project is scanned
Merge request approvalApproval rules and project settings based on scan resultsBlock risky merges until reviewed
Pipeline executionSpecific CI/CD jobs in project pipelines, including scheduled onesRequired build or compliance steps
Vulnerability managementAuto-resolves vulnerabilities no longer detected on the default branchKeep the report clean

The GitLab page lists Ultimate as the tier, on GitLab.com, Self-Managed and Dedicated.

Why teams get confused

Scan execution says "run the scanner." Approval policy says "if the scanner found this, a human must approve." They work together, but they are separate. If a scan never runs, an approval policy has nothing to evaluate, so a missing scan can quietly weaken your gate. Pairing the two is the usual fix.

Scoping

A policy can be limited with policy_scope to groups, projects, compliance frameworks or security attributes such as business impact and exposure. The match_mode setting controls whether all conditions or any condition must match. An empty collection is treated as if the field were omitted, so the policy applies to everything. To switch a policy off, set enabled to false.

How policies are stored

Policies live in .gitlab/security-policies/policy.yml in a security policy project. Changes sync only when a merge request is merged into that project, so direct commits to its default branch are not synced. To enforce a policy project on a group or project you need the Owner role, or a custom role with the manage_security_policy_link permission.

One trap: avoid linking one security policy project to both a development project and its parent group. The documentation says that prevents merge request approval rules from applying to that project.

A sensible first policy set

  1. A scan execution policy that runs secret detection and dependency scanning on all projects.
  2. A merge request approval policy that requires security review for critical findings on protected branches.
  3. Warn mode first if your teams are new to gates, then enforce.
  4. A named owner for the policy project and a review cycle.

Where a dedicated scanner fits

If you need the same gates across repositories on more than one host, or want guardrails for AI coding agents next to your merge rules, a separate platform can carry that. Safeguard provides policies, gates and guardrails, plus the MCP Guardrail, and a free scan at gold.safeguard.sh/scan.

Try it yourself

Click through it at your own pace, or open it full screen.

Watch what a gate decides on a pull request and which finding triggers it.

Quick check

Do approval policies run the scans themselves?

No. They evaluate results after CI scan jobs complete. Use a scan execution policy to make sure the scans run.

Where are GitLab security policies defined?

In a file named policy.yml under .gitlab/security-policies in a security policy project.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.