This article analyzes the translation of law into computer code and the use of automated decision-making systems in government to make legal distinctions. Specifically, how are algorithmic decisions tied to law, and what happens when legal effects are mediated through technologies? The sociology of translation and Bruno Latour's theory of law, as elaborated by Kyle McGee, provides the means to study associations between law and technology. I trace how the force of law can be extended when mediated through computer systems and analyze the associations of law and technology in Canada's government, through projects exemplifying the shift to “code-driven law.” These include the translation of “rules-as-code,” and several of the sociotechnical systems governing Canada's borders, demonstrating how design choices in government digital services inevitably shape the outcomes of public policy and can have legal effects. While Latour's legal scholarship avoided traditional questions of legitimacy, a key consideration for automated government systems is how legitimacy is constructed and contested. For rules-as-code, legitimate algorithmic outcomes should be traceable to law, but existing government systems commonly maintain legitimacy by identifying a human actor “in-the-loop” as the ultimate decision-maker, thereby obscuring how thoroughly imbricated human and algorithmic agency are in contemporary governance.