score:3

Accepted answer

there are two different issues: compile-time and run-time sandboxing.

runtime sandboxing can be accomplished by using java security and classloader restrictions - see e.g. how do i create a java sandbox? and, more cautionary, can i trust java securitymanager sandbox?. there's a lot more out there on this topic!

for scala compile-time sandboxing, i have to defer. however, i wonder whether you need it. if the only people who try to use forbidden api's are those who are trying to break into your system, there's no reason to make their job easier by providing compile-time checking.


Related Query

More Query from same tag