J. Scott Applewhite / AP

Three summers ago, then–FBI Director James Comey stepped to a lectern and delivered a harsh scolding to then–presidential candidate Hillary Clinton. Comey’s agents had been investigating Clinton’s use of a personal email server and account as secretary of state, and while he said that “no reasonable prosecutor” would bring a criminal case against her, he was unsparing.

“Although we did not find clear evidence that Secretary Clinton or her colleagues intended to violate laws governing the handling of classified information, there is evidence that they were extremely careless in their handling of very sensitive, highly classified information,” Comey said.

Few of us can imagine how it felt for Clinton to be simultaneously cleared of criminal wrongdoing and also publicly savaged, but today, Comey probably has a pretty good sense of precisely how that feels.

On Thursday, the Department of Justice’s Office of the Inspector General released its report on Comey’s decision to keep several memos he produced as FBI director, one of which a friend disclosed to The New York Times at Comey’s behest. OIG indicates that the Justice Department declined to prosecute Comey, but the report harshly criticizes him nonetheless:

In a country built on the rule of law, it is of utmost importance that all FBI employees adhere to Department and FBI policies, particularly when confronted by what appear to be extraordinary circumstances or compelling personal convictions. Comey had several other lawful options available to him to advocate for the appointment of a Special Counsel, which he told us was his goal in making the disclosure. What was not permitted was the unauthorized disclosure of sensitive investigative information, obtained during the course of FBI employment, in order to achieve a personally desired outcome.

All that’s missing is a declaration that Comey was “extremely careless.”

With the question of a criminal prosecution resolved, what leaps from the OIG report is the parallel between Comey’s press conference about Clinton and his decision about the memos. In both cases, Comey violated procedures and policies in pursuit of what he believed was a larger imperative, concluding that his own judgment was more useful for protecting the Justice Department and the FBI.

In the Clinton case, Comey became concerned that an ill-advised chance meeting between then–Attorney General Loretta Lynch and former President Bill Clinton would mean the public might not trust Lynch’s determination about whether to charge Hillary Clinton. So Comey took it upon himself to publicly announce his recommendation, against DOJ policy, because he believed it would protect the department from public opprobrium. A previous OIG report concluded that “Comey usurped the authority of the Attorney General.” (Many former DOJ officials also criticized Comey’s actions.) Nor did his end run protect the department. The email investigation, and especially Comey’s abortive reopening of it in October 2016, played a decisive role in the presidential election, turning the FBI into a political player.

President Donald Trump infamously used Comey’s missteps as a pretext to fire him in May 2017, even though the president admitted soon after that he’d actually removed Comey over “the Russia thing.” By then, Trump had repeatedly improperly pressured Comey—asking him for personal loyalty, and asking him to drop a probe into former National Security Adviser Michael Flynn. Comey had been memorializing those interactions in memos. After Trump fired him, Comey kept the memos, and eventually sent several of them to his friend.

Once again, Comey had violated policy, OIG said: “As a departing FBI employee, Comey was required to relinquish any official documents in his possession and to seek specific authorization from the FBI in order to personally retain any FBI documents. Comey failed to comply with these requirements.” OIG notes that Comey claimed the memos were personal, but dismissed that distinction, saying it “finds no support in the law and is wholly incompatible with the plain language of the statutes, regulations, and policies defining Federal records, and the terms of Comey’s FBI Employment Agreement.”

Why did he do this? “Comey disclosed the contents of Memo 4 in an attempt to force the Department to take official investigative actions—to appoint a Special Counsel and preserve any tapes as evidence,” OIG reported. In other words, Comey had again decided that what he believed was a higher calling—getting a special counsel to investigate Trump—was more important than following the rules.

Maybe Comey was right. His leak may very well have been the difference between a special-counsel investigation and none, and Robert Mueller’s investigation was an essential look at the White House, which revealed the dysfunction, disregard for law, and obstruction-of-justice-in-all-but-name that suffuses the Trump administration. It is difficult to imagine the Justice Department having achieved anything nearly so complete and untainted, especially in light of Trump’s attempts to bully Mueller, as well as politically motivated investigations of Trump’s political opponents—including, arguably, this OIG report.

Even without the special-counsel investigation, the public benefited from what it learned from the memo leaked to the Times. The nation benefits from whistle-blowers who are willing to leak, while investigations like this one are designed to have a chilling effect.

Yet the parallel between the two situations, and Comey’s spurn-the-institution-to-save-it approach, is too remarkable to be ignored, and history offers strong reasons that it’s dangerous for FBI directors to freelance, placing their personal judgment over standing policy.

If Comey feels chastened by the report, he didn’t show it in his reaction on Twitter, in which he portrayed the report as vindication, much as Hillary Clinton did in July 2016:

It’s been a tough, bruising few years for Comey, but give him this: His reputation for self-righteousness has escaped unscathed.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.