This is typically handled by the game offering a modding API for people to make mods with. This API limits mods to do things which will not be cheating.