Safeguard
Compliance•

How do GitLab merge request approval policies block risky merges?

GitLab approval policies require sign-off when scans find serious issues. Learn the rule types, enforce vs warn, fallback behavior and the gaps.

Safeguard Security Team
3 min read

A GitLab merge request approval policy requires extra approvals on a merge request when scan results, license findings or merge request conditions match a rule. It is evaluated after CI scan jobs finish and applies to protected target branches. It is an Ultimate tier feature.

The three rule types

RuleMatches
scan_findingFindings from SAST, secret detection, dependency scanning, container scanning, DAST and fuzzing, filtered by severity, state and attributes such as fix availability, known exploitation and EPSS score
license_findingSPDX licenses on allowed or denied lists, with optional exclusions
any_merge_requestAny merge request, or only those with unsigned commits

Dependency scanning findings can also block malicious packages. Each policy holds up to five rules.

Actions

  • require_approval sets a number of approvals from users, groups or roles, up to five such actions.
  • send_bot_message posts a comment listing violations. It is on by default.
  • approval_settings overrides project settings, for example preventing authors from approving their own change or removing approvals when new commits arrive.

Enforce or warn

In enforce mode, which is the default, a violating merge request is blocked until approved. In warn mode it can proceed with warnings, and users can bypass by giving a reason that is audited. Warn mode is a good first step while a team learns what the gate catches.

What happens when a scan is missing

This is where gates quietly fail. Every scanner named in a rule must produce a report on both the source and target branches. Missing reports, or failed or cancelled scan jobs without reports, typically require approval. The fallback_behavior setting decides what happens when rules cannot be evaluated: closed, the default, requires approval, and open does not.

Limits to know

  • Manual jobs are ignored until they run.
  • Policies do not verify the integrity or authenticity of scan artifacts.
  • You get up to five policies per security policy project.
  • Changing a vulnerability state does not re-evaluate until a pipeline reruns or the merge request updates.
  • Group level policies can take minutes to propagate in large groups.

A cautious rollout

  1. Pair the policy with a scan execution policy so scans always run.
  2. Start with critical severity and fixes available, then widen.
  3. Use warn mode for two weeks and count how often it fires.
  4. Define bypass for service accounts and emergency fixes, with an audit review.
  5. Switch to enforce.

Where a dedicated scanner fits

If you want one gate rule that applies across hosts, or want exploitability and reachability to inform the decision, a separate platform can add that. Safeguard supports policies, gates and reachability analysis, with a free scan at gold.safeguard.sh/scan.

Try it yourself

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

Change the finding severity and see when the gate flips from pass to blocked.

Quick check

What happens if a required scan fails?

By default the fallback is closed, so approval is typically required when a report is missing.

Do approval policies cover every branch?

No. They apply to protected target branches.

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.