Isolation

A self-hosted runner is not a sandbox. By default jobs run as you; two opt-in modes keep them away from your account, at the cost of speed.

The three modes

ModeJobs run asStatus
hostyour user, with your filesThe default
usera separate, hidden user per runner, wiped before every jobExperimental, off by default
vma fresh virtual machine per job, deleted after itExperimental, off by default

Neither opt-in mode ever falls back to running a job as you. Both are slower: every job starts from an empty home or a fresh VM, with cold caches.

host

Every job runs as the user Codemany runs as, so it can do anything you can: read and change your files and source trees, reach every device on your network, and leave processes or login items behind. Runners are single-use and their work directory is wiped after each job, but that doesn't isolate a job from the machine. Only run workflows you would run in your own terminal.

user: a separate user per runner

Each runner slot runs as its own unprivileged user (_codemany1…N), with no login shell and no admin rights. Its home is wiped and rebuilt before every job. Jobs can't read your home, your config, the token store, or another slot's home. Up to 64 slots.

macOS

Settings › Fleet › Runner isolation › Separate user per runner. macOS asks you to allow Codemany's helper in System Settings › General › Login Items & Extensions. Or codemany isolation user once the helper is allowed.

Linux

Install the helper once, then switch:

sudo codemany system-setup --user "$USER" --user-isolation   # the helper, once
codemany isolation user                                       # as you
systemctl --user restart codemany

Caches start cold in every job (Xcode DerivedData, SwiftPM, Homebrew and language caches), and the shared tool cache isn't used. Cloud machines Codemany creates run in this mode.

vm: a fresh VM per job

  • Mac: each job gets a fresh macOS VM, cloned from a golden image and deleted when the job ends. Apple's macOS licence allows two additional copies of macOS in virtual machines per Mac, so at most 2 jobs run at once in this mode, whatever the machine could hold.
  • Linux: QEMU/KVM. It needs hardware virtualization (ls /dev/kvm); codemany isolation vm-image says why it won't start.

This mode is experimental: no real job has run end to end in it yet. Watch the first jobs.

Switching modes

codemany isolation status     # the mode, the helper and its users
codemany isolation user       # or host, or vm
codemany isolation host       # back to the default

Turning a mode on in Settings asks twice: first what it does, doesn't protect and costs, then a last check, because it restarts the background service, which stops any job running then. Turning isolation off never asks. codemany setup without --isolation keeps the current mode.