Published on: August 3, 2026

7 min read

Secure every commit to production with Claude and GitLab

Claude Security catches vulnerabilities inside a coding session. GitLab picks up from there, scanning, enforcing policy, and producing audit evidence for the software lifecycle.

Agentic coding is moving faster than many enterprise governance programs can keep up with. Coding assistants, like the Claude security guidance plugin and Claude Security, can flag and fix common vulnerabilities in code as it's written, in the same session. This is valuable for writing more secure code, but security doesn't stop there. A commit is one stage in the path to production: Merges, dependency updates, infrastructure changes, and audits happen after the session ends.

GitLab covers securing the remainder of the path to production. There are five handoffs in the typical Anthropic Claude-to-GitLab security workflow. This article walks through each one to illustrate how to govern agentic coding at scale.

Teams already using Claude security guidance and Claude Security can plug that context directly into GitLab through the GitLab MCP server and keep their existing workflow. Claude handles the moment of authoring; GitLab handles everything from there through production, on one platform.

From flagged to enforced controls

The Claude security guidance plugin reviews code within a single developer's session, catching issues fast enough to keep an agent moving. Once that code leaves a session, security teams need a record of what happened inside it and controls over what happens next.

GitLab gives teams the visibility and the control to define guardrails for secure coding, before code reaches production, no matter where the code originated.

  • Define controls once, enforce scale. Security configuration profiles apply the scans you require across every project and pipeline from outside the repository, so coverage is consistent and can't be bypassed.
  • Enforce separation of duties, even for agents. Merge request approval policies ensure that the agent that wrote a change can't approve it. An agent, or the developer who prompted it, can't merge its own work without a designated approver.
  • Block critical vulnerabilities before they ship. Merge request approval policies hold any merge with unresolved critical findings until a named approver signs off, so dismissed or missed vulnerabilities can't reach production quietly.
  • Track every finding's status, permanently. The Vulnerability report and Security dashboard show whether each finding was detected, dismissed with a reason, or resolved.

Enable scanners across every in-scope project at scale, with no way to bypass themEnable scanners across every in-scope project at scale, with no way to bypass them

From scanned in session to audit evidence

Change management audit requirements are expanding to include agents. Compliance frameworks such as SOC 2, PCI DSS, and FedRAMP require documented evidence that every change was tested, reviewed, and approved before it shipped.

GitLab makes compliance controls enforceable and evidence collection automatic for auditors:

  • Prove the scan ran and review. Compliance controls guarantee a scan runs on every merge request, and every finding surfaces in the merge request and vulnerability report, visible to a human.
  • Answer auditors in minutes. Pipeline logs, approval records, and audit events give you reproducible history of what was scanned and who approved it, change by change, tied to the people and agents involved.
  • Map evidence to the framework your auditor requests. Compliance frameworks group evidence into named requirements, such as SOC 2 or a custom framework, each built from specific controls, and the compliance status report shows which controls passed, are pending, or failed, per framework.

Audit log of agent activity, showing session-level events and start timesAudit log of agent activity, showing session-level events and start times

Control what sensitive data is sent

You probably send more of your code, and the business context around it, to a model for review than you do a person. Regulated, government, and IP-sensitive teams need to decide what leaves their environment, such as credentials, proprietary logic, and regulated data. That decision has to happen before any scan runs, and across every tool that touches their code.

With GitLab, you decide what data reaches a model before it ever leaves your environment:

  • Keep secrets and sensitive code out of what you send to a model. Context exclusions hold secrets and sensitive files back from everything an agent sends to models.
  • Keep code and inference inside your boundary, on models you approve. Run a self-managed environment with self-hosted models so nothing leaves your environment. Select the model per flow, restrict which models are permitted, and keep your code out of training.
  • Filter what gets sent. GitLab Duo's prompt guardrails scan code suggestions for secrets before they reach a model, and isolate the content a prompt can act on to reduce prompt injection risk, on top of whatever you've already excluded.

Define what files or directories should be excluded from being sent to AI modelsDefine what files or directories should be excluded from being sent to AI models

From one scan to full scanning coverage across the development lifecycle

Anthropic's documentation is explicit that the Claude security guidance plugin is a best-effort assistive tool, meant to sit alongside human code review and various security scanners, not replace them. That scoping is important to pay attention to, because some vulnerabilities don't exist at the moment code ships. A dependency you ship today can have a critical vulnerability disclosed against it next year, with no change to your own code. Log4Shell is the clearest example; applications that shipped years earlier were suddenly exploitable the moment the vulnerability became public knowledge in December 2021.

Dependencies, container images, infrastructure configuration, and secrets already sitting in your commit history need scanning that runs independently of any single session.

GitLab secures the entire software delivery lifecycle:

  • Cover the whole attack surface. Dependency, container, infrastructure-as-code, secret, and dynamic application security testing (DAST) scanning check the parts of an application a session-based review never reaches: the dependencies you pull in, the images you ship, the infrastructure you provision, the secrets that leak into commits, and the running app.
  • Catch the flaws that scanners might miss. Deterministic scanners cannot catch business logic errors, broken authorization, or race conditions. Security Review Flow reasons about intent to catch that category directly, posted as comments on the affected code for a human to act on.
  • Have a deterministic scan the results don't drift on. LLM-based review could return different findings on the same code from one run to the next. A deterministic scan, such as advanced SAST, traces tainted data across function boundaries using a fixed algorithm and returns reproducible, CWE-mapped results — the consistent evidence a compliance audit needs.

SAST, DAST, dependency, container, and secret scanning enforced to be run on the pipelineSAST, DAST, dependency, container, and secret scanning enforced to be run on the pipeline

One set of guardrails, for every agent and every developer

The Claude security guidance plugin reviews the code Claude writes and commits inside a session. Commits made from a developer's own shell, including the "!" shell escape inside a session, fall outside what the plug-in reviews. Claude Security extends that to a full codebase or human-written code, on demand, when a developer or admin runs it.

GitLab’s scan execution and merge request approval policies run on the pipeline for every change, so coverage doesn't depend on whether a human or an agent wrote the code, or whether they remembered to initiate a scan.

Configure security scans to be run on every default branchConfigure security scans to be run on every default branch

Govern what ships

Claude security guidance and Claude Security help developers catch and fix issues the moment code is written. Once that code leaves the session, enterprise security and platform teams are accountable for shipping it securely to production. They need visibility into what an agent did, proof that security procedures were followed, and the ability to stop a problematic change before it ships.

GitLab bridges your Claude workflow. Set guardrails once in GitLab, and every agent and every developer ships faster and more securely inside them. Claude helps write secure code. GitLab governs everything from there to production, without slowing teams down.

Start a free trial of GitLab Ultimate!

Already on Ultimate? Set up scan execution and merge request approval policies to start enforcing guardrails today.

Learn more

We want to hear from you

Enjoyed reading this blog post or have questions or feedback? Share your thoughts by creating a new topic in the GitLab community forum.

Share your feedback

Start building faster today

See what your team can do with the intelligent orchestration platform for DevSecOps.