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
| Mode | Jobs run as | Status |
|---|---|---|
host | your user, with your files | The default |
user | a separate, hidden user per runner, wiped before every job | Experimental, off by default |
vm | a fresh virtual machine per job, deleted after it | Experimental, 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 codemanyCaches 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-imagesays 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.