It was a simple question, but for Benjamin Davis the answer was complicated.

Davis, a federal public defender in San Diego, had just been asked by a judge whether his client’s guilty plea to a charge of entering the United States illegally was “knowing and voluntary”.

If he said no, Davis’s client would remain in jail pending another court date. If he said yes, he would be lying. “I have a duty to answer the judge’s questions truthfully, but I also have a duty to my client,” Davis said.

Q&A Have you been affected by Trump's zero tolerance immigration policy? Show We want to shine a light on the lasting repercussions of the policy by telling the stories of those affected, from the migrants themselves to the public employees tasked with implementing assembly-line justice. Fill the form here to share your story with us.

Davis ultimately declined to answer the judge’s question. And, in a small act of defiance that is becoming increasingly common among defense attorneys navigating the Trump administration’s immigration policy, he filed a legal challenge against the judge.

Four similar challenges, known as writs of mandamus, have been filed in San Diego in recent weeks. These unusual actions by defense attorneys are signs of growing frustration with two policies that have flooded San Diego’s federal court with criminal prosecutions of low-level immigration offenses: the Trump administration’s so-called “zero-tolerance” policy and a system of fast-tracked prosecutions called Operation Streamline.

By objecting to judges’ questions about their clients’ pleas, defense attorneys say they are protesting against a system that coerces immigrants into taking guilty pleas.

“How do you explain the US judicial system to somebody in 35 minutes?” asked Melissa Lubin, another defense attorney working in San Diego. “When you are also trying to talk about their work life, their family life, their reasons for coming here, their [plea] offer, how they were found – it is pretty impossible.”

“When [the judge] asks me if this plea is knowing and voluntary I can say, ‘Knowing? Sure.’ Because I just went through the facts of the case with them,” Lubin added. “But do I think it is completely voluntary? Not really.”

Lawyers say that the combination of the Trump administration’s “zero-tolerance” policy and Operation Streamline is to blame.

Under Streamline migrants can go from arrest at the border, to federal court, to deportation proceedings in a day or two – if they plead guilty to the misdemeanor of illegal border entry. The system has been in effect in Arizona and Texas since 2005, but it was only implemented in the southern district of California on 9 July, a few months after the attorney general, Jeff Sessions, implemented zero tolerance.

The result has been chaotic.

“It is stressing everybody beyond what is comfortable,” said Maxine Dobro, a defense attorney in San Diego. “There are clashes every single day between attorneys and judges. Every single day.”

Defense attorneys in San Diego meet with their clients in a windowless former car park underneath the federal courthouse that they call the dungeon.

Contact time is limited. Attorneys have just 45 minutes to establish trust with a client, learn their history and explain the ramifications of a guilty plea.

Attorneys report meeting clients who are sleep-deprived, hungry, in varying states of trauma and still wearing the clothes they crossed the border in. Some refer to Streamline as Steamroll.

“Many attorneys, myself included think that this Streamline process does not produce a voluntary plea,” Davis said. “A lot of us think that this system inherently puts coercive pressure on clients to plead guilty.”

The vast majority of defendants take plea bargains in return for a sentence of time served. A criminal conviction has lasting consequences, however, and can jeopardize a migrant’s ability to enter the US legally in the future. Defense attorneys warn that a criminal conviction could invalidate a migrant’s future asylum claim, and any future unauthorized border crossing could be prosecuted as a felony.

In Davis’s case, district judge Anthony J Battaglia granted the mandamus, ruling that rather than asking attorneys whether their client’s plea was voluntary, judges should determine this themselves.

“Mandamus is typically a last resort and it rarely succeeds,” said Andrew Bradt, an expert in legal procedure at University of California Berkeley School of Law. “But this may be an instance where the lawyers believe that there’s a greater chance of success because of public opinion. So the number is high, but perhaps warranted.”

Overall, two of the writs of mandamus have been successful, one was denied, and the fourth is pending.

The atmosphere in court in San Diego remains tense, Davis said, and he expects to see further clashes between attorneys and judges.

“We are going to continue to object to aspects of the system that we think are unfair and not permitted by the rules.”