In fact, I would counter and say that Hammurabi's Code is a quintessential example.
For example it assumes the other party can fear, and has a sense of self preservation. Those things are often untrue of other humans, let alone machines.
More fundamentally it also assumes all sort of things about free will itself, implying that retaliation is "deserved" and other value judgments that only make sense if the other party has free will to begin with. Something which science tells us is debatable even about humanity.
No, game theory tells us the right answer and it's not "hold back when retaliating" or "teach them a lesson." Those are things only humans would do, and even then only the ones who share your neurology and upbringing.
Hammurabi's code may feel fundamental, but it's no more fundamental to the human condition than boys preferring blue to pink.
It's still an implementation of justice, and relies on a bedrock conception of justice as moral goal.
We don't agree with the implementation, but we still share the goal in the abstract.
And proportionality matters. Community service and counseling, loss of time (imprisonment), and loss of a hand have all been used to punish theft. Which is correct? Which is the more moral, because it doesn't seem to me that they're the same?
Hence morality and ethics, I guess.
The law isn't a moral benchmark, because morality shifts over time, both for what constitutes a crime, and what constitutes appropriate punishment. At various points in time, it's been legal to own slaves, illegal to be homosexual, and illegal for certain groups to vote (and I consider voting at all to be a subset of this); those laws (and ideas) were eventually updated, largely on moral grounds.
Similarly, most western countries no longer execute criminals.
But those ideas aren't universal, even today. Assuming that they are is imo, extraordinarily foolish, because there's ample evidence to show that they're not.