Why Is AI Transforming Coding Faster Than Legal Work?
I recently had a conversation with a friend about a question that I find increasingly interesting: why has generative AI already produced such visible, and arguably structural, change in engineering—especially in coding—while the impact of AI on legal work still feels comparatively incremental?
One intuitive answer is that coding may simply be easier for AI to replace, while many parts of legal work still require things machines cannot do.
There is some truth in that. But I do not think the deepest distinction is that programmers do simpler work than lawyers, or that law somehow requires more intelligence than software engineering.
The more fundamental difference may be this:
Coding is much easier to turn into a closed loop in which AI can act, test its own output, detect failure, and correct itself.
That may be one of the main reasons why the AI revolution has arrived in software engineering first.
1. The key advantage of coding is not simplicity. It is verifiability.
A coding agent today can increasingly perform an entire sequence of work:
read a repository, understand an issue, change the code, run the program, execute tests, detect errors, revise the code, test again, and eventually submit the result.
The workflow looks roughly like this:
Generate → Run → Test → Fail → Fix → Run Again
The most important feature is not that the AI produces perfect code on the first try.
The most important feature is that the system itself can tell the AI that it is wrong.
Does the code compile?
Do the tests pass?
Does the API return the expected result?
Does performance stay within the required threshold?
These questions often generate relatively clear feedback.
As a result, even if the coding agent fails on the first attempt, it can continue iterating until the system accepts the result.
Software engineering, in other words, provides an unusually strong feedback loop.
Legal work does not.
Suppose an AI system advises an in-house lawyer:
“In this situation, the company should consider making a voluntary disclosure to the regulator.”
How do you test that?
There is no button that runs a legal-advice test and returns either “PASS” or “FAIL.”
The correctness of legal advice is often not binary.
It may depend simultaneously on black-letter law, enforcement practice, regulatory probability, corporate risk appetite, government relations, business interests, reputation, global policy, internal precedent, and future developments.
Two excellent lawyers looking at exactly the same facts may reach different recommendations.
And neither may necessarily be wrong.
That creates one of the most important structural constraints on legal AI:
Generation is becoming cheap. Verification remains expensive.
AI is becoming increasingly capable of producing a legal answer.
But deciding whether that answer should be trusted still requires costly human judgment.
2. Software engineering and legal work operate in fundamentally different environments
There is another important difference: the outputs of coding and legal work ultimately face different kinds of systems.
Code ultimately has to face a machine.
Machines are relatively honest.
They will not accept a broken API because you have a good relationship with them.
They will not reinterpret a piece of Python six months later because the political environment has changed.
Code must eventually run.
That means a large portion of engineering output can be evaluated through system behavior.
Legal work ultimately faces something very different:
people and institutions.
How will a regulator interpret the issue?
How will a judge decide?
Will the counterparty accept the position?
How much risk is the board willing to bear?
How will the public react?
Will the same government agency take the same view six months from now?
There is no stable runtime environment for these questions.
So the distinction can be stated quite simply:
Coding operates in a machine-native environment.
Legal work operates in a human-and-institution-native environment.
Those two environments have very different levels of AI-friendliness.
3. Legal problems often begin before the objective is even clearly defined
Many coding tasks are relatively easy to specify.
For example:
build an API endpoint;
accept a user ID;
query the database;
return structured data;
keep response time below 200 milliseconds;
add automated tests.
This does not mean the task is easy.
It means that “done” can usually be described with reasonable precision.
Legal work is often very different.
An in-house lawyer may receive a question such as:
“The government called this morning. What do you think we should do?”
Behind that sentence may sit a dozen separate questions.
Is this a formal investigation or an informal inquiry?
Why are they asking now?
Has the company handled a similar situation before?
Does headquarters know?
Do we want to cooperate?
Will cooperation create a precedent?
Will refusal lead to escalation?
What does Chinese law require?
Is there a conflict with U.S. law?
What does the business actually want to achieve?
Who should speak with the government?
Much of the most important context may not exist in any database.
It may exist in someone’s head.
It may exist in organizational history.
It may come from an understanding of a particular regulator.
It may be embedded in tacit knowledge built up over the last ten meetings.
Senior legal work is therefore often not primarily an information-retrieval problem.
It is a problem of:
context reconstruction.
And that is still something AI has difficulty obtaining in full.
4. Legal work is often not about finding the answer. It is about deciding what the answer should optimize for.
AI is particularly strong at a certain type of problem:
Given X, find Y.
But much of senior legal work is closer to:
What should X be?
Consider a company asking:
“Can we launch this product?”
At a relatively junior level, the legal question may be:
“Does the law permit it?”
At the GC or senior-counsel level, the real question is often:
“How much risk are we willing to take across law, regulatory relationships, commercial opportunity, brand impact, and future precedent?”
At that point, the task is no longer purely legal reasoning.
It contains:
judgment,
value choices,
organizational authority,
and accountability.
AI can identify the options.
It can explain the risks associated with each one.
It may even be able to simulate likely regulatory responses.
But someone still has to say:
We are willing to take this risk.
That act is fundamentally one of agency.
This is why I increasingly think that legal AI cannot be understood only as a question of intelligence.
It must also be understood as a question of authority and responsibility.
Who has the authority to decide?
Who bears the consequences?
Who is accountable when things go wrong?
5. None of this means that legal work will be protected from AI
Quite the opposite.
I think the legal industry may ultimately experience enormous disruption.
But the path will not look exactly like software engineering.
Many legal tasks are already highly susceptible to automation or compression.
For example:
clause extraction;
document comparison;
due diligence;
case chronology;
standard legal research;
regulatory mapping;
first drafts;
policy comparison;
discovery review;
large volumes of standardized contract work.
What do these tasks have in common?
The input is relatively bounded.
The output is relatively specified.
The relevant sources are relatively identifiable.
Verification is relatively easy.
In other words, they increasingly resemble coding.
So the better question is not:
“Will AI replace legal work?”
It is:
How code-like is this legal task?
The more a legal task can be reduced to clear inputs, clear outputs, verifiable results, and iterative correction, the faster AI will penetrate it.
By contrast, the more a task depends on relationships, ambiguous goals, institutional power, judgment, and irreversible consequences, the slower autonomous AI execution will be.
6. A simple framework for AI substitutability
One way to think about this is to evaluate any task across several dimensions.
Formalizability
Can the task be clearly specified?
Verifiability
Can the result be checked cheaply and reliably?
Digital availability
Is the relevant context and data already digitized and accessible?
Reversibility
If the system makes a mistake, can the error be easily rolled back?
And finally:
Judgment density
How much normative, institutional, interpersonal, or commercial judgment is required?
Coding often has:
high formalizability;
very high verifiability;
very high digital availability;
relatively high reversibility;
and moderate judgment density.
That makes it unusually receptive to AI.
Legal work often looks very different.
Of all these variables, I suspect that the most important is:
verifiability.
Whether AI can replace a person does not depend primarily on whether the AI gets the answer right on the first attempt.
It depends on whether, when AI gets the answer wrong, the system can tell it that it is wrong.
That is the great advantage of coding.
And it is one of the great constraints on legal AI.
7. The deeper risk may not be that lawyers disappear, but that the production layer of the profession gets hollowed out
Traditionally, the legal profession has looked something like a pyramid:
senior lawyers;
mid-level lawyers;
junior lawyers;
paralegals.
Junior lawyers perform large amounts of research, review, drafting, and due diligence.
Through that work, they gradually develop judgment.
AI may change the structure.
Senior lawyers may increasingly focus on judgment, agency, and relationships, while a large AI layer performs much of the production work below them.
Research, drafting, review, comparison, and summarization could increasingly be handled by machines.
That means AI may not eliminate senior lawyers first.
It may first compress the production work traditionally performed by junior and mid-level lawyers.
But this creates a much deeper problem:
If judgment was historically learned through production, where will future senior judgment come from once machines perform most of that production?
A lawyer may historically have developed intuition by reading one hundred cases, revising fifty contracts, and writing thirty memoranda.
If young lawyers increasingly spend their time merely approving AI output, will they lose the opportunity to develop the instincts that senior judgment requires?
That suggests that the long-term challenge of legal AI may not be:
“How do we replace lawyers?”
It may instead be:
How do we train human judgment in a world where machines perform most of the production?
I do not think the profession has fully confronted that question yet.
8. Engineering may simply be one generation ahead of law
Coding is already moving from:
“Help me write this code.”
to:
“Here is the problem. Go solve it.”
That is the transition from assistance to agency.
Legal AI is still, in most cases, operating at an earlier stage:
help me research;
help me summarize;
help me draft;
help me review;
help me analyze.
The real legal AI revolution may begin when the instruction becomes:
“Here is the matter. Run the workflow.”
Imagine a future legal agent that can:
receive a regulatory request;
find relevant historical matters inside the company;
research the applicable law;
retrieve internal policy;
identify relevant stakeholders;
generate a risk matrix;
draft the response;
recommend whether escalation is required;
update the matter-management system;
track deadlines;
and finally submit the package to a lawyer for approval.
At that point, legal work would truly begin to enter the agentic era.
So perhaps software engineering and legal work are not following fundamentally different paths.
Engineering may simply be showing us part of the future earlier.
9. What AI is really changing is not who is smarter, but what becomes cheap
Historically, high-quality production was expensive.
Code was expensive.
Legal research was expensive.
Contract drafting was expensive.
Analysis was expensive.
AI is making production cheaper.
And when production becomes cheap, professional value moves elsewhere.
In engineering, value may increasingly shift toward architecture, product judgment, system design, and orchestration.
The same may happen in law.
Once research, drafting, comparison, and summarization become inexpensive, the scarce resources may increasingly become:
judgment, agency, trust, and accountability.
That is why I increasingly find the question “Will AI replace lawyers?” too narrow.
A better question may be:
When answers become cheap, what remains worth having humans do?
My tentative answer is this:
AI will become increasingly good at producing answers.
But humans will still have to decide:
which answers deserve to be trusted;
which risks are worth taking;
which objectives are worth pursuing;
and ultimately, where we want those answers to take the organization.
That may be the deeper transformation of professional work in the AI era:
AI makes production cheap. Human value moves toward judgment and agency.
If you liked this:
My newsletter has more "signal → action" content.
Leave your email, and I'll send you new signals first.