The author aims to present in the course of this study the possible future interactions between laws and the behaviour of artificial intelligence. Firstly, the theory of code is presented as well as the debate regarding the aptitude of laws to represent a means for the control of machine behaviour either directly or, as is more likely, when embedded in code. Secondly, the author analyses the consequences of the emergence of ‘robot law’, the ways in which a mixed, two-, or possibly three-tiered normative system is arising. In such a system, human-readable law and robot law are likely to diverge and even possess different characteristics such as an added degree of instability in the case of robot law. The author analyses the difficulties posed by transitioning between these systems and those of endowing machines with behavioural concepts such as ethics and unbiased action, problems compounded by the inherent opaqueness of the processes which underpin artificial intelligence. Finally, the author raises the possibility that codes designed to regulate human–machine interrelationships in and of themselves may constitute the beginning of a new, supranational legal system, with the platforms employing such codes transformed into quasi-sovereign entities.