What is Rules As Code?
Rules As Code (RaC) is the process of taking legislation, regulations and policies and turning them into machine-readable code so they can be understood and interpreted by computers. The encoded legislation exists alongside the natural language version (it does not replace it) to facilitate digital service delivery.
Why Rules As Code?
Turning rules into machine-readable code provides many benefits for government, citizens and broader society. RaC helps to reduce ambiguity, reduces the difficulty of interpretation and therefore makes it easier for citizens and organisations to comply with the rules. Importantly, it also leads to greater transparency in rules.
Turning legislation into code can also identify gaps and inconsistencies in the original legislation.
For a full list of benefits, see the OECD’s Cracking the code: Rulemaking for humans and machines(Opens in a new tab/window) (p.39 includes a benefits table).
What type of legislation can be coded?
In general, rules (legislation, regulation or policy) that are prescriptive rather than discretionary are best suited for coding. However, it’s worth mentioning that the New Zealand Service Innovation lab found(Opens in a new tab/window) that discretionary rules can be written in code too.
In terms of focus, because the process of transforming existing legislation into code can be complex and time consuming, focusing on rules that can reduce the burden on citizens, create service efficiencies or automate processes will have the most immediate impact.
When to code rules?
While most rules will be coded after the legislation is written, writing RaC alongside the written legislation (i.e. at the same time) is the most efficient approach and can significantly improve the quality of the written legislation.
Who’s using Rules As Code?
Many governments around the world are exploring and implementing RaC — although it’s still definitely an emerging field.
France was an early adopter, creating the open source OpenFisca(Opens in a new tab/window) platform that can be used to support and create RaC. See our insight What is OpenFisca? for more information(Opens in a new tab/window).
New Zealand and Canada(Opens in a new tab/window) are also active in this space. Rules As Code is part of NZ’s Better Rules program(Opens in a new tab/window), which brings a new approach to policy and legislation. RaC was also used in creating NZ’s SmartStart(Opens in a new tab/window), a portal for NZ parents that includes birth registration.
An example here in Australia is the NSW Government. NSW has created a digital version of the Community Gaming Regulation 2020(Opens in a new tab/window) and has also produced assets on RaC, including:
- Machine readable rules(Opens in a new tab/window) (available via an API(Opens in a new tab/window))
You can find more resources on the resources page of the RaC Guild(Opens in a new tab/window).