Exactly this.
> Also, if you don't require a real Linux sandbox — you might actually emulate the environment
We built agentOS for this: https://rivet.dev/agentos/
It provides Linux-compatible sandboxing using V8 / WebAssembly. Supports full POSIX filesystems, networking stacks, and process trees.