Runners and Build Agents are the machines or containers that execute CI/CD pipeline jobs, such as compiling code, running tests and deploying. They hold or receive secrets and cloud credentials, so attackers target them to steal tokens or tamper with builds. Use ephemeral, isolated instances, least-privilege credentials, and keep untrusted code off shared self-hosted runners.
What runners and build agents are
Runners and build agents are the execution layer of a CI/CD system. They pick up pipeline jobs, run builds and tests, and often touch deployment steps, so they sit close to source code, artifacts and release credentials. Their main security value comes from how tightly their runtime, network and permissions are constrained.
Why they are a high-value trust boundary
These systems are attractive because they often have access to signing material, deployment tokens, package registries and cloud APIs. If an attacker can tamper with the runner or the job context, they may alter build outputs, leak secrets or inject malicious changes into software delivery. That makes the runner boundary part of the software supply chain, not just an infrastructure detail.
On self-hosted runners, the trust boundary is especially important because the machine may execute code from many repositories or branches. Shared or persistent runners can carry residue between jobs, which increases the chance that one workflow can observe another workflow’s files, environment variables or cached credentials.
How exposure usually happens
Exposure is usually created by overbroad job permissions, long-lived credentials, weak isolation between jobs, or allowing untrusted pull request code to execute on the same runner pool as trusted pipelines. Misconfigured logs and caches can also turn a routine job into a secret disclosure event. The practical question is not just whether the runner is reachable, but whether the job can reach anything it should not.
Risk also increases when organisations treat runner configuration as disposable while leaving the attached credentials and network access persistent. A compromised build agent can become a bridge into signing systems, source control, artifact repositories or cloud workloads if those links are not deliberately narrowed.
What good operational design looks like
Good design separates untrusted execution from privileged release paths. Ephemeral runners, isolated job sandboxes, minimal network reachability and narrowly scoped credentials reduce the blast radius when a workflow is compromised. Least privilege matters here in a very literal sense: the runner should only be able to perform the pipeline task it is assigned.
For teams using hosted or self-hosted runners, the control objective is to make each job disposable, observable and revocable. That usually means rebuilding instead of reusing instances, keeping secrets out of broad environment scope, and making sure deployment credentials are issued only where they are needed.
Risk and Threat Considerations
Runners and build agents are prime targets because compromise can turn ordinary CI/CD activity into code theft, secret theft or release tampering. Attackers often aim for the job context, cached credentials or artifact path rather than the application itself, because those paths can expose broad access with little friction.
Failure mechanism: Persistent or overprivileged runners let attacker-controlled pipeline code read secrets, alter build steps, poison artifacts or pivot into connected systems through trusted tokens and network access.
Impact: The result can be malicious builds, exposed credentials, compromised deployment infrastructure and downstream supply-chain trust loss across every system that consumes the pipeline output.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while CIS Controls v8, NIST SP 800-53 Rev 5 and SLSA set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| CIS Controls v8 | CIS-5 — Account Management | Runners depend on tightly scoped accounts and credentials. |
| Recommendation — Restrict runner accounts to the minimum access needed for each pipeline job. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Build agents rely on managed tokens, keys and other job credentials. |
| AC-6 — Least Privilege | Runner permissions should be constrained to the exact pipeline task. | |
| Recommendation — Rotate and protect runner credentials with short lifetimes and controlled storage. Limit each build agent to only the resources required for its assigned workflow. | ||
| SLSA | Build Provenance | Runners are part of the build path that must preserve artifact integrity. |
| Recommendation — Use SLSA-aligned build isolation and provenance controls for pipeline execution. | ||
| OWASP Non-Human Identity Top 10 | NHI-05 — Overprivileged NHI | Build agents often use machine credentials that can be overprivileged. |
| Recommendation — Reduce build-agent permissions so stolen pipeline credentials cannot be reused broadly. | ||
Practitioner Guidance
Why practitioners should care: The runner is often the last place where source, secrets and release authority meet, so its compromise can undermine the integrity of the whole delivery process. Treat runner design as a release-control decision, not just an infrastructure choice.
Common misunderstanding: A secure CI/CD server does not make unsafe runners safe. If job execution, secret access and network reach are too broad, the build tier can still be the easiest place to steal credentials or tamper with artifacts.
Practitioner takeaway: Design runner pools so untrusted jobs execute on short-lived, tightly isolated instances with minimal permissions, and reserve privileged deployment paths for separate, explicitly controlled execution contexts.
Related resources from NHI Mgmt Group
- Guide: CI/CD server migration playbook
- How should security teams govern developer agents that can act across code, build, and deployment systems?
- How should security teams build identity governance across humans, machines, and AI agents?
- How should security teams build a current inventory for AI models and agents?
- What should organisations do when AI agents and build tools have access to code, secrets, and deployments?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 26, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org