Technology

Law As Code: A Legal System Shaped By Software

Americans pay more in legal fees than any other nation on earth. In the United States, legal costs — the price of settling disputes — accounted for about 2.3 percent of the whole economy, or roughly $429 billion, just five years ago.

Source: Institute for Legal Reform (2018), a program of the U.S. Chamber of Commerce

Yet the steep cost of justice is not just an abstract economic idea. A recent study found that small businesses cover more than half of all commercial liability expenses in the tort system. On average, a person filing for bankruptcy pays $3,000 in court and legal fees. A routine divorce costs $12,000. And complex business disputes can climb into the millions. Legal costs are so out of reach for many American families that specialized crowdfunding sites are appearing just to raise money for legal bills.

In civil cases — disputes between private people and corporations — there is no right to free counsel at all, although consumers may represent themselves. In practice, only the wealthy can afford expensive lawyers — top-firm attorneys can bill $1,500 an hour — which means people with resources are often able to tilt the outcome their way. A study by the U.S. Government Accountability Office, for instance, found that people who hired a lawyer to assist with disability benefits cases were three times more likely to win than those who did not.

As an engineer, I have long wished the law would work more like society’s operating system. In an ideal world, legal rules should be objective and easy to access. If we shift the justice system to a software-first model, we can increase transparency, automate repetitive tasks, and in some cases even remove the need for costly lawyers altogether.

In a world where more than 80 percent of low-income people cannot pay for legal help, technology can even the odds and extend existing legal know-how to everyone.

A brief history of lawyerly protectionism

In the 13th century, King Edward I wanted to form a new class of people who held the privilege of arguing cases in the Royal Courts of England. So he passed a 1292 statute, the first of its kind, giving the Lord Chief Justice the duty to appoint a certain number of “attorneys and lawyers of the best, and that those chosen only and no other, should practice.” More than 700 years later, limits on who may practice law still exist. Edward would likely approve of California Business and Professions Code 6125 (2020), which can punish non-lawyers with up to one year in county jail if they dare to represent someone in a courtroom.

By contrast, the internet has built a world where knowledge flows freely and is easy to reach. I taught myself to code on YouTube; there are countless websites that let people borrow from and build on existing code.

The first move in reworking the legal system is to use software to extend the expertise of the relatively small number of lawyers. The form needed to request asylum status, for example, asks a straightforward question: “Are you fluent in English?” When a refugee completes the form, they may be tempted to answer “yes” because they fear “no” sounds like a negative response, or because they can manage a basic conversation in English. If an immigrant says they are fluent, they may be giving up the right to an interpreter in court, which is something almost no one outside a lawyer would know. In this situation, technology supplied by the immigration court could alert the refugee to the hidden meaning of a “yes” answer, automatically translated into their language. By taking in information and clarifying questions, software can not only speed up completion of the form itself, but also duplicate the “insider expertise” of a lawyer explaining a form countless times. That is just one of software’s many strengths: limitless replication.

The form required to claim asylum status poses a simple question: “Are you fluent in English?” Software could not only save time in filling out the form itself, but could replicate the “insider expertise” of a lawyer.

An information problem

Over the past decade, with the arrival of more accessible software for publishing open source, we have seen the laws of entire countries (Germany, for example) uploaded online. But in 2021 in the United States, residents of some states cannot even inspect a copy of the law without paying a corporation. In Georgia, the complete set of official laws costs $1,207.02 because, Georgia’s Code Revision Commission says, their annotations are copyrighted and owned by the state. When technologist and public domain advocate Carl Malamud bought a copy and posted it online for free, the state sued him for copyright violations. (The Supreme Court stepped in last year; the case was later dropped.) Even so, many laws, annotations, and filings are still locked behind a paywall; PACER, the system containing federal court records, charges 10 cents a page.

The lack of access to information is not only a matter of cost. Even now, many veterans who served before 1960 struggle to prove they did so because a fire tore through the National Personnel Record Center in 1973, destroying 80 percent of the physical records there. At least the expensive PACER system is digital.

So where does software fit in? To create any useful software, engineers must connect with other, often external, applications through APIs. To check the weather on my smartphone, for instance, an app ultimately connects to the satellites actually recording the weather. In the same way, only when the legal system opens itself up like this will innovation become possible. I learned this directly while tracking Washington, D.C., parking codes. I was pleasantly surprised that D.C. stores the source of “truth” for its laws on Github; when a law changes, a piece of code (linked to the repo through a web-hook) instantly alerts me. When a resident spotted a confusing typo in 2018, he sent a pull request to the City Council, which agreed and merged the edits. Another benefit of software for literal law as code is the capacity to publish and update information publicly — a sharp contrast with printing on paper.

In practice, lawmakers have very little time to read thousands of pages of bills before they are voted on; for example, they had only a few hours to examine the first COVID relief bill, which was 5,593 pages long. If all laws could be discussed and edited through a pull request, the public could help officials uncover loopholes and special interests. These modern “legal repositories” might level the field by letting the public review laws before votes, rather than limiting that access to a select few.

Technology building blocks for a new system

These examples of software applied to legal code would bring immediate, wide-ranging incremental gains. But they also form the building blocks for automating legal decisions and bypassing the courtroom entirely.

In fact, uncontested legal cases are well suited to this kind of automation. Credit card companies are already using automated decisions to settle disputes between cardholders and merchants. When a Visa cardholder disputes a transaction that has already been refunded, the system will automatically close the case. The same tools could work effectively in small claims court.

To take one example, about a quarter of security deposits are never returned. Even worse, many landlords do not explain why they are keeping the money — former tenants often lack the resources (or the time) to sue them. Turning state security laws into digital code could have an enormous impact. In this case, any tenant could complete an online form that sends the landlord an email asking him or her to explain the reason for withholding the security deposit. Separately, the landlord could connect to financial APIs to show that the security deposit was refunded. If the landlord failed to reply, the court’s decision would be coded to automatically issue a judgement for the tenant. If they did reply, it would move to an online judge. This hypothetical process offers an ideal outcome: no judges, lawyers, or physical courtrooms would be involved in an uncontested case. The decision would be logged on a public ledger. And a major source of court disputes (“security deposit ghosting”) would be solved.

In time, such automated decisions can be expanded to the broad range of uncontested disputes that require jumping through bureaucratic hoops to get something done. Divorces, planning applications, traffic appeals, and countless other processes could be automated.

Of course, adding technology to any system can worsen or slow progress if it is not handled well. Filing taxes is a good example. It is unfortunate that the IRS has not created an online system for calculating taxes online, like the one used in the United Kingdom. (Perhaps America’s failure to build such a system can be partly explained by the more than $5 million that online tax preparation companies spend each year on lobbying.) As a result, the technology solution must be distributed widely enough to make sure no single institution can cement its own interests. One way to do that would be to make the codified justice system open source at the state level, so that individual cities and court systems can adjust it to fit their needs.

Technical debt is an even larger problem. Today’s cutting-edge technology may become trapped in tomorrow’s systems. New York’s online unemployment benefits application, created in the 1960s, could not cope with the strain of a 20 percent unemployment rate during the COVID pandemic. The Ohio unemployment website was reportedly able to handle only three people at once. And the federal government did not stop using floppy disks until 2016, long after their use was already fading and even obsolete.

Many solutions have been proposed to deal with these problems — from requiring lawyers and lawmakers to demonstrate technological proficiency through certifications, testing, and more to launching government initiatives that improve software development and procurement — but the fact remains that we are far behind in digitizing what, in many ways, is already a form of code.

* * *

In the end, district courts are unlikely to surrender their authority entirely to APIs. But a software-first approach does not need to be all or nothing. For the first time, many jurisdictions made the ability to use Zoom for court hearings mandatory last year. The permission to use e-signatures on dozens of IRS forms, at least temporarily, has saved countless hours. And lawyers are moving from paper filing cabinets to the cloud in greater numbers than ever.

While technology is unlikely to fully replace the justice system, automating minor or uncontested cases could relieve the (undeniably overburdened) current system so it can actually do what it does best — and concentrate on the work only humans, not machines, can do.

The arrival of software in any industry often draws fear-based warnings from lawmakers who do not grasp its advantages. But the legal system — along with the many people and businesses of every size harmed by its failings — needs us to lean in. By adopting software and breaking down information silos, we can redesign the legal process into a system that is more scalable, transparent, and equitable — one that genuinely serves everyone, rather than an obsolete relic that is too often opaque, expensive, or discriminatory.

About the author

Joshua Browder is the founder and CEO of DoNotPay, a legal-services automation company.