Unlocking the potential of public-service digitization

| Article

Necessity is the mother of invention, and as many governments have learned during COVID-19, it is also the mother of the drive toward digitization. Pandemic lockdowns compelled many governments to move functions and services online—bringing to bear benefits, such as a better user experience, that had long been touted.1Digital public services: How to achieve fast transformation at scale,” McKinsey, July 15, 2020. But the push to accelerate the digital transformation has also uncovered the challenges involving how legislation’s compatibility with digitization, or lack thereof, can affect such efforts.

Policy makers often write legislation governing public services in a way that requires people to authenticate themselves in person and sign forms in wet ink—analog attributes that do not lend themselves to migrating services online. Other challenges in smoothing the way to digitization can lie in requirements for service users to submit information that is not already stored in the required format to an existing government database or in ambiguous legal rules that require human interpretation.

To apply legislation more seamlessly in digital contexts, some governments have created standardized digital-compatibility checks for legal texts.2 These checks could be complemented by an approach called “rules as code” that translates legal text into language that a computer can read. The approach could help governments pinpoint and resolve digital-compatibility issues within legal texts and deliver more user-friendly and efficient digital services to the people they serve.

What does digital compatibility mean?

It is important to acknowledge that some legal rules don’t easily lend themselves to digitization but are, nevertheless, necessary to ensure good governance. In many cases, public agencies need personal information that is not already stored in government databases. And some legislative rules governing public services are not necessarily good candidates for digitization because they help mitigate potential fraud and abuse. When, for example, someone requests an official identification document, such as a passport or birth certificate, a personal visit may be necessary to validate the person’s identity. At the same time, some decisions required in individual cases may be beyond the scope of digital systems and therefore require officials to exercise their judgment.

But many legal rules that don’t translate into a smooth online user experience or that are structured in ways that challenge automated service delivery could become digitally compatible without compromising governance. McKinsey estimates that more than 60 percent of the work done by public administration officials to deliver services could, in principle, be automated.3How governments can harness the power of automation at scale,” McKinsey, February 1, 2019. Some functions traditionally done by public servants—such as initial assessments of benefits applications—could be digitized. Greater automation could also save public services time and money and help the people accessing these services get fast responses to important and often urgent matters instead of waiting weeks or months for an administrative decision.

What specific issues with digital compatibility can arise from legal texts? We have outlined six steps in a typical user experience; five illustrate how rules designed for an analog era can present potential challenges (Exhibit 1).

1
Legal rules can be a major impediment to the digitization and automation of processes.
  1. Information. First, users need to understand what is required to access a public service. Public administrations could consider ways to enhance information provided online—for example, by simplifying language and navigation or enhancing accessibility. Legislation typically does not hinder or prevent this approach.
  2. Authentication. For most public services, authenticating users could become as easy as logging into an online bank account. Yet legislation might rule out the use of digital identification altogether or permit only apps that are challenging to use.
  3. Data entry. Legal requirements often mandate that public agencies collect information through an application form, rather than use data that are on file. In some instances, the requested information has not been collected previously. Other times, it has been collected by another government department but formatted in a way that does not match the prescribed format of another agency. If existing data are available and are the right format, public agencies often require legal authorization to access or share them with other government entities or across levels of government (such as the state level to the federal level). In some jurisdictions, privacy rules may also limit access to personal information regardless of explicit consent.4Government data management for the digital age,” McKinsey, September 20, 2021.
  4. Submission. Customers in many countries can enter a mobile-phone contract or open a bank account without having to send documents through traditional mail or having to visit a branch in person. For public services, submitting applications online might not be an option if they require a physical signature (rather than a digital signature), paper copies of supporting documents, or an in-person appearance.
  5. Case management. Once a service application is submitted, companies in the private sector increasingly send customer requests “straight through” for processing, such as insurance companies that automate risk assessments when issuing basic policies. Immediate digital feedback is less common in the public sector. One reason may be that the legal rules governing case management require human interpretation, so a government official needs to review the service application to process it.
  6. Communication. Even when users can submit application forms online, public agencies are often restricted from responding on the same channel and must deliver official communication through physical mail to make the message legally binding.

For most public services, authenticating users could become as easy as logging into an online bank account.

Checking the digital compatibility of legislation

To promote moves toward digital automation, some governments perform digital-compatibility checks while legislation is being drafted. In Denmark, the Agency for Digital Government reviews proposed legislation against seven principles and submits its findings to the Danish parliament before a bill is considered. The principles covered by the assessment include the following5:

  1. Simple and clear rules. Legislation should be written in accessible language to make it easier to administer.
  2. Digital communication. Legislation must support digital communication between the government and citizens or businesses.
  3. Possibility of automated case processing. Legislation should support complete or partial digital administration, if possible, without encroaching on the legal rights of citizens or businesses.
  4. Consistency across authorities. Authorities should reuse concepts and data definitions as much as possible to facilitate using information from existing databases.
  5. Safe and secure data handling. Legislation should make data security and the protection of personal information a high priority.
  6. Use of public infrastructure. Legislation should prescribe the use of existing government IT solutions (for example, digital IDs) in service administration whenever possible.
  7. Prevention of fraud and errors. Legislation should permit digital fraud controls wherever possible (such as authorization checks of relevant information against existing government registers).

Increasingly, other countries are seeing the Danish model as one to emulate. For example, Germany is planning to introduce a similar review mechanism in 2023.6 Many countries have updated individual laws to allow for digital service delivery (see sidebar, “How governments have updated laws to enhance digitization”). However, testing the digital compatibility of legal rules can be complicated. Governments may want to consider a legaltech7 innovation known as “rules as code” to support such checks.

Modeling legal rules as code to boost the effectiveness of digital-compatibility checks

Rules as code is an approach that converts written language in legal texts into a series of connected, logical statements that a computer can easily read. Applying this method leaves the meaning and intent of legislation intact. The difference is that law—which, in the context of public services, contains instructions for administrators on how to deliver a service—is represented as code, either in visual form (sometimes called “rulemapping”8) or in language a computer can understand.

The coded version of a law that governs a public service uses various outcomes of a transaction as a starting point for making legislation digitally compatible—for example, approving an application for a license—and then lists the conditions needed to meet a particular outcome, such as someone being old enough to apply for a license. Exhibit 2 illustrates how natural language could be translated into coded rules.

2
A coded version of a law can help to identify whether legislation is digital-ready.

Modeling legal rules as visual code helps make the underlying logic of the rules more accessible to public administrators, IT experts, and legislators. This opens a forum for interdisciplinary conversations on how to optimize the legislation governing public services, including with respect to digital compatibility. In contrast, natural-language versions of laws are often challenging to interpret. When it comes to understanding the rules for a specific public service, written in natural language, public administrators may need to interpret hundreds of pages of legal text, distributed across multiple interdependent laws and regulations.

Some challenges to service digitization are easy to identify, such as requirements for authentication, signatures, and personal appointments. However, others can be more difficult to spot. A code model of legal rules helps pinpoint three common challenges to service digitization:

Requirements to use data that are not stored in existing databases. Rules for a specific public service might require collecting information that is not stored on an existing government IT system. While this is sometimes necessary, lawmakers may want to consider which data are needed to deliver a service. Any requirement to use information that cannot be pulled from an existing database reduces the potential for automation. To facilitate the reuse of existing data, governments may consider maintaining a catalog of “standardized information objects” that can be accessed from digital sources. Lawmakers could use this catalog to review which data can be used easily for public-service delivery and which information is outside the scope.

Nonstandardized concepts and definitions. Legislation often refers to concepts that have multiple definitions and interpretations. For example, German administrative law uses the term “income” in different ways.9 Legal text that uses standardized concepts makes it easier to reuse data across government agencies. Here, too, it may help if lawmakers consider referring to a catalog of standardized information objects when drafting legal rules.

Human discretion in case management. Some public services require civil servants to exercise discretion on specific decisions, such as checking if a proposed renovation complies with historic preservation mandates. But in other cases, limiting automation potential through building in the need for human judgment can affect delivery cost and user experience. This limitation could be addressed by highlighting when legal rules require human discretion in case management so lawmakers can decide whether it is truly needed. Identifying requirements for human discretion is straightforward if a law explicitly says a civil servant must decide. But often the problem is harder to pinpoint. Many rules permit multiple outcomes for a specific case, so it is necessary for a person to make the final call. A code model of a legal text highlights such ambiguities, enabling lawmakers to clarify their intention. This facilitates automation and promotes legal certainty of administrative decisions.10

If barriers such as these are removed, public agencies could boost automation to improve the user experience and potentially save time and money. Moreover, developing software applications for service delivery is simplified if machine-readable versions of legislation are available. These machine-readable versions only need to be fed into a standardized rules engine to process the data inputs required to decide cases—potentially saving significant IT development effort.

Implementing digital-compatibility checks based on rules as code

With thousands of laws on the books, the task of using digital-compatibility checks based on code models of legislation is potentially vast. A government could consider launching a pilot that focuses on a specific service and its underlying legal rules. The pilot can help illustrate the potential effect of laws expressed in code and exhibit how to scale the approach to add more legislation. When launching a pilot, a government could consider the following three principles to guide efforts:

A digital-compatibility check may be most useful for legal rules that govern services with high automation potential and significant case volume.

Consider the impact potential of legal rules to review. A digital-compatibility check may be most useful for legal rules that govern services with high automation potential and significant case volume. Leveraging a code model to support the check is helpful if the rules are complex and service administration is needed to process many data points. This often holds true for laws governing tax, social benefits, or building code permissions. In contrast, rules for services requiring a deep understanding of individual cases may be less suitable.

Involve the relevant stakeholders and build an interdisciplinary team. A major challenge of improving the digital compatibility of legislation is bringing together stakeholders who are normally siloed from one another. Lawmakers who decide on legal changes, civil servants who prepare legislative drafts, and public administrators who deliver services could consider working together in laboratory-like settings that lend themselves to greater agility than standard workflow processes. Legaltech providers could supply the tools for translating law into code and help build the capabilities of lab participants.

Take an end-to-end approach from reviewing legal rules to digital implementation. Ideally, a pilot moves out of the lab for testing in the real world. To examine whether rules boost digital service delivery, the project team could work with the relevant agencies to implement new processes and IT to ensure coded rules work as intended.

If a pilot delivers clear positive social and administrative impact, governments could then consider the structural measures required to scale the rules-as-code approach, including how to build digital-compatibility checks into the legislative drafting process, how to standardize the methods applied (for example, code language and tooling), how to build a government data catalog that lawmakers can leverage to optimize the reuse of existing database information, and how to build a common understanding among relevant stakeholders about the benefits of digitally compatible legal rules.


Digitally compatible legislation for public services is becoming more important as governments move into the digital future, from online service portals to automated case management. Using rules as code could be a key step in helping governments identify obstacles for service digitization early in the process or remove them where needed. This shift could transform the user experience and free up resources for tasks that continue to require human creativity and judgment.

Explore a career with us