CI/CDGitHub Actions
Self-hosted runners: the security rules
GitHub-hosted runners run each job in an ephemeral, clean virtual machine. A self-hosted runner has no such guarantee, and GitHub warns that untrusted code in a workflow can compromise it persistently.

Public repositories
GitHub's security reference says a public repository should almost never use self-hosted runners: any user can open a pull request against it and compromise the environment.
It asks for caution on private and internal repositories too. A person able to fork the repository and open a pull request can compromise the runner environment and with it reach secrets and the GITHUB_TOKEN.
By default, only private repositories can access the runners in a runner group. Leave that default in place.
One job per runner
A self-hosted runner does not get a clean instance for every job. GitHub recommends ephemeral runners, which are assigned one job each. It says this limits the exposure of sensitive resources from previous jobs.
Register an ephemeral runner with the --ephemeral parameter. GitHub de-registers it after it has processed one job:
./config.sh --url https://github.com/my-org --token <registration-token> --ephemeralFor a just-in-time runner, the REST API returns a configuration that you pass to the runner at startup. The runner performs at most one job before it is removed. Send your own organization, runner name, group ID and labels:
curl -L -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <token>" \
https://api.github.com/orgs/my-org/actions/runners/generate-jitconfig \
-d '{"name":"runner-01","runner_group_id":1,"labels":["self-hosted","linux"]}'
./run.sh --jitconfig <encoded-jit-config>Wiping the machine after de-registration is left to your own automation, and GitHub warns that reused hardware can expose information from the environment. The log files of ephemeral runners must be forwarded to external log storage.
Runner groups by trust level
When a runner is defined for an organization or an enterprise, GitHub can schedule workflows from multiple repositories onto it, so a compromise can have a wide impact. Runner groups create the boundary: you restrict which organizations and repositories can access a group.
Put the runners that deploy in their own group, and give that group access only to the repositories that deploy.
New runners join the default group unless you pass --runnergroup at registration. A job selects a group in runs-on, alone or combined with labels. With your own group name and label:
jobs:
deploy:
runs-on:
group: prod-deploy
labels: linux
steps:
- uses: actions/checkout@v7
- run: ./deploy.shNetwork egress
GitHub asks two questions about a runner machine: what sensitive information resides on it, and whether it has network access to sensitive services. Its example for the second is the Azure or AWS metadata service.
The runner fetches its job assignments by connecting to GitHub, which means the machine needs outbound HTTPS on port 443. Limit the machine's outbound traffic to what its jobs need. GitHub's reference lists the domains by function, including:
github.com,api.github.comand*.actions.githubusercontent.comfor essential operations and OIDC tokenscodeload.github.comfor downloading actionsresults-receiver.actions.githubusercontent.comand*.blob.core.windows.netfor logs, artifacts and caches
No long-lived cloud credentials
GitHub says the amount of sensitive information on a runner should be kept to a minimum, because any user capable of invoking workflows has access to that environment. Keep access keys and tokens off the machine.
For cloud access, GitHub recommends OpenID Connect, which creates short-lived, well-scoped access tokens for workflow runs in place of credentials stored as long-lived secrets.
GitHub also warns that a secret used as a command-line argument can be seen by another job on the same runner, for example with ps x -w.
Actions Runner Controller on Kubernetes
Actions Runner Controller (ARC) is a Kubernetes operator. It orchestrates self-hosted runners and scales them. GitHub supports only its latest Autoscaling Runner Sets version. The legacy community-maintained ARC is supported by the community. ARC installs from two Helm charts: gha-runner-scale-set-controller and gha-runner-scale-set.
ARC creates ephemeral runners that register with a just-in-time configuration. A workflow targets a runner scale set by its installation name in runs-on.
GitHub's ARC documentation adds these practices:
- Create the runner pods in a different namespace from the operator pods.
- Pass credentials as Kubernetes secret references. Plain text on the command line can pose a security risk.
- Run production workloads in isolation from the runners' cluster.
- The Docker-in-Docker container requires privileged mode.
The runner version rule
Runners update themselves by default. --disableupdate at registration turns that off, and you then update the runner yourself.
GitHub's pages give two figures for the deadline. The reference says 63 days from the time a newer version is available, and 30 days in its GitHub Enterprise Server version. A changelog entry of June 12, 2026 says 30 days. The reference is the later statement: GitHub changed it from 30 to 63 on November 10, 2026. After the deadline the service assigns no jobs to the runner.
Registration has a minimum too. GitHub's changelog of September 28, 2026 states that on GitHub Enterprise Cloud, from September 29, 2026, runners below version 2.329.0 cannot register. A REST endpoint returns the date registration ends for a version and the date its runners stop receiving jobs:
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <token>" \
https://api.github.com/orgs/my-org/actions/runners/deprecations/<version>What to check first
- Open the organization's settings, then Actions, then Runners and Runner groups.
- For each group, check which repositories can access it and whether public repositories are allowed.
- Replace runners that serve more than one job with ephemeral ones, and remove stored keys and tokens from the machines.
- Call the deprecations endpoint for the runner version you use.
Sources
- Secure use reference
- Self-hosted runners reference
- REST API endpoints for self-hosted runners
- Managing access to self-hosted runners using groups
- Actions Runner Controller
- Deploying runner scale sets with Actions Runner Controller
- Support for Actions Runner Controller
- Self-hosted runner version enforcement date has moved
Want a second pair of eyes on yours? We do this work for a living.
More guides

What changed in GitHub permissions in 2026
Security · 3 min read
Six changes to who can trigger workflows and what apps and tokens may do, one with a deadline of 2 December.

GitHub Actions minutes: where they go and how to cut them
CI/CD · 4 min read
How runner time is billed, and the settings that reduce it.

Semantic versioning and automated releases
CI/CD · 5 min read
The semver rules, commit messages that carry the bump, and two tools that cut the release.