One of the problems with any system is how to prevent abuses by the ones that have power. There are in books on how to try and prevent agent escape. Agent escape is when an individual that is supposed to act on behalf on the best interests of its principal but acts in their own self interest instead. The members of the government are the agents of the people they represent. Elections are on way to try and put a check on that. There of course is the issue of diffusion.
On of the checks of the system is if the prosecutor cheats, they are supposed to lose. If you want to have some modicum of trust that the prosecutor is not going to cheat, you have to make sure the penalty is steep for cheating. This is what happened in the Cosby case.