Docker is not a strong security boundary and shouldn't be used to sandbox like this
https://cloud.google.com/blog/products/gcp/exploring-contain...
Compared to what? Which one is superior?
Running npm on your dev machine? Or running npm inside Docker?
I would always prefer the latter but would love to know what your approach to security is that's better than running npm inside Docker.
Confusingly, Docker now has a product called "Docker Sandboxes" [1] which claims to use "microVMs" for sandboxing (separate VM per "agent"), so it's unclear to me if those rely on the same trust boundaries that traditional docker containers do (namespaces, seccomp, capabilities, etc), or if they expect the VM to be the trust boundary.
[1]: https://www.docker.com/products/docker-sandboxes/