Rules as Code (RaC)

RaC is an emerging concept in public sector innovation, which is rethinking a core function of government: rulemaking.

What is RaC?

RaC proposes to create an official, machine-consumable version of some types of government rules, to exist alongside the existing natural language counterpart. This involves the use and integration of technology, but also a reimagining of the processes and methods currently used to create government rules. In this way, RaC is ‘the process of drafting rules in legislation, regulation, and policy in machine-consumable languages (code) so they can be read and used by computers’ and thus also represents a new approach to rulemaking (de Sousa, 2019). It is this latter interpretation of RaC that many public sector innovators (from across the world) view as possessing significant potential for governments.

Why is RaC needed?

The way that governments make rules has remained largely immune to fundamental transformation over time. In a world of increasingly complex, interconnected policy issues, which demand rapid and effective responses from governments, these processes are under increasing pressure. The current method of rulemaking is typically linear and siloed, and does not always allow for fast implementation of services or the use of techniques (such as ex ante modelling) which are now available to policy makers. Most importantly, however, the process do not produce rules in a format that machines can immediately consume. With digitalisation meaning that machines are now a significant and important consumer of government rules, there is an increasing recognition that government rules should be optimised for both human and machine use.

OPSI’s research

OPSI first wrote about RaC as a trend, ‘Machine-Readable World’, in the 2019 OPSI Global Trends Report. A form of anticipatory innovation in the OPSI innovation facets models, OPSI wrote: ‘For decades, the way governments have developed laws, policies, and other types of rules has largely remained stagnant, but some governments have begun designing, publishing and refining these rules into machine-readable formats’.

In December 2019, OPSI commenced work on the third in our series of Innovation Primer’s, Cracking the Code: Rulemaking for humans and machines. The primer is designed to help individuals or organisations understand the RaC concept in an accessible way, while also highlighting its potential challenges and benefits. We hope the primer will also enable further experimentation and use of the RaC concept in governments across the world. The recording of the primer launch (webinar) is below.

As a companion document to the primer, we have also developed a highlights document. This acts as a short, high-level introduction to the concept and aims to help individuals seeking to explore or test RaC in their own public sector contexts.

This research has benefited from a number of perspectives through both our initial research interviews, as well as from the public consultation for the primer. We have spoken with countless people about the primer and its contents, as well as received invaluable feedback from multiple individuals in the OPSI community.

Get involved

We welcome any interest in RaC. Get in touch with us.

You can also join the conversation about RaC on Twitter under the hashtag #RulesAsCode.



OPSI’s 2020 report, Cracking the Code, provides an introduction to the RaC concept, its potential and considerations relating to its use in the public sector. It explores:

  • The current state of government rulemaking and why this is creating three interrelated problems for governments.
  • The RaC concept, use cases and related and preceding efforts.
  • The case for RaC as well as a number of considerations that need to be explored in relation to the concept.
  • A number of future scenarios that help tease out how RaC could develop in government.
  • Practical advice and guidance relating to the operationalisation of RaC in a public sector context.

To read more about what we uncovered and to read the case studies, you can find the full report here.

Déchiffrer le code: L’élaboration de règles exécutables par les humains et par les machines est disponible ici.

This highlights document summarises the findings from OPSI’s innovation primer, Cracking the Code: Rulemaking for humans and machines.

In a short, readable format, the highlights document provides an overview of the main issues and findings explored in the primer.  This document may be most useful for public servants seeking to develop a basic understanding of the RaC concept and how it could be used in a public sector context.

Cracking the Code: Highlights is available here.



Collaborate with us

Get in touch