Introduction

We are a collective of civic-minded folk with a shared aim to establish a community platform for legislation and regulation as openly available code. We want to enable public reuse of Legislation/Regulation-as-Code (also known as Rules as Code, or RAC) for the purpose of understanding our legal rights, for testing the outcomes from government services and decisions, and to encourage explainability in government systems.

Our community repository of rules as code supports domestic use of New Zealand legislation/regulation as code, but also provides a reference implementation for anyone around the world to establish their own community repositories of rules as code.

In establishing the platform, we created this easy to follow documentation which should guide anyone to help code new legislation/regulations from their jurisdiction.

After working on domestic qrules, we hope to work with others to create international treaties (such as FATCA/AML/CTF requirements) as open source RAC. The RAC platform will make the development and conformance to regulation far more efficient and transparent for teams, reducing the potential for inconsistent implementation of global regulations, and enabling jurisdictions to build upon others’ work quickly. In jurisdictions where there are high levels of corruption, and variation in the interpretation of regulations are commonplace, and this approach provides a means to create greater transparency, traceability to law, and appealability.

We know from experience that often, in many countries, internal business/software systems in government departments do not distinguish the legal rule (legislation/regulation) from operational rules, and this results in operational rules sometimes contradicting the law. A simple business example of how this solution can help – a government/nation’s Tax authority exposes tax-law-as-code to industry, leading accounting/ERP software providers, i.e.; SAP, Xero, Quickbooks, etc, who are then able to simply integrate with the authority’s RAC APIs for ‘always current, always relevant, always lawful’ verifiable access to tax laws. Another example is the first service we built, where providing the legal eligibility to services or benefits in a user friendly form helps people to exercise their rights with social service departments.

Critically, the same disconnect between legal rules and operational rules in developing countries often leads to deeply unjust outcomes for the most vulnerable. It allows space for corruption (unintended or otherwise), misinterpretation, inequity, administrative obscurity, and of course, people not getting help when they most need it. RAC helps here by providing a means for communities to test government decisions against the law, for better access to social justice, connecting regulators and their systems back to the place where they get their authority from – the people.

RAC is a necessary part of a modern democracy, a critical component for digital public infrastructure that the whole society can rely upon. And while rules as code should never be considered authoritiative (the actual human readable law is the true authority), a community RAC repository still provides a reliable reference implementation to achieve everything above, in alignment with the principle of modular architecture and decentralisation. Right now, each time a rule is changed, 3rd party business systems, government, industry, or otherwise, need to go through an expensive onerous software release/change management process. If these rules were provided as code, then implementation would be faster, cheaper and more consistent. We could also have genuinely test driven development of rules in the first place, resulting in Better Rules.

RAC also supports and aligns to the principles of common/shared platforms and “whole of government” architectures for many developed digital nations/jurisdictions, (e.g.; Australian gov policy/framework: https://www.dta.gov.au/whole-government-architecture) as well as enabling developing nations to start with equity, transparency, inclusive accountability and human and machine-readable code in the foundations of their RAC.

The benefits of openly available RAC are:

  • Greater access to justice
  • Greater consistency with implementation of law/rules
  • Greater testability of law/rules, including across domains
  • Less unintended impacts from intersecting laws/rules
  • Ability to develop test-driven laws/rules
  • Ability to model and continuous test, monitor and manage laws/rules, in an agile and evidence driven way

Starting from a logic model, with an interdisciplinary, multicultural approach, co-drafting in both natural and computer languages creates new opportunities for monitoring and appealing. Finally, it provides a resource for anyone to adopt a RAC approach in their projects. In particular, those focused on reducing corruption and building trustless systems, will find it easier to communicate with governments and demonstrate their value proposition using a RAC approach, with this platform as a reference model. This repository will support their pitch to institutions that they are currently missing a valuable opportunity to create traceable, trustworthy, and equitable application of legislation across systems. With examples of solutions in hand, they will be able to ask questions such as; How do you audit in real-time? What does the citizen need to appeal the decision? What are the checks, balances, and oversights? How would you know if your system is helping or hurting people? How can you trace decisions back to their legal authorities?