Michael Hayden is the only official to have served as head of both the National Security Agency and CIA. Once retired from public service, the chief spy for much of the George W. Bush era has always had a difficult time staying out of the headlines.

At the NSA, the former Air Force general oversaw what many now consider to be the illegal warrantless surveillance of communications between individuals in the U.S. and alleged foreign terrorist groups. Later appointed CIA director by George W. Bush, Hayden served until 2009, when he resigned and joined the private security consulting Chertoff Group.

To publicize his new book, Playing to the Edge: American Intelligence in the Age of Terror, Hayden has ventured to criticize certain positions being taken by GOP presidential aspirant Donald Trump. He has in particular focused on Trump’s support of torture and his willingness to kill entire families of “terrorists.” Hayden has suggested that officers in the military can refuse to do either, even if ordered to do so by the president, because both actions are currently illegal under Pentagon guidelines. It is an odd position for him to take as he defends torture in his book and never challenged White House orders when he was at NSA.

Hayden also somewhat curiously disagrees with Trump and all the other Republican candidates in his unwillingness to support Obama administration efforts to obtain backdoors on security systems in place on telecommunications equipment. Hayden was referring specifically to attempts to coerce Apple to crack the security on its iPhones to obtain additional information relating to the San Bernardino terrorist attack. This position places him at odds with FBI director James Comey. Hayden, as a former director of the NSA, bases his opposition on his knowledge of how security systems can be broken. He asserts that once a breach is engineered into a system it becomes easy to compromise. If Apple were to do as the government is demanding, every iPhone could potentially be attacked down the road by criminal hackers as well as by government agencies acting without any legal authority.

Books by former top spies are generally self-serving, written to explain away the bad decisions made by the authors, a form of confession without any penance or even a mea culpa. They also frequently come with a whopping advance, $4 million in the case of the memoir authored by George Tenet in 2007. Publishers apparently think that anything written about spying is a potential best seller, even though the actual books most often turn out to be somewhat less than that and wind up on remainder piles.

The disappointment in books written by ex-spooks is derived from the fact that they really cannot tell the reader anything interesting as all of that sort of thing remains classified. That means that they talk about process and decision making, which is generally quite boring, requiring them to rely on dramatis personae to create literary tension—with characters like Dick Cheney and Scooter Libby plus assorted world leaders popping into and out of the room like players in a Pirandello comedy. But even the antics of Cheney and Libby tend to pall after the first 30 pages.

What is interesting, however, is the revelation to the public of how a senior official whose entire life has been in the intelligence profession as a top-level bureaucrat thinks. I am not speaking of folks in the middle of the machine like myself, who kvetched regularly about the layers of intransigent management throughout the intelligence community. I am talking about the true believers who ran the machine and actually had a stake in determining what it did and how it did it. In that sense, Hayden’s book and his interviews have been quite revealing.

Hayden was directly involved in two newsworthy projects—the warrantless surveillance and data mining under George W. Bush and the targeted assassination program that was developed under Barack Obama. He enabled both and also supported rendition and torture, raising no questions about the ethics of what was being demanded by the White House. In defending the warrantless surveillance program, Hayden focuses on its legality, ignoring the fact that it produced little or nothing useful while at the same time damaging relations with key allies and compromising the personal security of an untold number of American citizens.

Hayden persists in some views that have long since been discredited, believing, for example, that torture produced information that was vital to the killing of Osama bin Laden. He dismisses 2014’s meticulously researched Senate Intelligence Committee report, which criticized Hayden for misleading the committee and came to a dramatically different conclusion. Hayden has also joined the chorus insisting that the report was flawed because it was written by “Democrats.”

While CIA director, Hayden likewise resisted the release of the Bush Justice Department torture memos, arguing that to do so would damage CIA morale. In fact, when the memos were released they demonstrated how flimsy the government case was for proceeding with the “enhanced interrogation” program.

It appears that Hayden never actually was engaged in any espionage at the working level, but he managed America’s two preeminent spy agencies, dealing with his customers in the government and his counterparts overseas while making adjustments to keep up the morale of his thousands of employees after they came under attack for the Bush-era policies. As the title of his book suggests, he saw his role as director of NSA and later CIA in simple terms. That was to do anything he could to respond to White House demands for “more” information while providing options to disrupt terrorist activity by doing absolutely everything possible—“up to the edge” of limits imposed by law and the constitution. This meant in practice that he was more interested in the letter rather than in the spirit of the law, so any green light from a government lawyer was considered to be enough of a fig leaf to move ahead. And proceeding with a course of action also included routinely deferring to the hysterical demands of unreliable politicians who themselves feared not “doing enough” in the eyes of the public.

In attempting to carry out his inevitably poorly defined mission to protect the country, Hayden sees certain intrinsic obstacles. They include politicians too weak-kneed to have a clear vision of what needs to be done and those who would expose what the government is doing. George W. Bush and Dick Cheney emerge from the book as exemplary no-nonsense leaders while Obama and and a number of leading Democrats are timid, guilt-ridden, and indecisive. The lurking media is always the enemy.

But Hayden’s book also includes some moments of serious introspection. He admits that the intelligence community, existing as it does in a bubble, has often connected poorly with the public, the media and even with government oversight. He accepts that changes are needed to explain the importance of the intelligence product and almost welcomes the Edward Snowden revelations as some kind of wake-up call, even though he makes clear how much he despises the messenger.

In spite of his willingness to ignore the collateral damage caused by many poorly conceived U.S. government programs that he oversaw, Michael Hayden is not a monster. And one might even argue, relying on his first person account, that the Cheneys and Bushes of this world are often unfairly maligned as they sought to deal with a post-9/11 situation that was both unprecedented and unimaginable. It may have been beyond anyone’s ability to craft a proportionate and effective response to assuage the fear gripping the nation, as strident demands to “do something” came from politicians and the media alike.

Hayden, perhaps understandably, does not dwell much on the disasters in Iraq and Afghanistan, self-inflicted wounds far removed from any justification provided by the panic around 9/11. He focuses on terrorism, not foreign policy, and certainly thought that freedom to tap phones and take other extraordinary steps was all about the salvation of the Republic and not an attack on the Constitution or rule of law. But now, 15 years later, there is perspective. It behooves the architects of the “war on terror” policies to come to grips with the mistakes that were made then—and that continue to be winked at now. As we have seen in the case of the violent GOP reaction to Trump’s denunciation of the Iraq War, self-criticism beyond a certain point is not yet to be expected, either from the writers of insider memoirs or most of those seeking the presidency.

Philip Giraldi, a former CIA officer, is executive director of the Council for the National Interest.