Not everyone thinks Donald Trump poses a direct and obvious threat to the rule of law. When he accuses FBI investigators of “treason”, declares his campaign was “conclusively spied on” and suggests “long jail sentences”, there is often an assumption that cooler legal heads in the justice department and White House will prevail against the impulsive president.

But as Trump’s test of constitutional boundaries intensifies, critics say, the supposedly cooler heads seem to be simmering.

This month, the attorney general launched an investigation of Trump’s political enemies after shrugging off a report on Trump’s potentially criminal misconduct; the White House counsel informed Congress it cannot investigate the president; and the Office of Legislative Affairs used executive privilege as a cudgel to beat back a congressional demand for testimony.

Each new controversial memo or opinion feeds a running debate about where, exactly, assertive lawyering ends and malpractice begins. But while those debates spin on, entire ethical continents below are shifting, the critics warn, in an ominous drift away from previous legal norms. The question in play is whether there is a line past which lawyering for Trump means joining a historic assault on the justice system itself.

Trump administration lawyers are at risk of neglecting a higher, sworn duty, said Steven J Harper, a professor and lawyer who has written on the topic for the American Bar Association.

“It goes beyond, I think, particular rules of professional responsibility,” Harper said. “I think it goes to far more important things, like respect for the rule of law, respect for the constitution and the duty that all lawyers have to prevent a president from making the justice system a host species for his personal agenda.

“I think people really don’t realize the role lawyers can play,” Harper continued. “Because ultimately, in order to co-opt the legal system, you need to have the help of insiders from within the legal system to do it. And so far Trump has put together a team that has, I think, in very large measure enabled him to do that.”

Trump’s team has been appointed to head the Office of Legal Counsel (Steven Engel, Daniel Koffsky), the White House counsel’s office (Pat Cipollone and previously Donald McGahn), the Office of Legislative Affairs (Stephen Boyd), and the solicitor general’s office (Noel Francisco). Then there are Trump’s personal lawyers (Rudy Giuliani, Jay Sekulow) or special counsels (Emmet Flood). They serve in unique posts, as did the failed “voter fraud” czar Kris Kobach.

Of all the president’s lawyers, the one attracting the most scrutiny is the attorney general, William Barr, who is in charge of handling the report submitted by special counsel Robert Mueller. Accusations that Barr has acted more like a personal lawyer for Trump than as an impartial tribune for justice were amplified this week after he acceded to a longtime Trump wish by assigning a US attorney to investigate the FBI counter-intelligence investigation of Russian activity into which the Trump campaign was swept up.

The president has tried to use the justice department to go after his political rivals before, as when he said in the spring of 2018 that he wanted prosecutions of Hillary Clinton and the former FBI director James Comey, only to be reportedly rebuffed by McGahn, then White House counsel.

But Trump appears to have found his man in Barr, said Walter Shaub, a former director of the Office of Government Ethics and a senior adviser to Citizens for Responsibility and Ethics in Washington (Crew).

“I think it’s extremely troubling that Barr has now assigned a handpicked investigator to look into the investigation run by his own agency,” Shaub said. “They have an inspector general for a reason, and the inspector general for the Department of Justice is one of the most respected inspectors general that there is, or ever has been. There’s no reason not to rely on him if you’re looking for the truth.”

The White House legal counsel, Emmet Flood, right, called the Mueller report ‘part ‘truth commission’ report and part law school exam paper’. Photograph: Jonathan Ernst/Reuters

Jack Goldsmith, a Harvard law professor and former assistant attorney general under George W Bush, has defended Barr’s handling of the Mueller report, writing that Barr was, in effect, taking one for the constitution.

“I think Barr is trying to limit the damage to Article II [executive powers] that has resulted from Trump’s unfathomably stupid, impulsive, self-defeating efforts to wield executive power to control the Russia investigation, and Mueller’s overzealous reading of obstruction law and his odd non-traditional prosecutorial decision in response,” Goldsmith wrote.

Other lawyers in the Trump administration have settled on a very different solution to dealing with the ethical conflict of working for Trump: they quit. Dozens of experienced justice department employees have hit the exits under Trump, according to a study by Fortune magazine, including at least 12 who “have resigned by personal choice, citing career changes or unabated concerns with the administration”.

But a different set of lawyers has chosen to stay inside the Trump administration, which hosts dramatic opportunities for professional advancement, such as the one that catapulted the former acting attorney general Matthew Whitaker from a law office in Des Moines to the top of the justice department.

Their work is highly controversial. In a letter denying a congressional subpoena for documents, Cipollone informed Congress this week that it did not have a “proper legislative purpose” for its investigation. Boyd warned Congress last week that a vote to find Barr in contempt for refusing to testify before a House committee – over a special counsel report that had already been issued – would be met with an assertion of executive privilege, which was subsequently invoked.

Flood wrote one of the most tendentious attacks on the Mueller report, calling it “part ‘truth commission’ report and part law school exam paper”. Earlier, Engel wrote a controversial opinion advising Trump that he could appoint Whitaker.

On the day Trump was inaugurated, Koffsky, now the top ethics official in the Office of Legal Counsel, wrote a memo greenlighting Trump’s hiring of his own children. Francisco defended Trump’s Muslim travel ban before the supreme court. Sekulow ran a public campaign to falsely deny Trump’s involvement in episodes under investigation by Mueller. McGahn presided over a Trump attack on federal judges after his effort to deny federal funds to sanctuary cities was derailed.

What motivates the lawyers who prop up Trump’s project? “Maybe it’s just the intoxication of power,” said Harper. “Or maybe it’s something as simple as human nature, and how it relates to ambition and greed. I don’t know, but it’s really dangerous stuff.”

If the rule of law is not insisted upon, reasserted and shored up, Shaub said, it could be permanently damaged.

“Right now what has protected America from Trump’s worst authoritarian instincts, is that the things he wants to do are broader than the things he can do,” Shaub said.

“If you completely destroy the idea that the president is subject to the rule of law, the realm of what he’s able to do starts to look a lot more like what he wants to do, and we could find ourselves careening into authoritarianism, or at least severely damaging the rule of law.”