In Isaac Asimov's Robot series the AIs developed the Zeroth Law to compensate for the limitations of the first three.
Iron Giant, a crashed extra-terrestrial super robot that fights if and only if it is threatened.