You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(sandbox) - add oci_runtime passthrough for container backend
Let the container sandbox backend run under an alternative OCI runtime via
`docker`/`podman run --runtime <x>`, selected with a new
`sandbox.container.oci_runtime` option. Unset keeps the runtime default
(runc), so existing behavior is unchanged. Pointing it at a VM-based runtime
such as Kata Containers gives each sandbox a hardware-VM boundary while
reusing the entire tested container path (image, mounts, user mapping, RPC).
The flag is threaded into `build_docker_run_args` immediately after the `run`
subcommand, so both agent panes and `workmux sandbox shell` pick it up. Like
`devices`/`group_add`, `oci_runtime` is global-only: it changes the isolation
boundary, so a project `.workmux.yaml` cannot set (or downgrade) it and a
warning is emitted if it tries.
No new SandboxBackend variant and no supervisor/multiplexer changes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(sandbox) - add container.cap_add and security_opt passthroughs
Global-only, default empty (no behavior change when unset). Emits
docker/podman run --cap-add / --security-opt.
Enables docker-in-docker under the kata oci_runtime without --privileged,
which fails on kata (injects host device nodes that collide with the
guest's: 'Creating container device /dev/full EEXIST'). Granting caps +
security_opt instead boots cleanly and keeps the daemon confined to the VM.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(sandbox) - skip oci_runtime and security opts on apple container
Address PR #198 review feedback.
build_docker_run_args_inner emitted `--runtime`, `--cap-add`, and
`--security-opt` before the outer runtime was known, so a global
`oci_runtime: kata` (or cap/security opts) produced
`container run --runtime kata ...` on macOS, where Apple Container is
auto-preferred. Apple Container misreads these Docker/Podman flags and
fails to start the sandbox, contradicting the docs that promised the
setting is ignored there.
Compute the runtime first and skip these Docker/Podman-only flags on
Apple Container, matching the documented "ignored" behavior and letting a
single global config target Kata on a Docker host while still running on
macOS.
Docs: correct the unset default (engine default -- runc on Docker, crun
on Podman -- not a hardcoded runc), make the Kata example Docker-first,
and note Kata does not officially support Podman.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EvyFzQAKuwhy1DUPLdTBd2
* fix container runtime compatibility guidance
Remote Podman clients do not expose the local engine's --runtime flag, so
configured OCI runtime overrides failed with an opaque unknown-flag error.
Reject known remote Podman environments with an actionable message while
preserving support for local Podman on Linux.
Describe unset OCI runtime behavior as deferring to the engine's configured
default in both generated and source documentation. Document cap_add and
security_opt syntax, runtime support, global-only scope, and the isolation
impact of permissive values used without a VM-based runtime.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Raine Virta <raine.virta@gmail.com>
| `container.runtime` | auto-detect | Container runtime: `docker`, `podman`, or `apple-container`. Auto-detected from PATH when not set. On macOS, prefers Apple Container (`container`) over Docker/Podman. |
48
-
| `container.memory` | `16G` (Apple Container) / none (others) | Memory limit for the container. Apple Container VMs default to 1 GB which is too low, so workmux sets `16G` by default. This is a ceiling, not an upfront allocation. Works with any runtime when explicitly set. |
49
-
| `container.cpus` | none | CPU count for the container. Only passed when explicitly set. Apple Container defaults to 4 CPUs which is sufficient for most workloads. |
50
-
| `container.devices` | `[]` | Host device nodes exposed to the sandbox (e.g. `/dev/kvm`, `/dev/ttyUSB0`). Passed to the runtime as `--device`. Docker and Podman only; Apple Container rejects. **Global config only.** |
51
-
| `container.group_add` | `[]` | Supplementary groups added to the sandboxed process (e.g. `dialout`, `video`, or numeric GIDs). Passed to the runtime as `--group-add`. Docker and Podman only; Apple Container rejects. **Global config only.** |
52
-
| `target` | `agent` | Which panes to sandbox: `agent`or `all` |
53
-
| `image` | `ghcr.io/raine/workmux-sandbox:{agent}` | Container image name (auto-resolved from configured agent). |
54
-
| `rpc_host` | auto | Override hostname for guest-to-host RPC. Defaults to `host.docker.internal` (Docker), `host.containers.internal` (Podman), or `192.168.64.1` (Apple Container). **Global config only.** |
| `container.runtime` | auto-detect | Container runtime: `docker`, `podman`, or `apple-container`. Auto-detected from PATH when not set. On macOS, prefers Apple Container (`container`) over Docker/Podman. |
48
+
| `container.memory` | `16G` (Apple Container) / none (others) | Memory limit for the container. Apple Container VMs default to 1 GB which is too low, so workmux sets `16G` by default. This is a ceiling, not an upfront allocation. Works with any runtime when explicitly set. |
49
+
| `container.cpus` | none | CPU count for the container. Only passed when explicitly set. Apple Container defaults to 4 CPUs which is sufficient for most workloads. |
50
+
| `container.devices` | `[]` | Host device nodes exposed to the sandbox (e.g. `/dev/kvm`, `/dev/ttyUSB0`). Passed to the runtime as `--device`. Docker and Podman only; Apple Container rejects. **Global config only.** |
51
+
| `container.group_add` | `[]` | Supplementary groups added to the sandboxed process (e.g. `dialout`, `video`, or numeric GIDs). Passed to the runtime as `--group-add`. Docker and Podman only; Apple Container rejects. **Global config only.** |
52
+
| `container.cap_add` | `[]` | Extra Linux capabilities granted to the container, passed verbatim as `--cap-add` (e.g. `ALL` or `SYS_ADMIN`). Docker and Podman only; Apple Container ignores it. Permissive values weaken host-kernel container isolation. **Global config only.** |
53
+
| `container.security_opt` | `[]` | Security options passed verbatim as `--security-opt` (e.g. `seccomp=unconfined` or `no-new-privileges`). Docker and Podman only; Apple Container ignores it. Options can strengthen or weaken confinement. **Global config only.** |
54
+
| `container.oci_runtime` | none (engine default) | OCI runtime to run the container under, passed as Docker or local Podman `--runtime`. Unset omits `--runtime`, deferring to the engine's configured default. Set to e.g. `kata` for stronger VM-based isolation. Remote Podman rejects this flag; Apple Container ignores it. **Global config only.** |
55
+
| `target` | `agent` | Which panes to sandbox: `agent`or `all` |
56
+
| `image` | `ghcr.io/raine/workmux-sandbox:{agent}` | Container image name (auto-resolved from configured agent). |
57
+
| `rpc_host` | auto | Override hostname for guest-to-host RPC. Defaults to `host.docker.internal` (Docker), `host.containers.internal` (Podman), or `192.168.64.1` (Apple Container). **Global config only.** |
| `network.policy` | `allow` | Network restriction policy: `allow`(no restrictions) or `deny` (block all except allowed domains). See [network restrictions](#network-restrictions). **Global config only.** |
63
+
| `network.allowed_domains` | `[]` | Allowed outbound HTTPS domains when policy is `deny`. Supports exact matches, `*.` wildcard prefixes, and exact-host private destination opt-in. **Global config only.** |
61
64
62
65
### Example configurations
63
66
@@ -148,6 +151,77 @@ Listed paths are relative to the worktree root. Each one is shadowed by a read-o
148
151
149
152
**Note:** `excluded_files` relies on file-level bind mounts, which Apple Container does not support (it only accepts directory mounts). When the runtime is Apple Container and `excluded_files` is set, workmux fails fast rather than silently leaving secrets readable. Use Docker or Podman if you need this feature.
150
153
154
+
**Run under a VM-based OCI runtime (stronger isolation):**
155
+
156
+
```yaml
157
+
sandbox:
158
+
enabled: true
159
+
container:
160
+
runtime: docker
161
+
oci_runtime: kata
162
+
```
163
+
164
+
`oci_runtime`is passed straight through to Docker or local Podman as `--runtime`,
165
+
so the container runs under whatever OCI runtime you name instead of the engine's
166
+
configured default. Pointing it at a VM-based runtime such as
167
+
[Kata Containers](https://katacontainers.io/) gives each sandbox a hardware-VM
168
+
boundary while reusing the exact same container image, mounts, user mapping, and
169
+
RPC path as the normal container backend. Leaving it unset keeps the engine's
170
+
default behavior.
171
+
172
+
The named runtime must already be installed on the host and registered with your
173
+
container engine (for Docker, listed under `docker info`'s runtimes). Setting it
174
+
up is out of scope here. See the runtime's own documentation.
175
+
176
+
Notes:
177
+
178
+
- **Global config only.** Like `devices`/`group_add`, `oci_runtime` is ignored
179
+
when set in a project's `.workmux.yaml`. It changes the isolation boundary, so
180
+
a repository must not be able to select (or downgrade) it via its own config.
181
+
- **Kata needs Docker.** Kata Containers does not officially support Podman as a
0 commit comments