Recent books from ex-FBI officials have tended to be about hard men in dark suits, whispering worriedly about Russians, President Trump and existential threats to democracy. “The FBI Way: Inside the Bureau’s Code of Excellence” isn’t that kind of book, because author Frank Figliuzzi has a simpler message to impart: The vaunted FBI, for all its recent public controversies, still sets a gold standard for excellence and ethics that should be followed more widely.

Figliuzzi, a former assistant director turned NBC News analyst, once oversaw internal FBI investigations of his fellow agents, and he uses cases from his career to offer lessons for other professions.

Books by retired FBI agents are a genre unto themselves, and Figliuzzi’s is in the spirit of earlier tomes that combine federal-agent tradecraft with a dash of self-improvement advice, such as “The Like Switch: An Ex-FBI Agent’s Guide to Influencing, Attracting, and Winning People Over,” by Jack Schafer, and “What Every Body Is Saying: An Ex-FBI Agent’s Guide to Speed-Reading People” by Joe Navarro.

Figliuzzi’s version is more far-reaching, arguing that the world can benefit not from particular FBI skills but from the organization’s principles of accuracy and accountability.

The FBI’s track record, Figliuzzi writes, “surpasses the success rate at the most revered companies, organizations, and teams. . . . Beyond any headlines of the moment, beyond any politically driven attacks, beyond any rare but high-profile fumbles stands one of our nation’s most essential institutions.”

It is a curious moment to hold up the FBI as an example of successful management. The agency has spent the past four years being battered by all manner of accusations, ranging from conspiracy theories to dispassionate, lawyerly dissections of its failures.

Yet one of the enduring ironies of the FBI is that it remains, to the general public, one of the most trusted and respected institutions in American life, even though its founding father, J. Edgar Hoover, whose name graces its headquarters, is generally considered synonymous with the abuse of government power.

As the former head of internal investigations at the FBI, Figliuzzi has a lot to say about how organizations police themselves. “The FBI Way” recounts a Miami drug case in which two agents were found playing “make it rain” with huge piles of seized cash inside an armored car. Wanting to ensure that no defense lawyer or judge could raise the specter of agent corruption, Figliuzzi ordered the agents to disrobe enough to assure their bosses that no money had been swiped — a decision that became the subject of its own internal investigation, to determine if Figliuzzi had crossed any lines.

Figliuzzi also applies his judgment to some of the FBI’s more recent, high-profile ethical questions, faulting former director James B. Comey for his handling of the Hillary Clinton email investigation. Comey, Figliuzzi writes, fell into a trap of “thinking no one else can be trusted” with deciding whether criminal charges should be filed, and the author notes that if he had ever behaved similarly as a lower-level FBI executive, he rightly would have been removed from his post.

Similarly, Figliuzzi faults Peter Strzok, the former agent who ran the Clinton email and Trump campaign investigations, for “abysmal” judgment when it came to anti-Trump texts Strzok sent during those cases. If he hadn’t been fired, Figliuzzi writes, “it would be nearly impossible to address similar conduct by lower-ranking employees.”

Figliuzzi’s judgment is kinder to another high-level, high-profile FBI ethics case, that of former deputy director Andrew McCabe. Figliuzzi fairly questions the judgment of officials who fired McCabe about a day before his planned retirement, saying that move “lacked the hallmarks of a credible disciplinary decision.” Curiously, he refuses to pass judgment on whether the underlying accusations of wrongdoing against McCabe had merit (he was accused of misleading internal investigators about his role in releasing information contained in stories I wrote in 2016), but Figliuzzi’s main point on McCabe’s case is that such investigations are ethical tests not just of the person under investigation but of the entire system of self-policing.

“The FBI Way” is a worthwhile exploration of the age-old question of who polices the police, how they do it and to what end, but it never really grapples with the broader implications of the bureau’s recent history.

For generations of lawmen, the fundamental ethical question was what you might call the Patrolman’s Dilemma: How do you ensure that a trooper alone on a highway at night, or a beat cop alone in a room full of drugs and money, does the right thing when no one is looking over his or her shoulder?

For the FBI and other law enforcement agencies, the past five years have presented a different kind of quandary: How to behave ethically not in an empty room but in front of a crowd, with various factions in the audience cheering for an arrest or a declaration of innocence. Comey, McCabe, Strzok and others were all judged and found lacking not for what they tried to do in secret, but for what they did when the whole world was watching.

It seems increasingly likely that the successors in Figliuzzi’s job will have to make judgments not based solely on how their insular world of fellow agents will perceive their actions, but with an eye toward the demands of partisans and public expectations.

At the FBI, the criticism of the past few years has led to a reflexive aversion to public statements of any kind on almost any case — an approach that lowers the short-term risk of harm but also decreases the bureau’s ability over the long run to put its good work on display, allowing more room in the public square for baseless conjecture and squinty conspiracy theories.

The political fights surrounding the FBI are damaging in another way: They tend to blur important distinctions between crimes, ethical lapses and plain old bad judgment. Politicians’ increasing eagerness to accuse rivals of all manner of lawbreaking puts more pressure on the FBI and the Justice Department to settle political disputes — and makes it harder to distinguish between different types of bad conduct. In a landscape of endless accusations, moral mountains become molehills and vice versa, making all sins appear equal when they are not. Figliuzzi’s book is a timely reminder that our justice system will suffer greatly if the varieties of right and wrong are reduced to a binary choice between public office and prison.

The FBI Way

Inside the Bureau’s Code of Excellence

By Frank Figliuzzi

Custom House. 260 pp. $27.99