This will come from the capitalist system, businesses will be driving the obsolescence of humans, not governments.
Once the owners of the means of productions don't need humans in their workforce, what value to they bring?
It will be much harder to "revolt" against capitalism/businesses than a central government.
And the biggest danger here, is it means the end of the capitalist system as the best way to increase living standards. If capitalism doesn't work as a means of redistribution anymore, because humans have been devalued, what economic model can replace it and be as successful?
We're re-entering an era where economic systems are all going to favor a few classes, and impoverish the rest.
what's the point of owning the factories if there is no one to buy the crap you produce? they need us more than we need them, at least until they have their own spaceships with AI and robots to fluff their balls for them.
You produce things you yourself want to consume. Why produce things for others if they have nothing you need?
The only reason there is a need to sell to workers today is so you can pay them a salary to work in your factories, and then take a portion of that for yourself. When you don't need workers you don't need to sell to workers, you just take the entire output for yourself.
Edit: If you can't imagine how someone could consume that much, then think of a golf enthusiast so he tells his AI factories and builders to prepare new golf courses at the same rate he can finish them, so he can play gold all day long and never replay a course.
Basically production will become almost 100% luxury focused instead of median consumer focused like it is today.
You shouldn't just be worried of your own government here.
And the other issue is, why would the post-revolt government/businesses abandon AI/robotics?
The truth is, this won't happen over night. People will have less work over time, be paid less and less, the gap between classes will grow bigger, etc.
I guess another way to put it, take a country like India with lots of unemployment and high corruption, I don't think if they had guns they'd all revolt. You have to believe there's a point to revolting, an alternative that's better and worth the risk.
There is no legal reason why AIs couldn't be governed under the same principle.