On January 30, after word got out that a large number of U.S. State Department officials were preparing a formal, well-argued dissent against President Donald Trump’s cruel executive order on immigration, the White House reacted with stung indignation. Even before the cable was submitted by an astonishing total of nearly a thousand State Department staffers, Trump’s spokesman, Sean Spicer, issued an extraordinary rebuke to the professional diplomats: “These career bureaucrats have a problem with it? They should either get with the program or they can go.”

It was precisely in order to avoid that sort of stark choice that the State Department’s dissent channel was first established. Created during the Vietnam War, when many Foreign Service officers understandably had grave misgivings about U.S. foreign policy, it offered a way for them to speak their minds while continuing to serve their country. Since then, the dissent channel, at its best, has been a source of creativity and open thinking inside the bureaucracy, allowing diplomats to question widespread assumptions and challenge ideological stances from within.

Dissent cables are rare, with only four or five written every year, and dissenters are officially protected from reprisals. They are handled by the department’s policy planning staff, which passes them up to the secretary of state and other top department officials. They usually garner only a handful to a few dozen signatures, unlike the hordes that appeared on the memo criticizing Trump’s executive order. In the past, as the historian Hannah Gurman notes, the dissent channel has been used to condemn U.S. support for the junta in Argentina in the 1970s, backing for Islamist forces in Afghanistan in the 1980s, and the imminent invasion of Iraq in 2003. Although the channel, Gurman argues, is often a way to blow off steam without really shifting policy, it’s still a powerful symbol of open debate within the foreign policy apparatus.

For that reason, presidents and secretaries of state have often been annoyed or flustered by it. Most recently, in June of last year, John Kerry, as secretary of state, had to contend with a leaked dissent memorandum from 51 of his own diplomats criticizing President Barack Obama’s policy on Syria, calling for limited air strikes to help force President Bashar al-Assad’s regime to end the civil war there.

In 1970, when President Richard Nixon announced that he was invading Cambodia, 20 Foreign Service officers wrote to the secretary of state in condemnation—at the time, the largest such protest at the State Department. Nixon, enraged, at one point privately ordered the undersecretary of state to fire all of the State Department officials who had spoken against the invasion, although the administration evidently didn’t go through with it. As a beleaguered State Department official once snapped at National Security Adviser Henry Kissinger, “You don’t have to threaten us or intimidate us. You will scare the hell out of so many people in this building that no one will give you the information you should hear.”

Then, in 1971, when the Nixon administration stood behind a military regime in Pakistan that had slaughtered the country’s Bengali citizens in what today is Bangladesh, 20 American officials in the U.S. consulate there sent in a blistering dissent cable—the first one of its kind—denouncing their own government for “moral bankruptcy” in the face of “genocide.” They were stoutly backed by the consul general, a patriotic public servant named Archer Blood, who later called the names of the signatories a “roll call of honor.” When the Blood telegram reached the State Department, nine more veteran specialists on South Asia there endorsed it. Nixon and Kissinger were furious. Kissinger privately called Blood a “maniac,” and he and Nixon swiftly ousted the consul from his post in retaliation.

But even the wisest of presidents need underlings who can disagree with them. Both presidents John F. Kennedy and Lyndon B. Johnson would have been better off if they had heeded some of the cautionary advice of George Ball, the outspoken State Department skeptic of military escalation in Vietnam. In 1961, he presciently warned Kennedy, “We might have, within five years, 300,000 men in the rice paddies of the jungles of Vietnam and never be able to find them.” Still, there were limits to his dissent: As the historian Fredrik Logevall notes, Ball allowed himself to become “the designated in-house ‘dove’ on Vietnam and always put careerist ambition and loyalty to Johnson before principle.”

Spicer’s public scolding represents something new and dangerous. Kerry held a respectful half-hour meeting with eight of the diplomats who dissented over Syria. Although it didn’t lead to major policy changes, it underlined the legitimacy of honest disagreement from the ranks. Even Nixon, vindictive as he was, knew better than to publicly upbraid his wayward diplomats in Bangladesh; his personal rage and stealthy revenge are only known because they were recorded by the White House tapes. In the Trump White House, though, berating officials of the U.S. Foreign Service—even calling for its diplomats to quit—is done in broad daylight without evident embarrassment.

Spicer’s comments are particularly worrisome because Trump—who is in a bitter fight with the U.S. intelligence community and whose team has unceremoniously sacked much of the senior ranks of the State Department—stands more in need of State Department professionalism than any modern president. If the White House was genuinely interested in properly vetting which people should be allowed into the United States, who better to talk to than Foreign Service officers, who routinely start their careers as junior diplomats by issuing visas in consulates and embassies around the world? The leaked drafts of the dissent cable make a devastating case against the harshness and arbitrariness of Trump’s executive order, which closes the United States’ borders to people from seven Muslim-majority countries for at least 90 days, suspends the admission of refugees for 120 days, and bars Syrian refugees indefinitely. As the draft dissent memo notes, the ban hurts U.S. national security by alienating Muslims both at home and around the world, both of whom the government needs to work with on fighting terrorism. It heartlessly burdens foreigners who want to come to the United States for medical treatment, a parent’s funeral, or to help a relative. It undercuts the United States’ standing as an immigrant haven. And its obvious targeting of Muslims—which follows Trump’s campaign pledge of “a total and complete shutdown of Muslims entering the United States”—threatens to create an immigration system based on discrimination.

When Nixon second-guessed the judgments of the State Department, he could at least trust his own hard-won knowledge about governments around the world. Not Trump. The new president has already packed a remarkable number of potentially disastrous foreign-policy misjudgments into the past few weeks: rattling NATO allies by calling the alliance “obsolete,” heartening China while frightening U.S. allies in Asia by withdrawing from the Trans-Pacific Partnership, picking bitter fights with the friendly countries of Mexico and Australia, and more. Should Trump one day land himself in a Vietnam of his own, he may have cause to wish that his team had not worked quite so hard to drive away the seasoned diplomats who might have warned him off.