Units are part of the type
memory: 512 does not compile. It is ambiguous — megabytes, mebibytes and bytes differ by six
orders of magnitude, and a comment saying which one is meant is not enforcement.
Mebibytes is a branded number, so the unit has to be written at the call site. MiB(512) === 512 at runtime — the canonical unit is the mebibyte, and KiB, GiB and TiB convert into
it. Nothing happens beyond that arithmetic: this is a device for the reader and the compiler.
JavaScript callers get the documentation value without the enforcement, because a branded type
is erased at runtime. If you are not using TypeScript,
memory is a number of mebibytes.Prove the limits are real
A cgroup limit that the host cannot enforce is accepted and ignored, which is worse than being refused — nothing fails, and every sandbox is unbounded:Network
"none" gives the sandbox no network interface at all. It is the right default for anything
that only has to transform data you handed it, and the wrong one for anything that installs
dependencies.
There is no partial mode. A sandbox that can reach the network can reach all of it that the host
can, so where you need an allowlist, put it in front of the host — an egress proxy or a firewall
rule — rather than expecting the sandbox to police itself.