Packj sandbox [1] offers "safe installation" of PyPI/NPM/Rubygems packages.
1. https://github.com/ossillate-inc/packj/blob/main/packj/sandb...
It DOES NOT require a VM/Container; uses strace. It shows you a preview of file system changes that installation will make and can also block arbitrary network communication during installation (uses an allow-list).
Disclaimer: I've been building Packj for over a year now.