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 (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 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 platform that can be used to support and create RaC. See our insight What is OpenFisca? for more information.
New Zealand and are also active in this space. Rules As Code is part of NZ’s Better Rules , which brings a new approach to policy and legislation. RaC was also used in creating NZ’s , 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 and has also produced assets on RaC, including:
- Machine readable (available via an )
- Rules As Code emerging technology
Rules As Code and the Observatory of Public Sector Innovation (OPSI)
The OPSI has a dedicated emerging tech project focused on rules as . One of the outcomes of that project was OPSI’s report Cracking the . The report provides an introduction to RaC, including benefits, use cases, the effort involved, and general advice and guidelines.
It’s an extensive report at over 100 pages, and the OPSI does provide a shorter 16-page report, Cracking the Code .
Case studies
RaC is an emerging field and it’s currently being used in several projects and jurisdictions. Case studies include:
- GovZero Aotearoa (New Zealand)
- Fair Trading New South Wales (Australia)
- Mes Aides (My Helpers) — Entitlements eligibility simulator (France)
- Lex Impact — Policy difference engine (France)
- Les meves ajudes (My Aides) — Entitlements eligibility simulator (Spain)
- Rapu Ture — Exploring the Rules (New Zealand)
For more information on these case studies, please see our insight, What is OpenFisca?