It’s not the role of American diplomats to join the resistance against Trump.

This week David A. Rank, the charge d’affaires at the U.S. embassy in Beijing, did the right thing. Finding himself unable to carry out his duties in support of the policies of the elected government of the nation he serves, Rank resigned. On the other side of the world, another career Foreign Service officer did the opposite. Lewis A. Lukens, the charge d’affaires in London and currently the acting ambassador, tweeted his support of London mayor Sadiq Khan in the midst of the president’s cross-Atlantic Twitter spat with the mayor.

Unfortunately, many Americans will draw the wrong conclusions from the actions of these two men. Even those who disagree with his decision should respect Rank’s willingness to give up his job on a point of principle. Lukens may also get cheers, but he deserves none. Going out of his way to support Khan when Trump was exchanging barbs with him was more than a mistake. No matter what you think of Trump, when a U.S. diplomat inserts himself into such a dispute it’s a violation of the trust that the nation places in its representatives to loyally represent its government.

But the dilemma facing the State Department today may not be so much the actions of two men who have paraded their political disagreements with the president in public. The real problem may be those in the Foreign Service who are staying at their posts and off Twitter but may also be carrying out their duties with a lack of enthusiasm or with willful disobedience that will undermine Washington’s ability to act.

That liberals predominate among federal employees is not exactly a secret. That career Internal Revenue Service staff — acting either on their own or responding to clear signals from the Obama administration — chose to discriminate against conservative groups applying for non-profit status is a matter of record. But if many pockets of the federal bureaucracy tilt left, that is also true of the department tasked with carrying out the orders of the executive with respect to foreign affairs. In January, 1,000 State Department staffers signed a cable protesting Trump’s original travel-ban order. But, unfortunately, the problems in the Foreign Service go beyond such flamboyant, and clearly inappropriate, gestures. As the New York Times reported this week, tension between the White House and senior levels of the diplomatic corps is rising. If true, this is troubling because if senior personnel — people who have served under both Republican and Democratic administrations and who should be setting an example of apolitical behavior — are ready to step outside their lane and demonstrate their opposition to the government of the day, that raises the possibility that the president can no longer count on the loyalty of the Foreign Service.

It also feeds the sense on the part of some administration supporters that the flood of illegal leaks of classified information designed to embarrass Trump from government employees to the press is more than Washington business as usual. Monday’s indictment of an intelligence contractor who is alleged to have distributed National Security Agency documents to journalists is just the tip of the iceberg. What is happening now may be a symptom of an open revolt in which government officials join the “resistance” against Trump in a manner that resembles a coup in a banana republic more than the workings of American democracy.

Talk of a “deep state” seeking to thwart Trump sometimes tells us more about the grievances and complexes of alienated conservatives making this charge — especially those who fall under the rubric of the alt-right — than anything else. But when diplomats start acting like free agents rather than like the voice of those who were elected to set foreign policy, the notion of a conflict between career civil servants and those chosen to run the government stops being a paranoid fantasy.

It is true that in terms of his behavior and his views Trump is not a typical president. There is nothing irrational, let alone dishonorable or illegal, about opposition to any number of his positions, including his stance toward NATO, trade, the Middle East, and even immigration. But setting policy is still the purview of the president, not the civil service.

As for Lukens, those who claim that in a normal administration praise for a mayor of a city in an allied country beset with terrorism would be the default reaction of U.S. diplomats are missing the point. Lukens is no novice. He was undoubtedly aware of the president’s statements about Khan. Trump’s tweets may be another example of the president’s astoundingly poor judgment. But it is not the job of the acting U.S. ambassador to Britain to correct or show up his boss. If Lukens and any other career Foreign Service officers feel they can’t serve Trump, then they should emulate Rank and resign. If not, they should keep their mouths and social-media accounts shut.

Perhaps many on the left as well as those who work inside the government feel that Trump is the exception that proves the rule and that they are morally justified when they seek to sabotage his administration. Perhaps others believe they should act to save a wayward leader from self-sabotage or from the consequences of his own folly. But whether or not they are right about Trump, he has the right to expect the Foreign Service to serve him as loyally as it did his predecessors. A nation whose government employees feel empowered to act against the government of the day ceases to be a democratic republic and starts down the road to tyranny and chaos.

Let’s admit that part of the current situation in the Foreign Service is the result of many important posts remaining unfilled more than four months into Trump’s administration. That’s helped create a vacuum in the carrying out of U.S. foreign policy that Secretary of State Rex Tillerson is struggling to deal with. Some of this problem is due to congressional Democrats’ slow-walking all presidential appointments and jamming up the confirmation process. But the lion’s share of the blame belongs to a White House that appears to be unable to get its act together and vet all of the appointments that need to be made amid the chaos and infighting that currently reigns in the West Wing.

Foreign Service officers may have enjoyed their jobs more when they were carrying out President Obama’s will, but Trump’s mandate is no less legal.

But the inability of the administration to put men and women willing to follow Trump’s orders in place is no excuse for the Foreign Service to go rogue. They may have enjoyed their jobs more when they were carrying out President Obama’s will, but Trump’s mandate is no less legal. More to the point, following his orders is not optional.

As with the leaking of classified material, opinions about State Department sabotage of the White House tend to depend on where you stand on the political spectrum. Anyone who leaked information to expose Obama’s push to appease Iran or otherwise obstruct his plans would have faced no mercy from that administration and its supporters while being cheered by many on the right. But now that the shoe is on the other foot, State Department and NSA workers who play that game with Trump are being lauded as patriots by the Left while being decried as traitors by the Right.

But the principle ought to be the same no matter the policies or the president. It’s up to the voters to decide who runs the government and whether elected leaders should be replaced, not the bureaucrats or the diplomats who serve them. Government employees that work to undermine the president should be fired, and if their misbehavior involves violating security laws, prosecution is fully justified. Trump notwithstanding, mutiny in the State Department cannot be tolerated, let alone cheered for partisan reasons.