Could this idea be more backwards?
Let's accept that the rule of law is meant to provide solid ground upon which our society can function. Some laws stop us taking each other's stuff (property, liberty, lives) while others help us swap our stuff in a way that's fair to the parties involved (property, liberty, time)."
I'm sorry; you must be new here.
The law is simply a generally-accepted monopoly on the initiation of violence. This may, in theory be used to help society function as described above. In practice, it throws as few crumbs in that direction as is necessary to maintain the violence monopoly. The overwhelming majority of its energy is directed towards further enriching and empowering those who control the violence monopoly. This attracts people who prefer to improve their position through the unilateral application or threat of violence, as opposed to other groups who prefer (or are at least willing) to improve their position through other means, ranging from fair trade to outright fraud. In the US, people complain about having to choose between the openly sociopathic Donald Trump, the openly sociopathic Hillary Clinton - but the system only admits people like this. There is an enormous apparatus of local, state, and federal government that acts as a training and grooming program to weed out the weak and idealistic. Some people do get as high as the US Congress and keep their values mostly intact, but these people are so rare that they don't really mean anything. On the (R) side you have someone like Ron Paul or Justin Amash, and on the (D) side you have someone like Dennis Kucinich. These people are denigrated as loons, and the system tries very hard to reject them. I'm not saying that their positions are right or wrong, merely that they are or were fairly immune to corrupting influences against their values. Amash's own party spent an insane amount of money trying to force him out during the last election. People who cannot be bought and controlled are not wanted in government (note that I specifically exclude Bernie Sanders, who is just as corrupt as the rest when people aren't paying attention - which is most of the time - from the good guy list).
So then we have laws. Laws are designed to further enrich or empower the people writing them. This is sometimes done directly in a pay-for-play fashion, and other times indirectly by buying votes or otherwise paying enough attention to the outrage of the day to make the unwashed masses shut up and go away. But the kicker is that most of the time it's both - legislation designed to help "protect" the Morlocks from the big bad business people who are.... actually the ones who write the laws. Big business then complain loudly, bitterly, and publicly about how unfair the legislation is, the politicians claim Victory for the People, and the media (almost entirely comprised of pathetic, self-important rubes) gushes in admiration. The end result is that Big Business has fewer competitive worries and few (if any) meaningful costs or restraints placed on them. Every once in awhile a Sacrifice Must Be Made For the Greater Good (a company gets whacked hard), but again, this is relatively rare and almost always done in favor of some competing oligarchy so that money and power are not lost overall by the political class.
A lot of people say that this description of laws is grossly unfair, unrealistic, etc. Nope. In my younger days I was rather involved with it. I've literally been in the room where businesses helped write regulations to "improve public (whatever - safety, health, etc.)" in ways that covered what they were already doing and specifically hurt or eliminate their competitors that couldn't afford to keep up with them. The word "monopoly" was originally coined as a privilege granted or sold by governments to give an organization exclusive rights to some sort of business practice. These days, we call it legislating for the public good.
There are a lot of metaphors for politics; the most useful one I have found is that it's just a specialized form of gang warfare controlling the most rarified form of turf.
Now we bring in AI, which some people fear will be even smarter and more evil than Big Business. And we should have bigger and badder laws to deal with it! But... if AI is that big and smart, then why won't it game the system even better than Big Business has? Especially when you consider the fact that all of the big, bad AIs will be controlled (at least initially) by Big Business? Does anybody have a plan to make this work that doesn't involve unicorns and fairies?
We can't even control dumb megacorporations with nation-states. We're pretty thoroughly screwed trying to apply the same techniques to these hypothetical ultra-smart ones. Nation-states themselves are the biggest polluters on the planet, and the worst of the pollution that they don't create directly is the result of them selling off the rights to pollute. They kill more people through violence - by many orders of magnitude - than even the worst corporations. DuPont has killed a lot of people, but they're pikers compared to even a mid-tier national government. Democide (the slaughter of people by their own governments, excluding war) has killed around a quarter of a billion people in the last century alone. It's hard to figured out whether the number of people locked in cages for political or victimless crimes is in the 8-figure range or the 9-figure range. In exchange we get schools (that graduate illiterates by the tens of millions), roads (that cost exorbitant amounts of money to build and maintain, if and when they're actually maintained), national health care (that is escaped by anyone who can afford to), national defense (that creates more enemies and terrorists than it eliminates), and a justice system (whose results are more dictated by the wealth of the defendant than the guilt of the defendant), etc. I realize that a lot of people are quite concerned about losing these "essential benefits," but personally I think that we're already living pretty close to the worst-case scenario there.
Time to start cracking on the next stage of organizing humanity....