If it’s allowed to write any sort of scripts, it will find a way to execute arbitrary code. If it’s got access to any form of internet connection it will find a way to use that arbitrary code to do as it wishes with that connection. So much for sandboxes.
And that’s setting aside “sandboxes” that are just instruction-based restrictions on what executables may be called. Anything that isn’t a deterministic external filter _will_ be ignored at some point.