Safe Interpreters[0] and resource constraints[1] come to mind.
[0] https://wiki.tcl.tk/4204
[1] https://www.tcl.tk/man/tcl/TclCmd/interp.htm#M47