Former FBI Director James Comey, having reemerged from his post-firing silence to promote a book, is increasingly now cast as a villain.

True, he’s a Republican with a reputation for independence and integrity who could represent a sort of “resistance” figure, one who is publicly calling out President Donald Trump, including in his new book A Higher Loyalty, for firing Comey and for conducting himself with no ethics or integrity in the White House.

But in a twist, many establishment Democrats — especially those closely associated with Hillary Clinton’s presidential campaign — hate the guy. They feel that his handling of the investigations into Clinton’s emails makes him personally responsible for Trump’s ascension to the White House. And it’s true both that Comey’s handling of the email situation was problematic in several respects and that broader left and libertarian critiques of the overall federal law enforcement mentality that Comey exemplifies have some merit.

But to react to Comey’s charges against Trump with a comprehensive assessment of his entire career is to miss the point. James Comey is a critical figure of our time not because of any particular decision, right or wrong, that he made during his tenure in government. He’s important because he exemplifies values — most of all, the pursuit of institutional independence and autonomy — whose presence among career officials safeguards the United States against the threat of systemic corruption.

The greatest safeguard we have against the dangers of Trump’s highly personalized style of leadership and frequently expressed desire to reshape all institutions to serve his personal goal is that officials and bureaucrats have the power to say no. Comey, whatever else he did, said no to his boss and was fired for his trouble. America needs more government officials who are willing to take that stand. In many ways, Comey is not the hero the United States deserves. But in a critical moment, he may be the hero we need.

The Martha Stewart case explains James Comey

Comey’s long career as a federal prosecutor means he’s touched many high-profile and incredibly consequential cases and issues over the years. But perhaps nothing explains his worldview quite so clearly as his attitude toward a high-profile but not consequential case that he was involved with: the prosecution of Martha Stewart in the early aughts.

The historical context for this is that in the wake of the 2000-’01 stock market crash, it turned out that several high-profile companies, including Enron and Worldcom, had engaged in major accounting shenanigans. The George W. Bush administration then decided to do what Barack Obama’s team would later not do after the housing market crash, and bring a series of high-profile white-collar criminal cases against the major malefactors.

The Supreme Court ultimately ruled against the government in most of these cases (which is one reason Obama didn’t bring them), launching a string of precedents that ended up serving to mostly legalize political corruption when they were eventually applied to overturn the conviction of former Virginia Gov. Bob McDonnell.

But at the time, Comey was the US attorney for the Southern District of New York, high-profile securities fraud cases were in vogue, and allegations emerged that Martha Stewart had violated the rules against insider trading. She was ultimately exonerated in this investigation but was nonetheless prosecuted and convicted of making false statements to investigators and of a securities fraud violation that amounted to making false statements about the case in public. At the time, a range of observers from Michael McMenamin in Reason on the right to Doug Henwood in the Nation on the left saw the prosecution as a huge stretch, with Stewart essentially convicted of covering up a crime she didn’t commit.

Talking to George Stephanopoulos recently, however, Comey described his decision to prosecute the case as central to his worldview:

And folks don’t realize this, but I almost hesitated and almost didn’t bring the case against Martha Stewart, in hindsight, because she was rich and famous. And decided that if she were anybody else, any other ordinary person, she would be prosecuted. And what helped me come to that conclusion was I remembered a case I’d been involved in against an African-American minister in Richmond when I was a federal prosecutor there, who had lied to us during an investigation. And I begged this minister, “Please don’t lie to us because if you do, we’re going to have to prosecute you.” He lied. And at the end of the day, we had to prosecute him. And he went to jail for over a year. And as I stood in my office in Manhattan, I’m looking out at the Brooklyn Bridge, I remember this moment. And I’m thinking, “You know, nobody in New York knows that guy’s name except me. Why would I treat Martha Stewart differently than that guy?” And the reason would only be because she’s rich and famous and because I’ll be criticized for it. The truth matters in the criminal justice system. And if it’s going to matter, we must prosecute people who lie in the middle of an investigation.

That Comey isn’t railroading obscure black ministers in Virginia while letting rich white celebrities off the hook in Connecticut is surely laudable. And while equal treatment under the law is an important concept, there is also an important question as to how everyone should be treated. Comey’s answer is: harshly.

While criminal justice reformers push for less punitive treatment of poor and minority suspects and defendants, the Comey view is that true justice is treating Martha Stewart just as shabbily as the cops would treat anyone else.

James Comey is really into DOJ/FBI power and autonomy

The ability to prosecute and jail people for lying to investigators is, obviously, an incredibly powerful tool of the FBI, US attorneys’ offices, and other aspects of federal law enforcement. And it’s a tool that Comey believes in passionately, offering rather scathing remarks about the leniency shown to retired general and former CIA Director David Petraeus for his own false statements to investigators.

“I thought David Petraeus should’ve been prosecuted not just for the mishandling of the classified information,” Comey told Stephanopoulos, “but also for lying to the F.B.I. because lying is — strikes at the heart of our rule of law in this country.”

Lying is, of course, not something that’s generally illegal. Indeed, most people think that it is morally acceptable (or even obligatory) to lie in certain situations. The great 18th-century German philosopher Immanuel Kant famously disagreed, of course, denouncing the “supposed right to lie from altruistic motives,” but he’s an outlier. And while mounting these prosecutions is sometimes a useful way to catch bona fide bad guys, it’s also prone to abuse in some fairly obvious ways — especially because it’s perfectly legal for the investigators to lie to you. That’s why standard legal advice is to simply refuse to talk to investigators under any circumstances.

“People seem to think that: If I haven’t done anything wrong, then it’s okay for me to talk to the government,” writes defense lawyer David Benowitz, “and that’s just dead wrong.”

The argument that lying to the FBI shouldn’t be a crime has picked up steam on the right since false statements prosecutions have become crucial to Robert Mueller’s investigation of Trumpworld, but also reflect a longstanding viewpoint of principled civil libertarians who worry about investigators’ power to essentially manufacture crimes once they’ve decided on an investigatory target.

Comey, obviously, doesn’t see it that way, and in general, federal prosecutors are not major civil libertarians. But it’s important to note that when the circumstances were right, Comey did briefly emerge as a major civil libertarian hero back when he served as deputy attorney general later in the Bush administration.

The issue was, essentially, that both the White House and important elements of the intelligence community wanted Comey — who was acting as attorney general while John Ashcroft was sick in the hospital — to certify that the Justice Department regarded certain aggressive surveillance practices as legal. The DOJ’s career staff disagreed, and Comey refused to overrule them — first at a dramatic White House meeting and then later at an even more dramatic hospital encounter when he raced to Ashcroft’s bedside to prevent Dick Cheney and his allies from prevailing on the ailing attorney general.

To most people, both the surveillance issue and the false statements issue exist on the same axis of civil liberties versus law and order. But from a Comey’s-eye view, the key question is the prerogatives of the professionals at the Department of Justice — the right to both prosecute civilians for lying to them and tell political leaders and heads of other intelligence agencies to fuck off go together as a bundle of institutional independence.

Comey managed the email investigation as an institutionalist

Institutional power and autonomy of federal agencies in the United States is in part a question of law but in practice largely a question of politics.

The FBI has traditionally enjoyed an unusually large degree of institutional autonomy. That stems in large part from the scandalous legacy of former Director J. Edgar Hoover, who amassed vast power during an epic 48-year run heading the agency through a mix of political savvy and implicit and explicit blackmail.

When Hoover died, Richard Nixon tried to assert presidential authority over the bureau, and for his trouble, FBI Associate Director Mark Felt, a Hoover loyalist, became the infamous Watergate-era source “Deep Throat” and helped bring down the president.

Felt, of course, kept his identity secret for decades, and Bob Woodward and Carl Bernstein typically presented Deep Throat’s motives as somewhat more high-minded than cutthroat bureaucratic warfare. Indeed, the proximate upshot of post-Watergate congressional investigations into Nixon’s abuses of power was to further insulate the FBI from direct political control.

Comey’s handling of the 2016 campaign was essentially in the tradition of FBI directors acting on behalf of their agency’s institutional goals. Knowing that the Obama administration was reluctant to fight publicly with the FBI over the matter while congressional Republicans were relatively eager, he slanted his decision-making on both the Russia and email investigations toward the interests of the GOP. As Adam Serwer writes, “the FBI is petrified of criticism from its conservative detractors, and is relatively indifferent to its liberal critics.” And over the course of 2016, it showed — when Mitch McConnell wanted Comey to keep quiet about Trump and Russia, he did. When Trump-friendly elements among the rank and file wanted him to speak up about Anthony Weiner’s laptop, he did.

All that said, the fact remains that whatever one makes of Felt’s motivations in detail, his actions helped bring down the most corrupt and dangerous president in American history. And, similarly, the very same defense of institutional autonomy that led Comey to help Trump win the election also led him to refuse to back down when Trump urged him to drop the investigation into former National Security Adviser Michael Flynn and bring the entire Russia inquiry to a premature conclusion.

More broadly, the FBI’s zealous pursuit of its own institutional autonomy has very much not been an untrammeled good throughout American history (the bureau famously tried to blackmail Martin Luther King Jr. into killing himself), but it does serve as a check against authoritarianism and a potential bulwark against Trump’s most malign impulses.

James Comey is the hero America needs

In the very opening weeks of the Trump administration, the legal and national security analyst Ben Wittes coined the phrase “malevolence, tempered by incompetence” to characterize Trump’s approach to policymaking.

He was referring specifically to the initial version of Trump’s travel ban, but it serves as a nice summation of Trump’s approach to the rule of law more generally. Between the effort to get Comey to pledge personal loyalty to him, threats to use antitrust law to punish CNN, and Trump’s various musings about the relationship of Amazon to both the Washington Post and the US Postal Service, it’s clear that Trump has a fairly chilling vision of how the American government ought to work. In his view, the entire state is essentially an extension of him personally, just as the network of privately held LLCs known as the Trump Organization operates.

To Trump, the key question about everything is how it relates to him personally — friends should be rewarded, and enemies should be punished.

That’s how economic regulation works in many autocratic states, and it serves to entrench the autocrat in power and to impoverish their populations. But to impose that vision of America requires both political appointees and career civil servants to ignore not just the letter and the spirit of the law but also their own personal and institutional imperatives. In an ideal world, of course, people would do the right thing just because it’s the right thing to do. But real-world governments and political institutions don’t function because they’re populated by angels — they need to function despite being populated by actual, flawed human beings.

Comey isn’t a storybook hero, and the real-world consequences of his pursuit of institutional autonomy have been decidedly mixed over the years. But it served as a decided virtue during the early months of the Trump administration, and the country’s best hope for the duration of his time in office is that a wide range of officials — not just FBI agents and federal prosecutors but also regulators and Cabinet secretaries and all the rest — more or less follow his example and insist on maintaining their prerogatives and autonomy.