Red Teaming AI in the Legal System

Colin Doyle examines how artificial intelligence and data-driven tools can address enduring problems in the law. A novel seminar has students rooting out high-tech pitfalls.

By Andrew Faught

Watch Professor Doyle's Featured Insights video

When Professor Colin Doyle developed his “Law and AI Lab,” he built in a directive for his students: Don’t be afraid of technology. Push it, challenge it, and break it.

“Watch as AI amazes you in one moment and falls flat on its face in the next moment,” says Doyle, who debuted the seminar at LMU Loyola Law School (LLS) this spring.

Doyle takes the same approach with his research and scholarship, which focuses largely on emerging technology, including artificial intelligence and machine learning. In his view, technology provides an opportunity for the legal profession, and for his students, to revisit fundamental questions about the field.

“Too often, the conversation is about how the law can keep up,” Doyle says. “But technology can also give us a new way to think about enduring problems.”

No doubt, AI is remaking the legal profession, with technology ably performing document review, legal research, and contract analyses, saving law firms countless hours in the process. But he has a deeper concern: inequality.

Wealthier parties, including corporations, landlords, and financial institutions, have strong incentives to invest heavily in AI. If their tools improve faster than those available to low-income litigants, the technology could widen the very gaps it aims to close.

“It’s not just whether AI helps,” Doyle says. “It’s who it helps, and how much. We have far more people facing serious legal problems than we have lawyers able to represent them. There’s a real hope that AI, with all of its promise, can make a difference for the underserved."

But that hope is tempered by recurrent challenges. Producing a document that looks like a legal motion is not the same as producing one that is legally sound. When algorithms produce biased outcomes, the instinct is to fix the algorithm. But Doyle encourages a different perspective to his students: What if the algorithm is exposing something about the legal system itself?

“In addition to asking how to make the technology fair, we can ask what it’s showing us about fairness in the law,” he says.

Nowhere is that tension more visible than in access to justice.

AI, it turns out, acts as both mirror and prism, Doyle adds. It reflects patterns already present in legal systems, trends that may include bias or inequity. It also bends and distorts those patterns, creating new forms of error and new challenges for accountability.

Concerns about algorithmic fairness emerged in response to earlier generations of automated decision-making systems. Researchers found that algorithms used in activities like sentencing, facial recognition, and hiring could produce biased outcomes, often reflecting disparities present in the data on which they were trained.

“It’s not just about making the system fairer. It’s about asking whether the automated system should exist in the first place.”

The initial response focused on fixing the algorithms, adjusting them to reduce bias. But a more critical perspective, one that informs Doyle’s work, considers a different question.

“It’s not just about making the system fairer,” he says. “It’s about asking whether the automated system should exist in the first place.”

He has addressed the issue in a co-authored paper, Studying Up: Reorienting the Study of Algorithmic Fairness Around Issues of Power.” He calls the article “provocative” because “it flips the script on algorithmic risk assessments by building a risk assessment tool that instead of predicting the risk of criminal defendants, predicts the risk of judges violating the Constitution by incarcerating someone pretrial without due process.”

Of course, reliability in AI remains a central issue. A tool that produces fluent legal language isn’t necessarily producing valid legal arguments. And in high-stakes situations, such as evictions, debt collection, and family disputes, errors carry consequences.

Doyle points to a growing database of legal cases in which attorneys submitted court filings that contained nonexistent citations. The source? AI tools that produced seemingly plausible but entirely fictional case law.

“These systems don’t have a connection to the real world,” he says of this proliferation of so-called hallucinations. “They’re always generating and always guessing. Sometimes those guesses line up with reality.”

As such, “Law and AI Lab” isn’t designed to celebrate artificial intelligence or condemn it. Instead, Doyle wants his students to interrogate it relentlessly. He teaches them to doubt its most-hyped promises.

Borrowing from software engineering, the course adopts a method known as “red teaming,” a practice in which one group’s job is not to build a system, but to expose its weaknesses.

Law students, it turns out, are equal to the task.

“They’re very good at critiquing legal reasoning,” Doyle says. “But when it comes to technology, they often feel less comfortable doing that. The goal is to give them the tools to apply that same critical perspective here.”

The course integrates lectures, seminar-style discussions, and hands-on laboratory sessions. Lectures provide the technical and conceptual foundations for how generative AI works. That technology is designed to predict probable word sequences rather than verify facts. Lab exercises teach students how the technology can improve their own writing, research, and problem-solving skills.

The goal is for participants to develop sound judgment, rather than technological mastery. Doyle tells his students to avoid treating AI like a “superpowered search engine.” Instead, it should be approached as an unreliable collaborator, one that is useful, but in need of constant verification.

By forcing students to confront the limitations of AI, the technology also forces them to clarify their own assumptions. “What is good legal reasoning?” Doyle asks. “What is good legal judgment?”

Law school proves to be an apt time to experiment, driving important insights into the role of emerging technologies. By the end of the course, Doyle says, students will have acquired the skills necessary to critically assess and responsibly engage with generative AI. 

“There’s a sense of permission to challenge, to question, and to not just accept what the technology is doing,” Doyle says.

Giving Students Hope

With Doyle as their guide, student anxiety often morphs into curiosity and excitement.

“They feel like this is going to matter,” Doyle says of student participation in the course. “I think most of them are concerned about the future, and they don’t want to be left behind. They need to understand AI to stay on top of things.”

Doyle, who also teaches “Torts,” attempts to reframe student anxieties: “The goal is to make this a space where students feel they have some control, rather than feeling like they’re victims of circumstance.”

In his own life, Doyle keeps perspective through meditation. As an undergraduate at Boston College, he on a lark took a class on Buddhist meditation theory, long before mindfulness was talked about in popular culture. He spent a semester abroad at a Tibetan Buddhist monastery, learning to respond to life’s circumstances with patience and compassion. It’s a mindset that he conveys to his students.

Clarification, Not Replacement

Outside the classroom, Doyle sees a polarized debate around AI. One camp believes it will solve everything, while the other thinks its promises are overblown. “It’s easy to slip into one of those camps,” he says. “But the reality is more complicated.”

Realistically, AI likely will become embedded across legal practice, he adds, not as a replacement for lawyers, but as part of a hybrid system in which machines handle certain tasks and humans handle others.

At the heart of Doyle’s work is a singular question: What happens to legal judgment when machines begin to “reason” about the law? His answer isn’t about replacement. It’s about clarification.

“Technology forces us to be explicit,” Doyle says. “About our values. About what we’re trying to achieve.”

Andrew Faught is a journalist and author whose work has appeared in The Pennsylvania Gazette, the magazines of UC Berkeley Haas School of Business, Villanova University, Hopkins Bloomberg Public Health, Harvard Kennedy School, Loyola University Maryland and Smith College, and more.