Barack Obama's most significant move during his short Senate career was betraying a promise to filibuster any bill containing retroactive immunity for telecom companies that had cooperated with President Bush's warrantless wiretapping program.

This was a telling decision, as President Obama would go on to embrace most of the Bush security apparatus and even extend it in some areas. He did issue executive orders banning torture, and made some perfunctory efforts to close the prison camp in Guantanamo Bay. But he refused to prosecute any of the torturers (itself a treaty violation), and he dramatically expanded the use of due process-free drone assassination and dragnet surveillance, as the Snowden documents revealed.

Essentially, the security agencies were allowed to run riot. And in a dark twist, his chosen successor Hillary Clinton would pay for this at the polls.

A recent review of studies convincingly argues that FBI Director James Comey's letter vaguely announcing a new chapter in the email investigation eroded Clinton's margins by enough to make her lose. It was a damning announcement, coming from a relatively respected institution, at about the worst possible time. There were also an unusually large number of undecided voters that late in the campaign, and the FBI's announcement got saturation coverage.

It's important to emphasize that in such a close election, there are dozens of things that could also have tipped the balance. The fact that it was close enough to tip in the first place shows that Clinton was a terribly weak candidate — it is a virtual certainty that had Obama been on the ballot, he would have weathered such a blow. But it's still highly alarming that without a single action taken by the head of the FBI, Donald Trump would not have been elected president.

And that's only the tip of the iceberg. As Glenn Greenwald demonstrates, much of the 2016 election played out as a proxy war between the pro-Clinton CIA and the pro-Trump FBI, with dueling op-eds, anonymous leaks, and accusations.

This kind of thing is perhaps the major reason to preserve due process and civil liberties in the security apparatus. One of the more shameful aspects of the Obama presidency was watching liberals reverse-engineer reasons for why Bush-era security policies were now good, as they became Obama-era security policies. The most common rationale they landed on was the usual one about there being a tradeoff between security and privacy, and in a dangerous world we've simply got to give the spooks greater latitude (read: break whatever laws they want).

This argument is trash for many reasons, but among them is that it presents an incomplete picture of what is being sacrificed. Individual privacy is harmed by dragnet surveillance and unaccountable security agencies, but so is the basic democratic nature of the political system. Mass spying means endless opportunities to dig up embarrassing private information for blackmail, and unaccountable agencies will inevitably give themselves free rein to interfere in the electoral process.

Any nation with the slightest sense of self-preservation would have totally reorganized the security apparatus after the staggering failures of the Bush administration. They could have prevented 9/11 and didn't due to incompetence and bureaucratic pissing matches. They connived in a war of aggression that turned into the worst foreign policy blunder in American history. They conducted illegal surveillance and illegal torture.

If a nation is to be a genuine democracy, spying and violence must be firmly subordinated to the people's elected representatives. But Obama used neither the large Democratic majorities in 2009-10 nor his executive authority to press for fundamental reform. Instead, with rare exceptions, he backed the spies to the hilt — and partially as a result, Hillary Clinton lost. (To be fair, the Department of Justice did announce Thursday it was going to investigate certain pre-election actions by the FBI, with a whopping eight days to go before Trump takes office.)

And now with Trump as president-elect, the interference of the security agencies has only accelerated. In Russia, as everyone is learning, "kompromat" is part of the method by which Putin maintains an iron grip on power, by discrediting opposition leaders with blackmail handed to pet tabloid attack dogs. Now security agents are in open conflict with the president-elect, in a way strongly reminiscent of this system, as CNN reports that top intelligence officials presented briefings about alleged Russian blackmail materials to Trump and President Obama. (The material was later published by BuzzFeed News, and appears highly suspect.)

If Trump is brought to heel by the security goons, some disaster might be avoided. But the very fact of the elected president taking dictation from the CIA (much less the Russian FSB, for that matter) is extraordinarily terrible. Sooner or later, someone will come to power with the opposite relationship to the blackmail machine. And that might just be the end of America's republican experiment.