That's exactly what having basic rights and human rights does.
Of course this is a bit circular reasoning because this works only if everyone abides by these rules, so in practice protects only against relatively 'mild' infringements and situations (i.e. the people are expected to be reasonable enough not to vote extremists in power... if not, all bets are off but that's true of all laws)
Don't blame the player, blame the game. Democracy will always converge into extremism the more power government has over people's lives. If you become reliant on government acting violently against the power minority and let government increase it's power, it will always lead to this.
It's self feeding problem. The only solution is slowly to deny government power over people.
Of course this is a bit circular reasoning because this works only if everyone abides by these rules, so in practice protects only against relatively 'mild' infringements and situations (i.e. the people are expected to be reasonable enough not to vote extremists in power... if not, all bets are off but that's true of all laws)