Limiting access of a Script/Class

Godot Version

3.5.3-stable

Question

I’m trying to add modding support to my game, thinking of either making it with GDScript or perhaps some lua extension, the problem is that modders would have access to things like OS related functions and classes that manage the game in ways it could break when irresponsibly modded. Is there any way I can limit what singletons/classes a script/class can call? I would much rather expose an API specific for modding with it’s own signals and methods. Thank you very much in advance.

You’re in for a world of hurt. I don’t think this is even possible. Can other engine’s do this?

Your best bet would be to be open about how mods can be malicious and solve the problem on a social-level. You may have to vet mods manually and probably force your game to only fetch mods from some single, controllable repo.