Digital technologies have transformed our lives, but they’re taking a lot longer to transform government. When citizens interact with public servants in many countries, they have to do so physically, going to offices, submitting signatures and sifting through paperwork. The exceptions stand out — Estonia’s digital services, and the initial work of the UK’s Government Digital Service among them — but for many, the very structure of the state acts as a brake on change.
The team working to drive New Zealand’s government into the digital age believes that part of the problem is the ways that laws themselves are written. Earlier this year, over a three-week experiment, they’ve tested the theory by rewriting legislation itself as software code.
Their work is turning heads: upon seeing a presentation by the team at the Digital Nations Summit in February, Estonia’s Chief Information Officer Siim Sikkut described legislation-as-code as “the most transformative idea” to come from it. It could be the key to creating more and better digital services, and laying the groundwork for the safe use of artificial intelligence in the public sector. But has the team shown that such an approach can work?
• For more like this, see our digital government newsfeed.
Legislation is the rulebook by which governments, and the societies they run, operate. On one side it informs public servants how to act, and on the other, tells citizens what they can do and what they are entitled to.
Currently, legislation is written for human consumption. Alongside the public servants who implement a policy, private sector organisations and the public have to read and interpret the language within laws. More often than not, interpretations vary, as different people along the chain can have subtly different definitions for terms within law.
For a private organisation required to comply, it means hiring a lawyer to make sense of government rules. For the public, it means understanding whether or not they are eligible for a benefit. And for the teams within government tasked with delivery, it means working out how to create a system that can ensure the legislation is implemented efficiently, which nowadays, more often than not, means making it digital.
The problem with this is that legislation is often written in a way that makes it incompatible with digital delivery. “Legislation gets drafted every day all around the world that does subtle things that actually make it impossible to implement digital services,” said Pia Andrews, Service Integration Lead at New Zealand’s Department of Internal Affairs and a member of the team behind the experiment. “The amount of times that legislation will say that you need a signature, or you need a witness, or you need to drop it off by post.”
Rewriting the rulebook
The team in New Zealand, led by the government’s service innovations team LabPlus, has attempted to improve the interpretation of legislation and vastly ease the creation of digital services by rewriting legislation as code.
Legislation-as-code means taking the “rules” or components of legislation — its logic, requirements and exemptions — and laying them out programmatically so that it can be parsed by a machine. If law can be broken down by a machine, then anyone, even those who aren’t legally trained, can work with it. It helps to standardise the rules in a consistent language across an entire system, giving a view of services, compliance and all the different rules of government.
Over the course of three weeks the team in New Zealand rewrote two sets of legislation as software code: the Rates Rebate Act, a tax rebate designed to lower the costs of owning a home for people on low incomes, and the Holidays Act, which was enacted to grant each employee in New Zealand a guaranteed four weeks a year of holiday.
“It is critical that we actually build the foundations of digital government in an open, transparent way”
The way that both policies are written makes them difficult to interpret, and, consequently, deliver. They were written for a paper-based world, and require different service responses from distinct bodies within government based on what the legal status of the citizen using them is. For instance, the residents of retirement villages are eligible to rebates through the Rates Rebate Act, but access it via different people and provide different information than normal ratepayers.
The teams worked to rewrite the legislation, first as “pseudocode” — the rules behind the legislation in a logical chain — then as human-readable legislation and finally as software code, designed to make it far easier for public servants and the public to work out who was eligible for what outcome. In the end, the team had working code for how to digitally deliver two policies.
A step towards digital government
The implications of such techniques are significant. Firstly, machine-readable legislation could speed up interactions between government and business, sparing private organisations the costs in time and money they currently spend interpreting the laws they need to comply with.
If legislation changes, the machine can process it automatically and consistently, saving the cost of employing an expert, or a lawyer, to do this job.
More transformatively for policymaking itself, machine-readable legislation allows public servants to test the impact of policy before they implement it.
“What happens currently is that people design the policy up front and wait to see how it works when you eventually deploy it,” said Richard Pope, one of the original pioneers in the UK’s Government Digital Service (GDS) and the co-author of the UK’s digital service standard. “A better approach is to design the legislation in such a way that gives the teams that are making and delivering a service enough wiggle room to be able to test things.”
Tech companies, such as Google and Facebook, test new features iteratively, building prototypes and putting them in front of people to see if it works. Policymakers could work similarly, building software models to test the impact of different laws before they are implemented, creating and running different and varied user profiles through the legislation to see how a service would work in different circumstances.
Bodies outside government such as think tanks, businesses, news organisations or regulators could also do this, increasing the transparency and accountability of government. This, for Andrews, is the way digital government can be made a success. “It is critical that we actually build the foundations of digital government in an open, transparent way, otherwise it just can’t last and it can’t scale,” she said.
As government starts to use more automation and artificial intelligence in public services, this need for transparency will only increase. Often, the complexity of the algorithms which power AI, and the masses of data they use, are unfeasible for humans to audit without machine assistance. When a computer’s very purpose is to process an amount of information that a human would find it impossible to, monitoring the laws which put these machines in place requires the same technology.
To ensure these AI systems are accountable, there needs to be a way to search through a law to test its effects. The body of the legislation which sets AI to work in public services, and the contents of it, would therefore also need to be machine readable. “If you don’t have your legislation as machine-readable code, it is almost impossible to ensure traceable and accountable decision making,” said Andrews.
“I think there’s huge possibility in machine-readable legislation for transparency-at-point-of-use and in automated testing of government data,” said Pope. “But we need to test those use cases for real.”
The foundations of reform
But not all legislation can be rewritten to make it machine-readable. The approach primarily applies to the laws that governs services, where rules of eligibility and calculation make up the body of the law.
For instance, legislation for the allocation of welfare benefits, and compliance, where external bodies must conform to set rules. Machine-readable law is not naturally suited to laws which require a human judgement, and LabPlus’s experiment carefully defined the limits of the approach.
Since at least 1960, when legal scholars and industry leaders met at the first National Law and Electronics Conference in California, people have understood the value of machine-readable law. It is yet to become a reality, and LabPlus’s exploration remains a small experiment within the larger New Zealand government. But if, as results suggest, it can fulfil its promise, it could have a big impact on the way governments around the world go forward with digital reform.
(Picture credit: Pexels/Kevin Ku)