Forty years ago, when I worked as legal counsel for the Senate Foreign Relations Committee, we occasionally pulled all-nighters reconciling the House and Senate versions of a bill. Inevitably, we haggled over the wording, each side trying to preserve the language that would please our respective bosses. One evening, as we were toiling over a bill that contained provisions on foreign aid, human rights, and arms sales of keen interest to the State Department and the Pentagon, I set off through the warrenlike offices of the Rayburn Building in search of coffee. Opening the wrong door, I was surprised to find a State Department lawyer sitting at a desk, in front of a typewriter. He should have been at home, in bed, but here he was, typing away, writing language that he was quietly slipping to the House staffers, who presented it as their own.

Back then — even then — the influence of national security bureaucrats pervaded the lawmaking process. They drafted legislation that members of Congress introduced. They endorsed or opposed measures at hearings and markups. They presented views to conference committees that were laid out next to the House and Senate positions. They lobbied tirelessly, waiting outside the chambers during floor debates, ready with arguments and the data to back them up, pushing to inscribe their positions into law.

Today the influence of the bureaucrats is even more profound. A de facto directorate of several hundred managers sitting atop dozens of military, diplomatic, intelligence, and law enforcement agencies, from the Department of Homeland Security to the National Reconnaissance Office, has come to dominate national security policy, displacing the authority not only of Congress but of the courts and the presidency as well. The precise sizes of the agencies’ budgets and workforces are classified in many cases, but the numbers are indisputably enormous — a total annual outlay of around $1 trillion, and employees numbering in the millions.

The growth of this security edifice was mostly unplanned and unintended. In an attempt to contain the Soviet threat and end the internecine warfare among the U.S. armed services after World War II, President Harry S. Truman centralized national security decision-making.With his support, Congress created the modern Joint Chiefs of Staff, the CIA, and the National Security Council. Truman established the National Security Agency personally, through a secret order.

Liberals in Congress generally supported Truman’s initiatives, but conservatives feared that newly concentrated security authority posed a threat to democratic institutions and civilian control of the military. They invoked the specter of a “police state” run by “power-grabbing bureaucrats.” Truman himself, according to his adviser Clark Clifford, was “very strongly anti-FBI.” Nevertheless, the president believed that his new institutions were the best way to address security threats while safeguarding individual and political freedoms.

Truman’s hope proved misplaced. As one administration followed another, democratic accountability diminished, triggering an enormous transfer of power from elected officials to bureaucrats. Yet it was necessary to maintain the illusion that national security was controlled by our constitutionally established democratic institutions. To do otherwise would be to undermine the legitimacy both of those institutions and of the security bureaucracy itself.

Successive presidents therefore sought to project an image of unity between themselves and the security directorate, despite often divergent agendas. Barack Obama was a case in point. When the Pentagon advocated a troop surge in Afghanistan, Obama kept his disagreement largely out of the public eye. When NSA mass surveillance became a public embarrassment, Obama stuck with the organization. When his director of national intelligence, James Clapper, lied about it to Congress, Obama did nothing. And when the Senate Intelligence Committee’s torture report sparked calls to punish the torturers and their bosses, Obama came to their defense. No one was prosecuted.

Despite Obama’s gestures toward harmony, it became increasingly difficult to believe that the three constitutionally established branches of government actually controlled U.S. security policy. After reports emerged that the NSA had eavesdropped on the cell phone conversations of Angela Merkel, the German chancellor, for example, Obama’s national security adviser claimed the president knew nothing about it; some of these programs, Secretary of State John Kerry confessed, were on “automatic pilot.” The courts, for their part, used ringing rule-of-law rhetoric in high-profile detention cases, but in lower-profile disputes about national security, judges were noticeably less impassioned, often dismissing challenges to unlawful war-making, torture, surveillance, and kidnapping on dubious jurisdictional grounds. And Congress’s role in defining national security became more and more ceremonial. It all but abandoned its share of the war power, responded largely cosmetically to warrantless NSA surveillance by enacting the USA Freedom Act, and substituted hindsight for oversight when it came to black-site prisons and torture.

A few counterexamples do exist. Obama’s decision to go after Osama bin Laden suggested strong presidential involvement. Such actions were essential to preserving the familiar illusion of democratic control. But after Candidate Obama had forcefully and eloquently promised fundamental change, President Obama’s remarkable continuation of numerous Bush-era national security policies — warrantless mass surveillance, drone strikes, state-secrets claims, torturer immunity — ultimately took its toll. By the time Donald Trump appeared on the scene, the veneer of harmony had worn thin, exposing the bureaucracy’s dominance.

Over the course of President Trump’s short tenure, an unprecedented, seismic split between the Oval Office and the security directorate has taken place. The cracks began to show as early as the campaign, when Trump criticized the military’s top brass. The war against the Islamic State, he claimed, was being waged by generals who had been “reduced to rubble” and knew less about the militant group than he did. Trump then turned on the intelligence community, insisting that the security managers had “no idea” who was behind the hacking of Democratic emails and that it was “ridiculous” to think Russia had intervened in the election on his behalf. “These are the same people,” the Trump team said in a statement, “that said Saddam Hussein had weapons of mass destruction.” He proceeded to accuse them of leaking compromising information about him, comparing the practice to Nazi Germany.

Trump’s ultimate repudiation of the CIA was in one way the most far-reaching: scrapping the President’s Daily Brief. “I don’t have to be told the same thing in the same words every single day for the next eight years,” he explained. The early-morning briefing from the CIA had long been more than a mere secret-news-of-the-world update: It was an agenda-setting meeting during which the agency laid out its framework for thinking about international developments and which sparked protracted discussion among White House participants. That worldview, internationalist in nature and emphasizing an activist international role at the expense of domestic priorities, extended well beyond the briefing. I observed that dynamic many times in closed-door briefings of the Senate Foreign Relations Committee. The briefers would leave, but their unspoken assumptions remained in the air.

The security directorate did not take these attacks lying down. Intelligence officials allegedly withheld sensitive information from Trump (a charge the White House and the Office of the Director of National Intelligence deny) and refused to grant a security clearance to one of his NSC officials who had reportedly been critical of the CIA. But the bureaucracy’s retaliatory weapon of choice was the leak — particularly on the explosive question of preelection communication between Trump’s staff and the Russian government. Four current and former U.S. officials told the New York Times that Trump’s campaign had had repeated contacts with senior Russian intelligence officials. And according to the Washington Post, nine senior intelligence sources from multiple agencies disclosed that Trump’s first national security adviser, Michael Flynn, had spoken with the Russian ambassador. Intercepted communications, the Post said, indicated that the two had discussed U.S. sanctions against Russia, contradicting what Flynn had previously told the FBI. Later, when Trump accused Obama of ordering the tapping of his own phones, word leaked that James Comey, the FBI director, had asked the Justice Department to publicly reject Trump’s assertion.

The rift has created a crisis of legitimacy for both sides. When the president disparages the knowledge and expertise of the intelligence community, he casts doubt on the soundness of his own national security decisions and undermines his own authority. Trump has placed himself in a double bind: If he relies on the intelligence community’s purportedly erroneous analysis, how can he expect his decisions to be taken seriously? And if he rejects that same analysis, where else can he turn for information on North Korea’s nuclear weapons program, Iran’s compliance with the nuclear deal, China’s cyber intrusions? Could Sunday-morning talk shows have substituted for the CIA’s slideshow revealing Soviet missiles in Cuba?

The break with Trump also hamstrings the intelligence community itself. If Trump demeans its expertise and severs its connection to U.S. elected officials, how can it expect deference to its judgments or decisions? Unlike the political branches of the government, the intelligence agencies have no freestanding bona fides. Their credibility derives from the public’s belief that they are directed and controlled by officials the public elects. If even this tenuous connection to electoral democracy is broken, their views become a mere second opinion, afloat in a miasma of tweets, blog posts, and fake news. The chief executive and the intelligence community thus face the same dilemma: How can they replenish the legitimacy depleted by their rift — when the legitimacy of each depends on that of the other?

Trump cannot bolster his credibility by crushing his tormentors, which would be his normal instinct, for the simple reason that he needs them: clandestinely collected information and covert operations sometimes are essential to safeguarding the nation’s security. A more sensible strategy for Trump would be to simply declare victory — to point to ostensible “reforms” that rehabilitate the intelligence community and enable its analysts to provide reliable, unpoliticized information. The object would be both to dampen opposition within their ranks and to revive the appearance of operational harmony. Among the security directorate’s multiple informal, shape-shifting, agency-spanning networks, Trump would have no problem finding pockets of supporters with axes to grind, careerists willing to circumvent traditional chains of command to collaborate with the White House. He could play off faction against faction and agency against agency in a strategy of divide and conquer.

In the face of such turmoil, former acting CIA director Michael Morell has written, morale would deteriorate, and officers would “vote with their feet,” potentially leaving by the hundreds. Trump’s press secretary, Sean Spicer, all but suggested as much when opposition emerged within the State Department to the president’s ban on refugees and immigrants from seven majority-Muslim countries. “These career bureaucrats have a problem with it?” he asked reporters. “They should either get with the program or they can go.” Spicer later declined to reject the idea that a “deep state” was actively working to undermine Trump, arguing that “there are people burrowed into that government” who had a hostile agenda.

For his burrowed-in adversaries, combating Trump with leaks is, at best, a short-term tactic for buttressing their organizations’ authority. Leaks — such as the recent release of the CIA’s cyberwar tool kit by WikiLeaks — connote indiscipline, and thus provide fodder for the argument that a disorderly intelligence community needs a thorough housecleaning. Moreover, as Trump pointed out, the leaks are felonies (and they come from the same organizations whose leaders once called for Edward Snowden’s head). Increasingly fragmented and cut off from the power they enjoyed by virtue of their closeness to the president, these agencies have one long-term alternative if they are to retain public deference in the face of a continuing Trump onslaught. They must, for the first time, establish their right to act apart from — and at odds with — the elected president who remains their nominal boss. To do so requires publicly siding with supporters on the Hill, in the media, and within the electorate. Closed-door briefings, public testimony, and speeches and op-eds by former officials can all signal allegiance and generate political clout. To all appearances, the strategy seems to be working.

Many never-Trumpers in both parties now regard the security bureaucracy as their last, best hope. Following the Washington Post’s disclosure on December 9 that the CIA believed Russia had intervened in the election to help Trump, the agency overnight became the great darling of many Trump critics. They urged it to share its secrets with the Electoral College with the goal of preventing the president-elect from taking office. Trump was “being really dumb” by feuding with the CIA, according to Senate Minority Leader Chuck Schumer. “You take on the intelligence community, they have six ways from Sunday at getting back at you.” Francis Fukuyama hoped that “America’s enormous bureaucracy” would restrain Trump. Bill Kristol proclaimed he would “prefer the deep state to the Trump state.” And The New Yorker assured readers that the intelligence community’s managers were likely to challenge Trump before Congress, which was as it should be: “This is just the sort of thing we want to see happening” as part of “the fabled ‘checks and balances’ in the U.S. system.”

Clearly the public has a right to know whether a president is telling the truth if he claims that his predecessor ordered that he be illegally wiretapped. The public also has a right to know whether the president’s staff illegally coordinated with a foreign government during the election campaign or lied to the FBI about foreign contacts. But consider the price of victory if the security directorate were somehow to establish itself as a check on those presidential policies — or officials — that it happened to dislike. To formally charge the bureaucracy with providing a check on the president, Congress, or the courts would represent an entirely new form of government, a system in which institutionalized bureaucratic autocracy displaces democratic accountability. What standing would Trump’s critics have to object to bureaucratic supremacy should an enlightened president come along, in some brighter time, and seek to free them from the “polar night of icy darkness” that Max Weber warned is bureaucracy’s inevitable end point? Where then would they turn, having consecrated the security directorate as their final guardian?

As a creature of the people’s elected institutions, the bureaucracy was never intended to be a coequal of Congress, the courts, and the president. Bureaucracy doesn’t even appear in the constitutional design that emerged from Philadelphia in 1787. Under the Constitution, power is delegated to the intelligence bureaucracy, not by it. Like other departments and agencies, an intelligence organization can exercise only those powers given to it by its constitutionally established creators. Those who would counter the illiberalism of Trump with the illiberalism of unfettered bureaucrats would do well to contemplate the precedent their victory would set.

This perilous precedent would be the least of it, however, should the bureaucracy emerge triumphant. American history is not silent about the proclivities of unchecked security forces, a short list of which includes the Palmer Raids, the FBI’s blackmailing of civil rights leaders, Army surveillance of the antiwar movement, the NSA’s watch lists, and the CIA’s waterboarding. No one passingly familiar with this record of abuse and misconduct could seriously contemplate entrusting these agencies with responsibility for preserving the nation’s civil and political liberty. Without constitutional accountability, what reason is there to believe that they would not quickly revert to their old ways, particularly should a national emergency provide plausible justification? Who would trust the authors of past episodes of repression as a reliable safeguard against future repression?

Trump has gotten where he is by defying experts and attacking elites. The security managers have gotten where they are by obeying authority, not questioning it. It’s possible that bureaucracy’s red tape will further entangle the president or that the scent of despotism will further bestir the bureaucracy. The more likely scenario, however, is darker. Some of Trump’s antagonists blithely assume that the security bureaucracy will fight him to the death, but it has never faced the raw hostility of an all-out frontal assault from the White House. If the president maintains his attack, splintered and demoralized factions within the bureaucracy could actually support — not oppose — many potential Trump initiatives, such as stepped-up drone strikes, cyberattacks, covert action, immigration bans, and mass surveillance. Security managers tend to back policies they see as ratcheting up levels of protection; that’s why such programs are more easily expanded than scaled back. That deep-seated propensity will play into Trump’s hands, so that if and when he finally does declare victory, a revamped security directorate could emerge more menacing than ever, with him its devoted new ally. Trump has already restored the CIA’s authority to conduct drone strikes, dropped plans for a far-ranging White House review of the intelligence community, and broadened Pentagon authority over military operations.

Undoubtedly, some officials will leave when faced with Trump’s sticks. But plenty, I suspect, will overcome their qualms, accept Trump’s carrots, and do his bidding. I have witnessed this dynamic firsthand. In 1978, the Senate Foreign Relations Committee was interested in what steps American law enforcement and counterintelligence officials were taking (or not taking) to stop the intelligence services of repressive “allies,” such as Pinochet’s Chile, the shah’s Iran, and Marcos’s Philippines, from harassing, surveilling, and intimidating opponents within the United States. In Langley, Fort Meade, and elsewhere, my colleagues and I took the (still classified) statements of dozens of security officials. Some of them described conduct they found deeply repugnant. But we encountered no one who had objected, and identified no official who had resigned in disagreement. Everyone stayed.