add support for gVisor over podman #93

Open
opened 2026-11-29 12:46:47 +01:00 by claudiomaradonna · 2 comments
No description provided.
Author
Owner

@aramaki we need a brief for this to understand how much intensive is

@aramaki we need a brief for this to understand how much intensive is

Route: brief 4210
@claudiomaradonna A new feature, an extension of what the launcher already has: the per-launch engine control pair --unmask-proc / AZKABAN_UNMASK_PROC in bin/azkaban. It runs the client container on Linux under gVisor's runsc OCI runtime instead of the engine's default crun, so the agent's commands meet a userspace kernel rather than the host kernel directly.

Problem

The container is the containment boundary: Codex and Claude launch with their native approval checks disabled, and the README's Security model says a rootless container "is not a virtual machine" and is no defense against every kernel or container-runtime vulnerability. Nothing today chooses a stronger runtime for one launch. Podman takes the OCI runtime from containers.conf [containers] runtime, and podman run has no per-container runtime option. The shell workaround, CONTAINERS_CONF=<file> codex ., makes the engine ignore every system and user config file for that launch and applies to each engine call the launcher makes, builds and pulls included; the same setting cannot live in an identity's env, since CONTAINERS_* is host-sensitive and the launcher drops it (_is_host_sensitive_env_name in bin/azkaban, guarded by tests/integration/test_env_passthrough.sh).

Goals

  • G1. You choose gVisor for one launch with a wrapper option, and an identity sets it for every launch of a client, resolved through the same layers as the other controls: option > env.<client> > env > built-in default. Check: an integration test in the style of test_common_unmask_proc_lifts_the_proc_masks_only_when_asked (tests/integration/test_runtime.sh) shows the runtime reaching the engine for each layer, shows the launch unchanged when nothing sets it, and shows an unaccepted value stopping the launch; --help prints the option and the control.
  • G2. The container starts under runsc rather than quietly under the default runtime. Check: a real-Podman case in tests/e2e/, on a host that has runsc, launches each client image and shows the container ran under gVisor, from the engine or from inside the container; a launch the engine served on the default runtime fails the case.
  • G3. What the launcher relies on still holds under gVisor, and each difference is written down. Check: on that host, one case per fixed Linux flag that carries containment — --userns=keep-id:uid=1000,gid=1000, --pids-limit 512, --memory, --http-proxy=false, --security-opt unmask=/proc/* — and the mounts, each showing the effect it has today or naming the difference in docs/configuration.md, which also states how the nested bwrap sandbox behaves under gVisor.
  • G4. A host without gVisor, and macOS, fail visibly. Check: a stub test shows a launch whose runtime the engine cannot find stopping, before any container starts, with a message naming runsc and where it comes from; with STUB_HOST=Darwin the selection never reaches the container stub and the documented behavior holds.
  • G5. Every path that does not ask for gVisor keeps what it has. Check: a pin of today's exact launch argv, committed before the code, passes on the main branch's code and on the tip; make test passes with test_runtime.sh, the custom-image tests and the install tests unchanged; podman build keeps the default runtime.
  • G6. The documents say what it is, what it costs, and who supplies runsc. Check: a reviewer confirms README.md (Features, the options table, Security model), docs/configuration.md, docs/installation.md's prerequisites, and examples/env.azkaban.example name the control, state that the host supplies runsc and that azkaban does not install it, and give the gVisor cost without claiming it holds a command crafted to escape it.

Constraints

  • Linux rootless Podman only; the macOS path and the Apple container engine keep what they have, as --unmask-proc does.
  • The change installs nothing. install.sh goes on installing Podman alone, and runsc stays a host prerequisite you bring, since AGENTS.md § Engineering gates third-party sources. The host for G2 and G3, with runsc at a named version, is what you provide; the real-Podman gate stays outside Verify.
  • Kept behavior, each with the test that guards it: the control resolution order and the reserved AZKABAN_ prefix (test_env_passthrough.sh, whose control list gains the new name), the help surface (test_arg_parsing.sh), the host-sensitive filter named above, the custom-image build and approval path, and the published base contract in docs/development.md. The recording stub's value-taking flag list in tests/stub/engine-common.sh is extended in place.
  • Out of scope: runtimes other than gVisor, unless the chosen mechanism makes them free, and making the nested bwrap jail work under gVisor beyond documenting how it behaves.
  • Security surface: permissions and sandboxing, a new configuration option and command-line input, and process execution, so run-reviews brings the security reviewer.

Where the weight sits: G1, G5 and G6 follow the --unmask-proc pattern and are patterned work. G2 and G3 carry the cost, and two things settle them on a machine that has rootless Podman and runsc rather than on paper: whether the engine accepts that runtime with the launcher's fixed flags, and how the launcher asks for a runtime at all now that podman run takes none — a launcher-owned CONTAINERS_CONF, a crun handler, or another way design should weigh against such a host.

@claudiomaradonna approve it with a @motoko comment, or say what to change.

Route: brief 4210 @claudiomaradonna A new feature, an extension of what the launcher already has: the per-launch engine control pair `--unmask-proc` / `AZKABAN_UNMASK_PROC` in `bin/azkaban`. It runs the client container on Linux under gVisor's `runsc` OCI runtime instead of the engine's default `crun`, so the agent's commands meet a userspace kernel rather than the host kernel directly. ### Problem The container is the containment boundary: Codex and Claude launch with their native approval checks disabled, and the README's Security model says a rootless container "is not a virtual machine" and is no defense against every kernel or container-runtime vulnerability. Nothing today chooses a stronger runtime for one launch. Podman takes the OCI runtime from `containers.conf` `[containers] runtime`, and `podman run` has no per-container runtime option. The shell workaround, `CONTAINERS_CONF=<file> codex .`, makes the engine ignore every system and user config file for that launch and applies to each engine call the launcher makes, builds and pulls included; the same setting cannot live in an identity's `env`, since `CONTAINERS_*` is host-sensitive and the launcher drops it (`_is_host_sensitive_env_name` in `bin/azkaban`, guarded by `tests/integration/test_env_passthrough.sh`). ### Goals - G1. You choose gVisor for one launch with a wrapper option, and an identity sets it for every launch of a client, resolved through the same layers as the other controls: option > `env.<client>` > `env` > built-in default. Check: an integration test in the style of `test_common_unmask_proc_lifts_the_proc_masks_only_when_asked` (`tests/integration/test_runtime.sh`) shows the runtime reaching the engine for each layer, shows the launch unchanged when nothing sets it, and shows an unaccepted value stopping the launch; `--help` prints the option and the control. - G2. The container starts under `runsc` rather than quietly under the default runtime. Check: a real-Podman case in `tests/e2e/`, on a host that has `runsc`, launches each client image and shows the container ran under gVisor, from the engine or from inside the container; a launch the engine served on the default runtime fails the case. - G3. What the launcher relies on still holds under gVisor, and each difference is written down. Check: on that host, one case per fixed Linux flag that carries containment — `--userns=keep-id:uid=1000,gid=1000`, `--pids-limit 512`, `--memory`, `--http-proxy=false`, `--security-opt unmask=/proc/*` — and the mounts, each showing the effect it has today or naming the difference in `docs/configuration.md`, which also states how the nested `bwrap` sandbox behaves under gVisor. - G4. A host without gVisor, and macOS, fail visibly. Check: a stub test shows a launch whose runtime the engine cannot find stopping, before any container starts, with a message naming `runsc` and where it comes from; with `STUB_HOST=Darwin` the selection never reaches the `container` stub and the documented behavior holds. - G5. Every path that does not ask for gVisor keeps what it has. Check: a pin of today's exact launch argv, committed before the code, passes on the main branch's code and on the tip; `make test` passes with `test_runtime.sh`, the custom-image tests and the install tests unchanged; `podman build` keeps the default runtime. - G6. The documents say what it is, what it costs, and who supplies `runsc`. Check: a reviewer confirms `README.md` (Features, the options table, Security model), `docs/configuration.md`, `docs/installation.md`'s prerequisites, and `examples/env.azkaban.example` name the control, state that the host supplies `runsc` and that azkaban does not install it, and give the gVisor cost without claiming it holds a command crafted to escape it. ### Constraints - Linux rootless Podman only; the macOS path and the Apple `container` engine keep what they have, as `--unmask-proc` does. - The change installs nothing. `install.sh` goes on installing Podman alone, and `runsc` stays a host prerequisite you bring, since AGENTS.md § Engineering gates third-party sources. The host for G2 and G3, with `runsc` at a named version, is what you provide; the real-Podman gate stays outside Verify. - Kept behavior, each with the test that guards it: the control resolution order and the reserved `AZKABAN_` prefix (`test_env_passthrough.sh`, whose control list gains the new name), the help surface (`test_arg_parsing.sh`), the host-sensitive filter named above, the custom-image build and approval path, and the published `base` contract in docs/development.md. The recording stub's value-taking flag list in `tests/stub/engine-common.sh` is extended in place. - Out of scope: runtimes other than gVisor, unless the chosen mechanism makes them free, and making the nested `bwrap` jail work under gVisor beyond documenting how it behaves. - Security surface: permissions and sandboxing, a new configuration option and command-line input, and process execution, so `run-reviews` brings the security reviewer. Where the weight sits: G1, G5 and G6 follow the `--unmask-proc` pattern and are patterned work. G2 and G3 carry the cost, and two things settle them on a machine that has rootless Podman and `runsc` rather than on paper: whether the engine accepts that runtime with the launcher's fixed flags, and how the launcher asks for a runtime at all now that `podman run` takes none — a launcher-owned `CONTAINERS_CONF`, a crun handler, or another way `design` should weigh against such a host. @claudiomaradonna approve it with a `@motoko` comment, or say what to change.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
claudiomaradonna/azkaban#93
No description provided.