Join our Newsletter — 33% off our NHI Course
Home› Glossary› Architecture & Implementation› Self-Hosted CI/CD Runner
Architecture & Implementation

Self-Hosted CI/CD Runner

← Back to Glossary
By NHI Mgmt Group Updated November 26, 2026 Domain: Architecture & Implementation

A build agent that an organisation runs on its own infrastructure to execute CI/CD pipeline jobs, rather than using the provider's hosted runners. Because jobs run code from repositories, a malicious pull request or compromised workflow can reach the runner's network and any secrets present. Defenders isolate runners, use ephemeral instances and restrict which repositories may use them.

What Self-Hosted CI/CD Runners Are

A self-hosted CI/CD runner is your own build agent, so the organisation controls the machine, operating system, network reach, installed tooling and runtime persistence. That extra control is useful for private infrastructure, custom tooling and tighter isolation boundaries, but it also means the runner becomes part of the trust zone that executes untrusted or semi-trusted pipeline code.

Unlike a provider-hosted runner, a self-hosted runner is not just a disposable execution slot. It is an asset that can hold cached files, local credentials, environment variables and network paths to internal systems, which is why runner placement and lifecycle decisions matter as much as pipeline syntax.

Why They Are Attractive to Attackers

Runner compromise is valuable because it can turn a routine build job into a foothold inside the organisation’s environment. If a malicious pull request, poisoned dependency or compromised workflow reaches the runner, the attacker may be able to steal secrets, alter build outputs, pivot into reachable services or abuse the runner’s identity and network permissions.

This is why CI/CD compromise is often treated as a supply-chain problem rather than a simple build failure. Cases such as the Shai Hulud npm malware campaign and reviewdog Action compromise 2025 show how pipeline trust can be turned into broad secret exposure and downstream abuse.

Core Security Properties of a Safe Runner Design

A secure self-hosted runner should be treated as a high-risk execution boundary, not a general-purpose server. The main properties that matter are isolation between jobs, minimal persistence between runs, restricted outbound and lateral network access, and tight control over which repositories or workflows may target the runner pool.

Ephemeral runners reduce the chance that secrets, artifacts or malware survive from one job to the next. Network segmentation limits what a compromised job can see, while registration and runner-group restrictions reduce the blast radius if a runner is misused or if an attacker can submit workflow changes.

Those controls are especially important because many CI/CD attacks depend on the runner being able to reach things it should not, such as internal APIs, package registries, artifact stores or cloud metadata services. The runner’s usefulness comes from access, and that same access is what turns it into a high-value target.

Exposure Checks and Compromise Review

To understand exposure, organisations need an inventory of which repositories can schedule jobs onto which runners, what network segments those runners can reach, and which secrets or tokens are available inside the job environment. Review is not just about the runner host itself, but also about the workflows, branches, events and third-party actions that can cause code to execute there.

If a runner is suspected of compromise, the post-incident review should assume local state may be untrusted. That means checking for secret exposure, credential use, unexpected outbound connections, modified build artifacts and any signs that the runner accessed systems beyond its intended role. The practical lesson from pipeline compromise cases is that compromise often affects both the build system and the secrets that pass through it.

For broader attack-path context, the MITRE ATT&CK view of T1677 Poisoned Pipeline Execution is useful when you need to map how untrusted build steps become a compromise path rather than a standalone bug.

Practical Hardening Patterns

Runner hardening is mostly about reducing what a successful job can touch. Keep runners isolated from sensitive internal services unless that access is explicitly required, prefer short-lived instances, and avoid sharing runners across unrelated repositories or trust levels. Where possible, use separate runner pools for privileged builds, external contributions and protected release workflows.

It also helps to align runner design with the broader CI/CD trust model. The Self-hosted CI/CD Runners and Build Agents guide covers single-use runners, registration credentials and monitoring, while OWASP CICD-SEC-4 Poisoned Pipeline Execution explains why forked builds, privileged triggers and workflow isolation need separate treatment.

Where the runner is part of a GitHub-based workflow, hardening should extend to token scope, action pinning and workflow trust boundaries. The GitHub and GitHub Actions Security Guide and Top 10 GitHub Actions Security Mistakes are useful because many runner failures are really workflow-authorisation failures expressed at the build layer.

Risk and Threat Considerations

Self-hosted runners concentrate risk because they combine code execution, network reach and secret access in one place. If a pipeline accepts untrusted input, an attacker may use the runner as a bridge to internal systems, secret stores or signing workflows, which turns a build compromise into a broader environment compromise.

Failure mechanism: malicious workflow content, poisoned dependencies or compromised actions can execute inside a runner that has more reach or more secrets than the job truly needs, then exfiltrate material or pivot into adjacent systems.

Impact: exposed credentials, altered build outputs, release tampering, internal network reconnaissance and follow-on compromise of downstream systems that trust the pipeline.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while SLSA, NIST SP 800-53 Rev 5 and OWASP ASVS set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
SLSASupply-chain Levels for Software ArtifactsRunner trust directly affects build provenance and artifact integrity.
Recommendation — Use SLSA to strengthen build provenance and reduce the impact of runner compromise.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementRunner jobs often depend on secrets and tokens that need lifecycle control.
AC-6 — Least PrivilegeRunner access should be constrained to the minimum repositories, networks and services required.
Recommendation — Manage runner credentials as short-lived authenticators and revoke them quickly after use. Apply least privilege to runner permissions, network reach and repository access.
MITRE ATT&CKT1677 — Poisoned Pipeline ExecutionSelf-hosted runners are a common execution point for poisoned pipeline activity.
Recommendation — Map suspicious pipeline behaviour to T1677 and hunt for untrusted job execution paths.
OWASP ASVSV15 — Secure Coding and ArchitecturePipeline trust boundaries and build execution paths are an architecture concern.
Recommendation — Design CI/CD execution so untrusted code cannot reach privileged build resources.

Practitioner Guidance

Why practitioners should care: the key design decision is not whether to use self-hosted runners, but what trust boundary they create. Treat each runner pool as a policy decision about code provenance, network access and secret exposure, then separate low-trust and high-trust workloads accordingly.

What to watch for: runners that persist across jobs, share across unrelated repositories, or can reach internal services without a clear business need. Those are the places where a single workflow mistake turns into a broader security incident.

Practitioner takeaway: the safest runner is the one that is short-lived, narrowly scoped and easiest to rebuild after compromise.

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.

NHIMG Editorial Note
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