Donald Trump has a big problem: His former campaign chair, Paul Manafort, and Rick Gates, a senior aide to Manafort, have been indicted by special counsel Robert Mueller as part of Mueller’s investigation into Trump’s ties to Russia.

The indictment is not just embarrassing, but potentially a threat to the president should Manafort (whose legal problems appear to long predate his service to Trump, and who doesn’t have as enduring and solid a relationship to Trump as other key administration figures have) turn state’s evidence and flip on other current or former Trump aides.

All of which makes reports from this past summer that Trump was asking about his ability pardon aides newly relevant. The Washington Post reported on July 21 that Trump “has asked his advisers about his power to pardon aides, family members and even himself in connection with the probe," according to someone “familiar with the effort.” “A second person said Trump’s lawyers have been discussing the president’s pardoning powers among themselves."

Trump’s lawyers vociferously denied the reports at the time. As Vox’s Andrew Prokop explains, actually pardoning White House aides for involvement in a major ongoing political scandal would be completely unprecedented. President Gerald Ford’s pardon of his predecessor Richard Nixon after the latter resigned in disgrace doesn’t come close; nor does George H.W. Bush’s pardon of Reagan administration officials for involvement in the Iran-Contra affair.

But while it would be unprecedented, issuing pardons for aides would be completely legal. Trump absolutely, without a doubt, has the authority to pardon anyone but himself, whether or not they’ve been charged with a crime already. He could issue a blanket pardon for all federal offenses in a given period to Paul Manafort and Rick Gates— and to anyone who he thinks might be in danger. Some Republican elites, like prominent DC lawyers David Rifkin and Lee Casey in an op-ed for the Wall Street Journal, are already urging him to do just that.

“He can definitely pardon people who haven’t been charged yet,” Brian Kalt, a law professor at Michigan State University and author of Constitutional Cliffhangers: A Legal Guide for Presidents and Their Enemies, told me in July. “And, contrary to a common misconception, it doesn’t require as a legal matter that he say they are guilty.”

By eliminating whatever advantage Manafort would gain through cooperation with Mueller, Trump would protect himself and other aides against incrimination. But he would also deny Manafort the ability to invoked the Fifth Amendment, which allows possible future defendants to decline to answer questions under oath that they feel might incriminate them. Because Manafort would be immune from prosecution, he by definition couldn’t incriminate himself, and couldn’t plead the Fifth. He would have to testify if subpoenaed. That said, he could always lie, and if proven to be lying and charged with perjury — well, Trump could just pardon him again. It would be a grotesque abuse of power, but it would be completely legal.

There is one important limit to Trump’s powers, however. Mueller has also reportedly been cooperating with New York Attorney General Eric Schneiderman in the Manafort investigation. Should Manafort face state-level charges, he could not be pardoned by President Trump, offering one possible avenue through which Mueller can target aides without running afoul of the pardon power.

Presidential pardoning powers are vast

The Supreme Court actually ruled on this matter in the 1866 case of Ex parte Garland. That decision concerned a law Congress passed disbarring former members of the Confederate government, which was challenged by former Confederate Sen. August Hill Garland. President Andrew Johnson had pardoned Garland, and Garland argued that this shielded him from disbarment under the law. The Supreme Court agreed, and in doing so clarified that the pardon power is basically unlimited and can be applied to any crime, whether the pardoned person has been charged or not.

“By the second section of the second article of the Constitution, power is given to the President 'to grant reprieves and pardons for offences against the United States, except in cases of impeachment,’” Justice Stephen Field wrote. “With that exception the power is unlimited. It extends to every offence, and is intended to relieve the party who may have committed it or who may be charged with its commission, from all the punishments of every description that the law, at the time of the pardon, imposes.”

Presidents have since taken advantage of this latitude. Ford’s pardon of Nixon occurred before Nixon could be charged with anything, so he gave Nixon a sweeping pardon covering every federal offense during his presidency:

Now, Therefore, I, Gerald R. Ford, President of the United States, pursuant to the pardon power conferred upon me by Article II, Section 2, of the Constitution, have granted and by these presents do grant a full, free, and absolute pardon unto Richard Nixon for all offenses against the United States which he, Richard Nixon, has committed or may have committed or taken part in during the period from January 20, 1969 through August 9, 1974.

Trump could, similarly, offer any number of his aides “a full, free, and absolute pardon … for all offenses against the United States … [they] committed or may have committed or taken part in during the period from January 1, 2016 through July 21, 2017,” or earlier or later, as he sees fit.

This might cause problems for Trump himself, however. Just as selling pardons would run afoul of the bribery statute, University of Chicago’s Daniel Hemel and Eric Posner argue that using the pardon power to obstruct the Russia investigation could constitute obstruction of justice. "In Trump’s case, the question would be whether he was acting out of the goodness of his heart, or covering up for his family, his associates and himself," Hemel and Posner write.

That being said, because most observers believe the president cannot be indicted while in office (and certainly not by federal prosecutors for obstructing a federal investigation), the question of whether the pardons constitute obstruction of justice mostly matters inasmuch as it changes House and Senate leaderships’ attitudes toward impeachment. If it is indeed obstruction, but House Speaker Paul Ryan and most Republicans disagree, it’s doubtful Trump will face any concrete consequences as a result.

Many states control pardons. The federal government doesn’t.

While there’s no federal precedent for Trump pardoning his aides, there is one at the state level. Some state governors have pardon powers mirroring that of the president, and in 2005, Kentucky Gov. Ernie Fletcher (R) offered blanket pardons to current and former aides in his administration who did or could face charges from a grand jury investigating the administration's violations of merit-based hiring laws. Later, a Kentucky Supreme Court ruling affirmed that the grand jury could not indict anyone to whom Fletcher's pardon applied.

Eventually, Fletcher himself was indicted on three misdemeanor charges. He quickly lost popularity due to the scandal and lost his 2007 bid for reelection by a wide margin.

Kentucky is an unusual state in that it imposes relatively few limitations on the pardon power. Several states, including Connecticut, Georgia, South Carolina, and Utah, have independent boards that offer pardons in most cases, in the place of the governor. In Minnesota, the governor and other top officials sit as a board and determine pardons. “A number including Pennsylvania and Delaware, and Texas, have gatekeeper boards that put limits on what the governor can do,” Love explains. “You can’t do anything without an affirmative recommendation from the board.” All told, she estimates that only 15-16 states have pardon powers as unrestricted as that at the federal level.

Changing the federal pardon power would require a constitutional amendment. But given the potential for abuse illustrated in the Fletcher case and by Trump’s situation, an amendment might be in order.

Can Trump pardon himself?

While Trump could pardon Manafort, Gates, former National Security Advisor Michael Flynn, former campaign advisor Carter Page, Donald Trump Jr., Jared Kushner, and really anyone he wants, what’s less clear is whether or not he can pardon himself.

Presidents definitely can’t use the pardon power to impede impeachment proceedings, against themselves or any other officials. But there’s disagreement among legal experts about whether the president can use a pardon to defend himself against future prosecution upon leaving office. The Justice Department’s Office of Legal Counsel ruled in 1974 that Nixon could not pardon himself, but most legal experts consulted by Vox’s Sean Illing concluded the opposite, that Trump probably could pardon himself. There’s also a question of whether courts would be willing to step in and disrupt a self-pardon, even if it’s not constitutionally permissible.

“It’s a ‘how many troops has the pope’ sort of thing,” Margaret Love, who served as US pardon attorney from 1990 to 1997, told me in July.