Last time a major runtime tried implementing such restrictions on VM level, it was .NET - and it took that idea from Java, which did it only 5 years earlier.

In both Java and .NET VMs today, this entire facility is deprecated because they couldn't make it secure enough.