In this article the authors explore the various ways in which robot behaviour is regulated. A distinction is drawn between imposing regulations on robots, imposing regulation by robots, and imposing regulation in robots. Two angles are looked at in depth: regulation that aims at influencing human behaviour and regulation whose scope is robots' behaviour. The artificial agency of robots requires designers and regulators to look at the issue of how to regulate robot behaviour in a way that renders it compliant with legal norms. Regulation by design offers a means for this. Returning to Asimov's three laws of robotics, which have been widely neglected by hands-on roboticists, the idea of artificial agency is explored through the example of automated cars. Whilst practical issues such as space locomotion, obstacle avoidance and automatic learning are important, robots also have to observe social and legal norms. For example, social robots in hospitals are expected to observe social rules, and robotic dust cleaners scouring the streets for waste as well as automated cars will have to observe traffic regulations.