Reused runners can preserve tokens, local files, and hidden state between executions, which gives an attacker a place to persist. The risk is highest when the runner can reach internal systems or execute workflows from untrusted contributors.
Why This Matters for Security Teams
Reusing self-hosted runners turns a supposedly disposable execution environment into a shared trust boundary. That matters because runners frequently process secrets, temporary tokens, build artifacts, and source code from different projects, so any residual state can cross job boundaries. NIST Cybersecurity Framework 2.0 makes clear that identity, access, and recoverability all depend on controlling system state, not just user logins.
For NHI and CI/CD governance, the problem is not only leakage of files. A reused runner can retain shell history, environment variables, cached dependencies, credentials in memory, or tool configuration that changes how the next job behaves. This is why NHI Mgmt Group highlights the prevalence of secret sprawl in CI/CD systems in the Ultimate Guide to NHIs, especially where teams assume the runner resets itself between workflows.
In practice, many security teams encounter runner reuse as an incident response problem only after a later job inherits access it should never have had, rather than through intentional isolation design.
How It Works in Practice
Self-hosted runners are most dangerous when their lifecycle is longer than a single job. The runner process may persist on the host, the workspace may remain on disk, and background services or local caches may survive across executions. If one workflow handles untrusted pull requests and the next workflow deploys to production, the second job may inherit state from the first unless the environment is aggressively reset.
Good practice is to treat each job as a fresh trust decision. That usually means ephemeral runners, per-job teardown, and strict scoping of credentials so that secrets are issued only for the exact task and revoked immediately after use. The NIST Cybersecurity Framework 2.0 reinforces the need to protect assets across their full lifecycle, which in this case includes the runner itself, not just the code it executes.
- Use disposable runners or immutable images rather than long-lived hosts.
- Clear workspaces, caches, and temp directories between jobs.
- Prevent untrusted jobs from sharing the same machine as privileged deployments.
- Issue short-lived tokens per workflow and revoke them on completion.
- Assume logs, artifact stores, and dependency caches can also become persistence layers.
This is where the Ultimate Guide to NHIs is especially relevant: runners are effectively non-human workloads with credentials, privilege boundaries, and offboarding requirements, not just build infrastructure.
These controls tend to break down when organisations reuse a single runner pool for both untrusted contribution builds and production release jobs because the trust level of each workflow is no longer aligned with the host state.
Common Variations and Edge Cases
Tighter runner isolation often increases operational overhead, requiring organisations to balance security against build latency, cost, and maintenance complexity. That tradeoff becomes more visible in high-volume pipelines, but current guidance suggests it is still preferable to residual trust in shared hosts.
There is no universal standard for every CI/CD design, yet a few edge cases come up repeatedly. Some teams rely on containerized jobs and assume that is enough, but containers do not fully remove host-level persistence if the runner daemon, mounted volumes, or shared caches remain. Others keep long-lived runners for performance and try to compensate with cleanup scripts, but cleanup is weaker than actual teardown because hidden state can survive in places the script never touches.
The highest-risk pattern is mixed-trust execution: forks, external contributions, and internal deployment workflows running on the same runner fleet. In those environments, a compromised low-privilege job can seed later high-privilege execution through files, environment residue, or altered tooling. NHI Mgmt Group’s Ultimate Guide to NHIs shows how often organisations underestimate secret exposure in CI/CD, and that risk is amplified when runner reuse is paired with broad network reach.
The practical rule is simple: if a runner can touch sensitive systems, it should be treated as single-use or fully re-imaged before the next job.
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 address the attack and risk surface, while NIST CSF 2.0 and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-05 | Runner reuse can preserve and expose NHI secrets across jobs. |
| NIST CSF 2.0 | PR.AC-4 | Shared runners weaken access control and trust boundaries between jobs. |
| NIST AI RMF | Reusable runners create lifecycle and accountability risk in automated pipelines. |
Define ownership, monitoring, and teardown for each runner as a governed AI or automation asset.
Related resources from NHI Mgmt Group
- What breaks when SSO trust is too permissive across identity providers?
- What breaks when service account credentials are reused across cloud services?
- What breaks when service accounts are reused across pipeline environments?
- What breaks when self-service password reset does not propagate across hybrid IAM systems?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on June 11, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org