Secure software factory: Build trust from code to release
A secure software factory protects the systems and workflows that turn source code, dependencies, and build instructions into software people can trust. It combines controls for identity, access, build environments, verification, release integrity, and response, so teams can show what happened and what actually shipped.
A secure software factory is a software delivery environment designed to protect the integrity and confidentiality of software as it is planned, built, tested, packaged, and released. It's not one product or one security scan. It's a way to govern the path from source to production, including the people, services, automation, and AI agents that can change software along the way. Controls apply across the workflow, not just to the source repository or the final artifact.
A practical model answers these questions:
- Who or what can act? Every person, service, and agent has a known identity, an accountable owner, and access limited to its task.
- Where does work run? Builds and agent tasks run in environments with boundaries around files, credentials, tools, and network access.
- How is a change checked? Required security and quality checks are enforced independently of the actor making the change.
- Can you prove what was released? Build inputs and outputs are traceable, and the deployed artifact is the one that passed verification.
- Can you respond when something goes wrong? Teams can stop activity, revoke access, trace affected changes, and verify remediation.
These controls work together. A signed artifact is less useful if its build identity is unknown; an audit record is less useful if it can be changed by the actor it is meant to monitor. The objective is not to collect more security tools, but to make the controls and evidence connect across the delivery path.
Software depends on more than application code. A release can be affected by source repositories, third-party packages, build tools, CI/CD runners, credentials, container images, registries, and deployment systems. If an attacker can change the build or its inputs, a clean source review alone may not establish that the released artifact is trustworthy.
This is also why build and release infrastructure needs its own protection. A compromised dependency, exposed credential, or untrusted build process can affect multiple projects or customers. For organizations that distribute software for others to run, evidence of how a release was produced can help customers assess its integrity and investigate concerns.
AI agents add another kind of actor to the workflow. An agent may read files, call tools, use credentials, install packages, or propose changes. Its permissions should be set by policy and enforced by the environment, not inferred from what the agent says it intends to do.
Start with a foundation of policy, audit, and ownership. Define the rules before work runs, record consequential actions, and assign a human owner for the systems and controls involved. From that foundation, apply controls at each stage of the lifecycle.
The GitLab Security Standard organizes its guidance into five stages: Authorize, Isolate, Verify, Release, and Respond. This is GitLab's framework for hardening a software factory and earning agent autonomy; it is not a universal certification or a substitute for an organization's own risk assessment.
Authorize: Control who and what can act
Inventory the people, agents, services, and integrations that can access software systems. Give each an identifiable owner and the minimum access needed for its task. Scope credentials, limit their lifetime, and define how to revoke them.
For higher-risk operations, require an approval boundary that is attributable to a person. A task description or agent plan should not itself grant additional permissions.
Isolate: Contain execution and inputs
Run builds and agent tasks with boundaries that limit access to files, secrets, tools, and network destinations. Use approved dependencies and tools, and avoid giving an execution environment broader access than the task requires.
Isolation reduces the reach of a compromised dependency, malicious instruction, or unexpected agent action. It should be enforced by the runtime or platform, rather than depending on the agent to follow instructions.
Verify: Check changes with independent controls
Apply required tests, security checks, and policy rules to both human- and agent-authored changes. Protect the checks themselves so the actor being evaluated cannot silently change or bypass them.
Verification should cover the change and the build inputs that matter to its risk. Record the result and make it clear which checks passed before the change can advance.
Release: Prove what reaches production
Connect a release to its source, dependencies, build process, and verification evidence. Sign or attest artifacts where appropriate, and verify the exact artifact being deployed—not just a mutable name or tag.
This creates a traceable chain from approved inputs to the software that runs. A signature or attestation only provides assurance when the identity behind it is trusted and the evidence is checked before release.
Respond: Stop, trace, and recover
Make it possible to stop a workflow, revoke an agent or service's access, and identify the changes or releases it touched. When a finding is confirmed, track remediation through to a fix that has been verified in the relevant environment.
Time to containment and time to verified remediation are measures for this response loop. Teams should define the start and end events consistently and interpret results by severity and context.
Treat an agent as a software actor with its own identity, permissions, tools, and audit trail. Apply the same basic discipline used for other privileged systems, with additional attention to how agent tasks can interact with source, credentials, external tools, and production workflows.
A starting checklist:
- Give each agent or workflow an identity that can be traced to an owner and the person or process that initiated it.
- Scope access to the task; use short-lived, revocable credentials instead of broad, persistent developer credentials.
- Restrict which files, tools, packages, and network destinations the agent can reach.
- Run tasks in an isolated environment, especially when inputs or tools are untrusted.
- Enforce scans, approval rules, and deployment policies outside the agent's control.
- Record tool use and consequential actions, and test the ability to stop a task and revoke access.
- Expand autonomy only when the workflow has demonstrated that its controls work.
Autonomy can be staged. For example, an agent might first suggest a change, then propose a merge request for human approval, and only later act within tested guardrails. Different workflows can be at different stages; a low-risk dependency update and a production infrastructure change should not automatically receive the same authority.
Provenance describes how an artifact was produced: its source, build inputs, process, and related evidence. Signing and attestation can help bind that information to a specific artifact. An SBOM describes software components and dependencies. Audit records capture actions and decisions across the workflow.
These are related but distinct forms of evidence. None alone proves that software is safe. Together, and when verified against the artifact that ships, they can help answer practical questions: What went into this release? Which process built it? Which checks passed? Who or what approved it? Is the production artifact the one that was verified?
Keep evidence useful by linking it to the relevant source, build, task, and release. Define who can create, view, and change records, and retain enough information for incident response and customer or auditor review.
Start by mapping the actual workflow, including manual steps, local tools, agent tasks, and deployment paths. Identify where identities, controls, and evidence are missing. Then choose a small set of measures tied to the risks you want to reduce.
Examples include:
- Share of software workflows and agents with an assigned identity and owner.
- Share of builds running in the defined isolated environment.
- Share of releases with provenance or attestation that is verified before deployment.
- Time to contain a confirmed security issue.
- Time from detection to verified remediation.
- Number of unauthorized actions or policy violations detected, blocked, and investigated.
These are suggested operational indicators, not a universal scorecard. Define the denominator, event boundaries, severity categories, and reporting period before comparing results. A rising number of detected events might mean coverage improved, risk increased, or both; interpret the metric with its context.
GitLab's Security Standard emphasizes earning autonomy as controls are proven, rather than granting it all at once. Use evidence from each workflow to decide whether to maintain, restrict, or expand its level of automation.
You do not need to replace every tool before improving security. Begin with the delivery path you have and close the most consequential gaps in order.
- Map the workflow. Trace source, dependencies, credentials, build systems, artifact storage, approvals, and deployment paths. Include agent and local workflows, not only the central CI pipeline.
- Assign identities and owners. Inventory humans, machines, agents, and integrations. Identify who is accountable and remove access that is broader or longer-lived than needed.
- Set policy and boundaries. Define permitted tools, dependencies, network access, and actions that require human approval. Enforce the rules where work runs.
- Isolate build and agent execution. Restrict the environment's access to files, credentials, and external systems. Make boundaries resilient to untrusted inputs.
- Verify changes and inputs. Require appropriate tests, security checks, and protected approvals. Make sure the author cannot modify the controls that evaluate the change.
- Bind releases to evidence. Capture relevant source and build information, protect artifacts from substitution, and verify the artifact before deployment.
- Practice response. Test stopping tasks, revoking credentials, tracing affected outputs, and confirming remediation.
- Review and improve. Look for gaps in coverage, response delays, and repeated bypasses. Expand automation only when evidence supports it.
GitLab's public Software Supply Chain Security page describes capabilities for controlling access, enforcing policy, scanning source and dependencies, isolating builds, and capturing artifact evidence. GitLab's guidance on securing the software factory emphasizes putting security and governance in the execution path and measuring the time from detection to verified remediation.
The right controls depend on your architecture and risk. Start with the systems that can change what you build or release, make their actions attributable, and verify that the evidence connects to what reaches production.
Frequently Asked Questions
Frequently Asked Questions
No. It is an architecture and set of operating practices for protecting software production from source and dependencies through build, verification, and release. Products can help implement parts of it, but the outcome depends on how the controls work together in your environment.
Software supply-chain security focuses on protecting the components, identities, processes, and artifacts involved in producing and delivering software. A secure software factory is the broader operating environment in which those controls are applied across the workflow.
Give agents explicit identities, scoped and revocable access, approved tools, and isolated execution environments. Enforce policy and verification outside the agent, record consequential actions, and require approval for higher-risk operations.
Provenance records how software was built, including relevant source and build inputs. An attestation is a verifiable statement about an artifact or process. Verify that the evidence refers to the exact artifact being released; the presence of a record alone is not proof that it is trustworthy.
Map the current path from source to production, identify the highest-risk access or build boundaries, and add controls in stages. Begin with clear ownership, scoped credentials, protected checks, and release evidence, then expand coverage as the workflow proves reliable.
Start building faster today
Start building faster today
See what your team can do with the intelligent orchestration platform for DevSecOps.