Skip to main content
Running CI jobs in sandboxes is in preview.
AutoPilot for CI can run a job in a sandbox from your own provider account. CostGraph starts a fresh sandbox with a GitHub Actions runner that takes only that job. The sandbox is deleted when the job ends. Supported sandbox providers lists the providers that can run CI jobs. Sandbox runners compete like any other runner, under your policy, trials, and provider limits. A job’s cost is the provider’s published price for the sandbox size, for as long as the sandbox runs. Your provider bills that time to your account.

Requirements

  • AutoPilot for CI is set up as described in Requirements.
  • An owner of the GitHub organization has approved the CostGraph GitHub App’s Self-hosted runners organization permission, set to Read and write, and its Workflow job event. Until then, sandboxes are skipped with reason github_app_reapproval.
  • A sandbox provider is connected on Integrations, as described in Connect.
  • Jobs run on Linux, on x64 or arm64.

Runner image

Providers that boot a container image, such as Beam, Daytona, Fly, Islo, and Promigence, start the CostGraph CI runner image, ghcr.io/baselinehq/costgraph-ci-runner. It is GitHub’s runner image on Ubuntu 24.04 with most tools from GitHub’s ubuntu-latest image. It includes Node.js with pnpm and Yarn, Python, Go, Java 17 and 21 with Maven, and Rust. It also includes the GitHub CLI, the AWS CLI, kubectl, Helm, Terraform, and Docker with buildx and compose. Other providers start from their own default image. CostGraph installs the GitHub Actions runner, git, curl, jq, Python, build tools, and Node.js when the sandbox boots, and Docker when the job needs it. These installs need root or sudo and apt-get in the sandbox. The job runs as a runner user with passwordless sudo when the sandbox allows it, and as root otherwise. Install anything else the job needs in the workflow, with a setup-* action or sudo apt-get install -y <package>.

Send a job to a sandbox

You can send a job to a sandbox in three ways.
  • Routing job. With the routing job in place, sandboxes become candidates for every job that fits them.
  • Pin. Set pin on the routing job to a sandbox provider, such as beam, or a size, such as beam:sandbox-8c-32g. Refer to Pin a workflow to a provider.
  • CostGraph label. Write a label that starts with costgraph= in runs-on to run the job in a sandbox without a routing job.
The following job uses a CostGraph label.
The label starts with costgraph= and a value unique to the job. The optional parts after it say what the job needs. Only sandboxes compete for a job with a CostGraph label. To compare them with a runner you know, set a baseline runner.

When a runner does not start

  • A runner that has not started 60 seconds after its sandbox was requested is tried once on the next best sandbox.
  • A job with a CostGraph label that has no runner after 2 minutes gets one on the next best sandbox. After the fallback delay, it goes to the fallback runner, when you set one.
  • A sandbox still running after 6 hours is deleted.
A routed job that never gets a runner is handled like any stuck job. A provider whose latest runner never started is offline for every job, for example when the size is larger than your plan’s vCPU limit. Refer to Try new runners.

Settings

Set these on the Settings tab of AutoPilot for CI, for the organization, a repository, or a workflow, or with the settings API.

Run your own dispatcher

CostGraph starts sandboxes for you by default. If you self-host CostGraph, need runners on a private network, or want to keep the provider key out of CostGraph, run your own dispatcher. Install the agent runtime chart with your provider’s credentials and turn on CI runners.
The provider credentials stay in your cluster. dispatcher.concurrency sets how many jobs the dispatcher runs at once. On providers that build their own templates, set dispatcher.ciRunner.providerTemplate to a template built from the runner image, so jobs start faster and have its tools.

Docker

Docker, including services: and container: jobs, works where the provider can run a Docker daemon. Set docker: true on the routing job or docker in the CostGraph label, so AutoPilot offers only providers that can run Docker. On Beam, containers on Docker’s default bridge network have no outbound network. Build images with docker build --network host when the build downloads anything.

Secrets and forks

Jobs with secrets can run in sandboxes by default. To keep them off a sandbox provider, set allow_secrets: false for it. CostGraph never starts a sandbox runner for a pull request from a fork or a pull_request_target run. It cancels such a run when a job has a CostGraph label. Use the routing job in workflows that forks trigger, so their jobs keep their default runners.

Network and public repositories

The runner connects out to GitHub over HTTPS on port 443 and opens no inbound port. If your provider limits egress, allow the domains GitHub lists for self-hosted runners. Sandbox runners join your organization’s Default runner group. By default, GitHub doesn’t let that group run jobs from public repositories, so those jobs never get a runner. To allow them, an organization owner opens Settings > Actions > Runner groups in GitHub and turns on Allow public repositories for the Default group. Read GitHub’s guidance on self-hosted runners and public repositories before you turn it on.