Can coding agents modernize the U.S. Constitution? by Ed Lyons
“Ultimate legacy modernization” by Ed Lyons via Midjourney
Coding agents are fantastic at going through codebases and documenting them. When properly orchestrated, they are also fast and effective at updating code.
But can they quickly convert legacy code into modern applications?
Anthropic released a demonstration video making it look quite easy to update a small COBOL application in just hours. Other firms are now claiming that a software factory of agents can simply ingest all of your legacy code and requirements, and then produce finished new applications.
Are these things true? Generally speaking, no. But these propositions are causing some people to think updating legacy applications is a solved problem.
Alas, it is still very challenging in most cases, despite the incredible powers of AI.
The Ultimate Legacy Application
To explain why agents cannot do this work by themselves, I will demonstrate rapid agent modernization on something very similar to an enterprise legacy application: The United States Constitution.
This sounds strange, yet the situation is familiar. Like any old code that is still running, it’s extremely valuable, and changing it over the years has been difficult, expensive, and rare. The people who wrote the original version are long gone. We still aren’t sure exactly what they meant in some of the writing (what is “a well-regulated militia”?), and we don’t have good documentation about what they did. There are also errors and limitations in it, and not all have been corrected over time. The maintenance costs are, to be frank, quite high. And if we were going to write a governing document today, we certainly wouldn’t create this exact framework. I think most people would agree.
But we have AI now, so let’s do it!
So I asked Claude the following:
“I would like you to go get the text for the United States Constitution. Then I would like you to update it for our current times. We are not the same country as we were in 1789. Please make the appropriate updates and then show me the resulting text.”
Claude was really into it, and was going to try to keep it as similar and non-partisan as possible, even though I didn’t ask for those things:
“This is a genuinely fascinating intellectual exercise. I have the full structure of the Constitution well in hand from my knowledge and the search results. Let me now draft a comprehensive modernized version - updating archaic language, removing obsolete provisions, incorporating all 27 amendments into the body text (where they logically belong), and adding new provisions that address modern realities: digital privacy, technology governance, campaign finance, judicial term limits, environmental stewardship, and more.
I'll present clearly where I've made changes and why, and I'll strive to be nonpartisan - addressing structural anachronisms and clear modern needs rather than advancing any political agenda.”
Of course, the agent took all kinds of unauthorized liberties in making changes (as they will do if you do not keep an eye on them) and added a section on congressional term limits, even though this is controversial and, in my view, undesirable:
And after about 10 minutes, it gave me a new version. It looked completely reasonable to me. I did a careful, 20-minute review and it looked great. I was ready to push this to production. Can I tell all Americans to call a constitutional convention and adopt this? It’s certainly better than what we have now. And I did review the code carefully, and that’s what counts, right?
Yet… having worked on real modernization projects, I thought of the following issues that Claude did not. I will address them one at a time.
Context and Ideas
Architecture
Stakeholders
Dependencies
The Features Backlog
Quality
Maintenance
Context and Ideas
An observer might look at what Claude wrote and say, “Just because everyone agrees our constitution is out of date, doesn’t mean you can just have AI update it. It takes great expertise to understand this document. You need to know the ideas it is based upon, and what the historical context was.”
That’s true. I would need to think about what problems it was trying to solve, and then decide if the new version should try to solve the same problems, or address new ones. Also, people today may have different ideas about government than they did 250 years ago.
Architecture
What about the architecture? It’s one thing to have each old-style paragraph be converted to a newer version with similar words, which is not difficult for coding agents. Yet that’s not what we really want, is it? And apart from the structure of the document, what about the structure of the government? We probably do not want the identical architecture. But simply ingesting the legacy code will not produce the architecture we would like. Yes, you can tell agents what architecture you want, but someone has to figure out what that will be.
Stakeholders
After that, a political expert might say there are different constituencies this framework must satisfy: citizens who want certain protections and benefits they will experience, policy makers who care about how their causes will be affected, business people who want a stable system of rules and conflict resolution, state governments who want to preserve their own power, as well as lawyers and judges who will work through the consequences of that governing document each day. How will you manage their conflicting priorities? They are not going to allow a language model to decide what happens without their consent.
And the politics can be very frustrating. While some people are enthusiastic about modernization, there are others who are not interested, and even some who will oppose the entire project, as the current document is serving them just fine. How is Claude going to get those people to agree on how to move forward?
Unseen dependencies
A legal expert would also point out the following: “The details of our constitution and previous court decisions around them affect millions of people. Many other laws and processes are connected to pieces of it. Even if the new document looks fine to reviewers, there are going to be impacts that aren’t immediately obvious.”
A backlog of feature requests
Speaking of the stakeholder groups, in return for going through this costly process they are going to want new features. Once again, the agents will not know any of this by looking at the legacy code. There will certainly be disagreement on what the features should be, and how much risk is involved.
I did experiment with adding and removing features in my new constitution. It was fun, but it wasn’t long before I realized that this kind of change would have consequences I could not predict.
Yet there is no escaping this. Most modernization projects will need new features to help justify the cost and gain support. Figuring out what they should be, and how much more risk can be added to the overall project is a task for experienced experts.
Quality
A constitutional law scholar might look at our new document and say, “The Constitution is old, but it has been through a lot. It’s well tested. How will you prove your new framework is robust? How will it withstand challenges and unexpected circumstances?”
In agentic development, the answer is often to add more tests that anticipate problems. And it is easy to rapidly generate thousands of tests with agents.
For our new constitution, I could ask a swarm of long-running agents, orchestrated in very clever ways, to research thousands of possible policy and political problems, using previous constitutional law articles and court decisions. I could then run those tests and modify the document according to the results. Leaving aside how many billions of tokens this exercise would consume, how much confidence would people have that all the simulations made the document ready for the future?
My own experiments using agents with legacy code have taught me that agent-generated tests are unreliable. For example, I once modernized a COBOL application into modern Java. I created thousands of tests that all passed. Yet the application would not even launch. When I finally got it to run, it was broken in several areas.
Test code should not be mindlessly generated. Designing quality tests involves a lot of human judgment and cannot be done rapidly.
A Phased Rollout?
Seeing all of these frictions, politics, and risks, I might decide that a complete rewrite is not feasible. Perhaps I will make the changes in phases. I could ask Claude to come up with an iterative approach. But what to do in each phase is not easy to determine, and involves a lot of planning and meetings with stakeholders, who will sometimes not agree.
Governance and Maintenance
And even if I came up with a plan to roll out my new constitution, what would be the process for maintaining this new governing framework? (The agent demos never speak of governance or maintenance.) Few people like the existing amendment process, as our society changes much faster than it did centuries ago. How would I modify that process?
If AI is the answer to everything, perhaps I could have long-running agents keep track of policy problems and changes in our society. It could produce a “pull request” of new features and changes to be reviewed by state legislatures every year, and they could vote on them.
But at this point, I hope it’s apparent that agents should be simply be tools, and cannot make decisions for us.
Conclusion
So it doesn’t look like my idea for rapidly modernizing the US constitution is going to work, but it would be a fun thing to try with your children when they are learning about government in high school.
Updating the constitution would be vastly harder than updating a legacy banking application, but as a project, it would have many similarities that are not apparent from watching agent modernization demos.
There are some legacy applications that can be modernized more quickly and easily. They are smaller, low-level applications with well-defined contracts. Or they have very few users, and the business requirements are already known. Yet most legacy applications are not like this.
Legacy modernization is a journey, not a one-week coding exercise. It must be led by experienced humans who will gather expertise and support from other humans who have different experiences and concerns. Agents are very powerful tools for refactoring experiments and implementation work. They do speed up and improve many tasks on a modernization project. But they cannot provide the judgment, listening skills, wisdom, or consensus-building activities that can only be performed by skilled human architects and managers.