If you are going to be the boss of your nation, you absolutely MUST give your people freedom to a great extent. You at least have to give them enough freedom so that THEY think they are free. If you do this, they will support you forever. If you don't, you will fail... even if you seem to be successful with your people.
In America, answer has been built right into the Constitution and law. But the people have been trained by movies and the courts to not use it very much. The answer is the 12-person jury.
In the US, the 12-person jury can decide anything they want regarding any case that they are the JUDGES for. The can contradict almost any law that exists, and interpret or re-interpret what any law means right down to the Constitution, itself. The important part is that their decision only works with the current case.
For example. If you drive 125 MPH in a 25 zone, get arrested, and take it to trial, the jury (if you require one) could let you off scott free if you can convince them to do so. But they won't let you convince them, because they don't want some joker driving past their house at 125 MPH.
Common people in a jury have sense. And every, Every, EVERY supposed wrongdoing can be brought before a jury for adjudication. The fear of potential jury action is what has made the US so successful within. But the courts have supposedly shot the knowledge of jury action down in the eyes of the people, so that few average people use it any longer.
Police killer robots in America is something that will be struck down by the populace, through juries, if not on the general principle of "innocent until proven guilty."