WASHINGTON— Although some parts of President Donald Trump ‘s agenda are getting bogged down by litigation, Elon Musk’s Department of Government Efficiency is having better luck in the courtroom.

Labor unions, Democrats and federal employees have filed several lawsuits arguing that DOGE is running roughshod over privacy protections or usurping power from other branches of government.

But judges appointed by Democratic and Republican presidents haven’t always gone along with those arguments, at least so far. Most notably, DOGE critics are failing to obtain temporary restraining orders that would prevent Musk’s team from accessing sensitive government databases.

“It is not the job of the federal courts to police the security of the information systems in the executive branch,” wrote U.S. District Judge Randolph Moss in a case involving the Office of Personnel Management. Moss was appointed by President Barack Obama.

The success is striking given the other challenges that Trump has faced in the judicial system, which has blocked — at least temporarily — his efforts to limit birthright citizenship, freeze congressionally authorized foreign aid and stop some healthcare services for transgender youth.

If Musk’s opponents continue struggling to gain traction with lawsuits, he could be largely unencumbered in his crusade to downsize the federal government and also the workforce.

“The continued successes in the courts in favor of the Trump administration shouldn’t be a surprise to anyone who has ever read our great Constitution, which clearly lays out the role of the Executive Branch, and which President Trump and his entire administration are following to a T,” Harrison Fields, the White House deputy press secretary, said in a statement.

“The resistance campaign can try, but they will continue to fail in their pursuit to rewrite the Constitution and deny the people the legal authority of the President to run the Executive Branch.”

An exception to DOGE’s legal victories has been a suit regarding Treasury Department systems, which are used to distribute trillions of dollars in federal money.

The databases can include sensitive information like bank accounts and Social Security numbers, and they’re traditionally maintained only by nonpartisan career officials.

A judge in Washington restricted DOGE’s access to two staff members, while another judge in New York has temporarily blocked DOGE altogether.

Norm Eisen, a lawyer who worked for House Democrats during their first impeachment of Trump, said it was too early to say that the legal efforts wouldn’t work. He noted that U.S. District Judge Tanya Chutkan, also appointed by Obama, expressed concern about Musk’s apparent “unchecked authority” in a case involving federal data and worker layoffs.

Although she didn’t issue a temporary restraining sought by Democratic attorneys general from 14 states, Chutkan said they could still make a strong argument Musk and DOGE violated the Constitution as the case progresses.

Eisen is representing current and former employees at the U.S. Agency for International Development, which was shut down by Musk and Trump. His lawsuit alleges that Musk and DOGE are exercising powers that should only belong to those elected by voters or confirmed by the Senate.

“These are not minor peccadillos,” Eisen said. “These are some of the most fundamental issues that our Constitution and laws address.”

John Yoo, a law professor at the University of California in Berkeley, said an important factor has been the administration’s contention that Musk is a presidential adviser without any independent authority. He said there are echoes of another legal battle from the 1990s, when Hillary Clinton chaired a healthcare task force as first lady.

A federal appeals court in Washington ruled that the task force did not need to comply with rules on open meetings.

“That’s how they’re winning the lawsuits,” Yoo said. “They’re trying to stay on the side of the line that the D.C. circuit has drawn.