CI runner security: a practical guide
A CI runner runs code from your repository with access to your secrets, so it is part of your software supply chain. The essentials: give every job a fresh, single-use machine; prefer a VM or microVM boundary over a shared kernel; never attach persistent self-hosted runners to public repositories; replace long-lived secrets with OIDC; scope caches so untrusted branches cannot poison trusted ones; and control or at least monitor network egress.
What can go wrong
- Untrusted code on the runner. A pull request, a compromised dependency or a malicious action executes arbitrary commands with the job’s permissions.
- Persistence between jobs. On a reused runner, one job can leave a process, a modified tool or a poisoned cache for the next.
- Secret theft. Anything the job can read can be sent somewhere else.
- Lateral movement. A runner inside your network can reach whatever that network allows.
- Neighbours. On shared hardware, the boundary between tenants is only as strong as the isolation technology.
Make every runner single-use
An ephemeral runner accepts one job and is destroyed. That removes the persistence problem at the root: there is no next job on that machine. Hosted runners work this way. For self-hosted fleets, use ephemeral or just-in-time registration with an autoscaler rather than long-lived machines.
The profiles on this site record whether each product documents a fresh environment per job, and the finder can require it.
Know the isolation boundary
| Boundary | What separates jobs | Notes |
|---|---|---|
| MicroVM or VM per job | Hardware virtualization; each job has its own kernel | The strongest common option. Jobs can run Docker inside. |
| Dedicated bare-metal machine | A whole physical host per job or tenant | No shared hypervisor; wiping between jobs matters. |
| Container or Kubernetes pod | Namespaces and cgroups on a shared kernel | Fine for trusted code. Privileged containers for Docker builds weaken it further. |
| Shell on a shared host | Nothing | Only for fully trusted, single-team use. |
Public repositories and forks
Anyone can open a pull request against a public repository, and a workflow triggered by it runs their code. GitHub’s documentation says self-hosted runners “should almost never be used for public repositories”, because any user can open a pull request and compromise the environment.
If a public project needs non-GitHub runners, use single-use VMs, require approval before workflows from outside contributors run, keep secrets out of pull-request workflows, and be careful with the pull_request_target trigger, which runs with the base repository’s privileges.
Secrets, tokens and OIDC
- Prefer OIDC to stored cloud keys: the job exchanges a short-lived identity token for temporary credentials scoped to a role.
- Give the workflow token the least permissions it needs.
- Pin third-party actions to a full commit SHA so a moved tag cannot change what runs.
- Keep deployment secrets in protected environments with required reviewers.
Caches and network
Caches are shared state, the one thing ephemeral runners deliberately keep. If a job on an untrusted branch can write an entry that a job on the default branch later restores, that is a poisoning path. Check how a provider scopes its dependency cache and Docker layer cache across branches and repositories.
Network egress is how stolen secrets leave. Useful controls, where offered: static egress IPs so your services can allow-list runners, private networking into your VPC, and egress filtering or monitoring that flags unexpected destinations.
Questions for a runner vendor
- What isolates my job from other customers’ jobs?
- Is every runner single-use, and what happens to its disk?
- Which repositories and permissions does your GitHub App need?
- Where do jobs run, and can I pin a region?
- Which audit reports (SOC 2, ISO 27001) can you share, and do they cover the runner fleet?
- How are caches scoped, and who can read them?
- Can I get static IPs, private networking or egress logs?
Frequently asked questions
Are third-party CI runners secure?
Why are ephemeral runners more secure?
Sources
Check before you rely on it. Products change quickly, and this page reflects public documentation as of November 22, 2026. Confirm anything that matters in the provider’s own documentation.
Cite this page
CI Runners. (2026). CI runner security: a practical guide. cirunners.org. Last reviewed November 22, 2026. https://cirunners.org/guides/ci-runner-security/