Skip to main content
CI runs code that changes with every pull request. The sandkiln-run composite action runs it in a fresh microVM with no outbound network, then destroys the VM, so the runner only checks out and uploads the code.

What you need

A reachable sandkilnd. GitHub-hosted runners are clients only: GitHub documents nested virtualization as “not officially supported”, and no published guest kernel or rootfs exists for starting a daemon inside a job. The design note has the research and the three topologies.
Never expose a daemon without an auth_token: anyone who can reach it can run code on your host. Put it behind TLS, store the token as a secret, and restrict by IP or a private tunnel where the runner’s address is stable.

Use the action

Store SANDKILN_DAEMON_URL and SANDKILN_AUTH_TOKEN as repository secrets, then:
The step fails with the command’s exit code, streams its output, and exposes sandbox-id and exit-code. A final step destroys the sandbox after a failure, a timeout or a cancelled run alike (observed on a GitHub-hosted runner). Set keep-on-failure: "true" to keep it for debugging, then remove it with kiln sandbox rm <id> --destroy. Sandboxes carry github-run and github-repo tags, so kiln sandbox ls shows orphans.

Safe defaults

  • egress defaults to deny_all; allow specific CIDRs with allow-cidrs.
  • .git is never uploaded, because checkout can leave a credential there.
  • Fork pull requests get no secrets, so skip them rather than switching to pull_request_target, unless nothing from the pull request runs on the runner.
  • Do not trigger a self-hosted runner from fork pull requests on a public repository.

Limits

  • The workspace is uploaded as one tar.gz through the file API, so exclude build output with exclude.
  • The timeout is enforced inside the sandbox with timeout from the image (exit code 124); an image without it only gets a client-side limit that abandons the stream.
  • A runner machine that dies mid-job runs no final step, so the sandbox lives on. Find it by its github-run tag.
  • The image needs sh and tar.
The action’s reference lists every input, and the example has both workflows and a sample project. The action ran on GitHub-hosted runners against a stub daemon on 2026-11-24 (wiring, exit codes, cleanup, token masking, cancellation); the real daemon and a microVM were only exercised from a developer machine, never from a hosted runner.