points by sureglymop 4 weeks ago

What is the main benefit over doing something like:

    docker run --runtime krun --rm -it -v $(pwd):/workspace/$(basename $(pwd)) -w /workspace/$(basename $(pwd)) --network restricted-net ghcr.io/openai/codex-universal:latest sh

That runs the codex OCI in a qemu microvm. From what I can see, more fine grained network and filesystem access control as well as convenience?

mdavidn 3 weeks ago

Aside from hiding agent credentials from the agent, it also runs an isolated Docker Engine for the agent to use freely.

codethief 4 weeks ago

Yes, pretty much, except for one detail:

> That runs the codex OCI in a qemu microvm.

AFAIU it's actually the other way around: krun spawns a libkrun-based (not QEMU-based) VM inside a crun container. Source: https://github.com/libkrun/libkrun/discussions/538#discussio...

So with your solution you get the additional security benefit of containerizing the hypervisor on the host.

  • figmert 3 weeks ago

    Once you have a vm, the container provides next to no additional security benefits. It's just unnecessary overhead at that point.

    • codethief 3 weeks ago

      That's not correct. Virtio devices have different security properties and many of them expose the host system to considerable risks. Using containerization on the host is one way to limit the latter. See e.g. https://github.com/libkrun/libkrun/#security-model for more details.

      • figmert 3 weeks ago

        Well, I stand corrected! Thanks for the link