President Donald Trump makes no secret of his litmus test for an attorney general: They should be loyal to the president first, and the rule of law second. He’s invoked Robert Kennedy and Eric Holder as models for their loyalty and their purported efforts to quash politically damaging investigations. A pliant attorney general would allow the president to demolish the Justice Department’s traditional independence, which Trump resents. “I am not supposed to be doing the kind of things that I would love to be doing, and I am very frustrated by it,” he lamented last November.

From that vantage point, Matt Whitaker is perfectly suited to be the interim leader of the Justice Department, where he will oversee special counsel Robert Mueller’s Russia investigation. Whitaker, the U.S. attorney in Iowa from 2004 to 2009, previously served as former Attorney General Jeff Sessions’ chief of staff since last summer. From there, he’s reportedly acted as the White House’s “spy” inside Sessions’s office and curried favor with the president’s top aides. Trump named him acting attorney general after forcing Sessions to resign on Wednesday.

The post is one of the most sensitive and powerful jobs in any presidential administration. Despite this, Trump professed ignorance on Friday about the man he had just chosen to lead the federal government’s law enforcement apparatus. “I don’t know Matt Whitaker,” he told reporters outside the White House before praising the acting attorney general’s credentials. “Matt Whitaker worked for Jeff Sessions, and he was always extremely highly thought of, and he still is.”

By any standard other than Trump’s, however, Whitaker seems stupendously unqualified for the job. Previous attorneys general served as governors, senators, and federal judges before taking the post. Interim ones typically came from within the Justice Department’s upper echelons. Before joining Sessions’s staff last year, Whitaker worked in private practice at a small law firm, mounted a failed U.S. Senate bid in Iowa, made TV appearances as one of CNN’s myriad contributors, and sat on the advisory board of a company accused by the Federal Trade Commission of running a multi-million dollar scam.

So why would the president elevate Whitaker from relative obscurity to one of the most powerful posts in the federal government? After all, Deputy Attorney General Rod Rosenstein is still available to oversee the Justice Department until Trump nominates—and the Senate confirms—Sessions’s replacement. The answer seems to lie in the president’s hostility toward the Russia investigation, a view largely shared by Whitaker. By appointing Whitaker and supplanting Rosenstein’s oversight of Mueller, Trump is now well-positioned to curtail the inquiry just as it draws closer to his inner circle.

Whitaker’s views on the investigation are well-established. Before joining Sessions’s staff, he told interviewers that there was no collusion between the Trump campaign and Russia and “no case for obstruction of justice,” wrote an op-ed that opposed scrutiny of Trump’s personal finances, and downplayed the significance of Donald Trump Jr.’s 2016 meeting with Russians in Trump Tower. At one point, he even floated a scenario on television to shutter the probe. “I could see a scenario where Jeff Sessions is replaced,” he said last July, “[and] that attorney general doesn’t fire Bob Mueller, but he just reduces his budget to so low that his investigations grinds to almost a halt.”

Trump is known for his avid TV viewing habits, and Whitaker’s appearances reportedly caught his attention. That may have been the entire point. John Q. Barrett, a St. John’s University law professor, recalled a friendly chat he had with the acting attorney general last year. “Whitaker told me in June 2017 that he was flying out from Iowa to NYC to be on CNN regularly because he was hoping to be noticed as a Trump defender, and through that to get a Trump judicial appointment back in Iowa,” he wrote on Twitter on Wednesday night.

It’s unclear how long Whitaker will stay in the current position. Trump is reportedly considering former New Jersey Governor Chris Christie and Florida Attorney General Pam Bondi as permanent replacements. Trump may decide to hold off on nominating someone until the new Senate is seated in January, when it is expected to have a slightly larger Republican majority. That could give him a greater margin of error to push through a controversial nominee.

Until then, the questions are how much damage Whitaker wants to do to the Russia investigation, how much damage he can do, and how much damage he’s willing to do. In theory, all of Mueller’s power flows from the acting attorney general, whoever that may be. Rosenstein established Mueller’s authority last May in a public memo and has augmented it since then with classified memos. As acting attorney general, Whitaker could theoretically rewrite those memos to narrow the scope of Mueller’s inquiry. He could also quash subpoenas, block indictments, and dismiss the special counsel entirely.

Things could get complicated quickly if any of that happens. Taking any substantive moves against Mueller could invite legal challenges to Whitaker’s authority. Lawyers Neal Katyal and George Conway argued in The New York Times on Thursday that Whitaker’s appointment violates the Constitution’s Appointments Clause, which requires top executive-branch officials to be approved by the Senate. Katyal, who served as acting solicitor general in the Obama administration, and Conway, who was considered for a top Justice Department position by Trump, contended that Whitaker can’t exercise the attorney general’s powers because he didn’t go through the confirmation process.

“Constitutionally, Matthew Whitaker is a nobody,” Katyal and Conway wrote. “His job as Mr. Sessions’s chief of staff did not require Senate confirmation. (Yes, he was confirmed as a federal prosecutor in Iowa, in 2004, but President Trump can’t cut and paste that old, lapsed confirmation to today.) For the president to install Mr. Whitaker as our chief law enforcement officer is to betray the entire structure of our charter document.” (Asked about this argument on Friday, Trump derided Conway as “Mr. Kellyanne Conway,” referring to Conway’s wife—who serves as Trump’s counselor.)

Whitaker may ultimately turn out to be a responsible steward of the powers of which he has been temporarily vested. But his past criticism of the Russia investigation, coupled with his close ties to the White House, suggest otherwise. Everything about Whitaker’s appointment suggests his purpose is to rein in the Russia investigation and bring the Justice Department closer to Trump’s orbit. However long Whitaker’s tenure lasts, his impact on the American rule of law may last much, much longer.