Special counsel Robert Mueller. (Saul Loeb/Agence France-Presse via Getty Images)

If President Trump ordered a senior government official to support the firing of special counsel Robert S. Mueller III, how should that person respond?

Adm. Mike Rogers, head of the National Security Agency, answered my question about such a problem onstage last week at the Aspen Security Forum. He began with a caveat that he wouldn’t answer a hypothetical, so it shouldn’t be taken as a direct comment on Mueller, but he did offer a personal statement that brought spontaneous applause:

“I will not violate the oath I have taken in my 36 years as a commissioned officer.” He said that he regularly reminds NSA employees to recall their own oaths and ask themselves: “Why are we here? What are we about? What is it that we are defending? . . . I won’t sacrifice that for anyone.”

In Trump’s Washington, it’s a fact of life that officials must now weigh whether they would follow presidential orders that might be improper or illegal. Officials mull (and occasionally, discuss quietly) what to do if a presidential request for loyalty conflicts with their sense of right and wrong.

A possible order to fire Mueller is an imminent concern, but there are other tests of loyalty and conscience that could arise with this impulsive, policy-by-Twitter chief executive.

(Taylor Turner/The Washington Post)

Take Trump’s proclamation Wednesday that transgender people shouldn’t serve in the military. This apparently caught the Pentagon by surprise and contradicted a wait-and-see statement by Defense Secretary Jim Mattis. How should he and his generals respond to the president’s edict?

Mattis and his commanders must also ponder how they would react to an impulsive order to conduct military action somewhere. Can they say no to the commander in chief?

Presidential orders cannot ordinarily be ignored or dismissed. Our system gives the commander in chief extraordinary power. Jack Goldsmith, a Harvard University law professor and former assistant attorney general, explained in an email: “A subordinate in the executive branch has a presumptive duty to carry out the command of the president. If one doesn’t want to for any reason, one can resign — or refuse the order and face a strong likelihood of being fired.”

For a military officer, the standard is even tougher. Soldiers must obey orders unless they’re unlawful. Under our system of civilian control, if the president issues an order (as on transgender soldiers), the military’s default response is to carry it out. Courts may find the presidential order to have been unconstitutional, but the military cannot make its own policy or law.

How should Congress and Justice Department officials weigh their choices as Trump threatens openly to fire Attorney General Jeff Sessions, presumably to clear the way for firing Mueller? It’s useful to think about the unthinkable — as a way of surfacing, and hopefully preventing, abuse of power.

Let’s start with Justice. Because Sessions recused himself from the Russia investigation, an order to fire Mueller, for now, would go to Deputy Attorney General Rod J. Rosenstein — who has strongly indicated that he would refuse. In June, members of the Senate Appropriations Committee got this commitment: “I am not going to follow any orders unless I believe those are lawful and appropriate orders. Special counsel Mueller may be fired only for good cause, and I am required to put that cause in writing.”

Can Congress obtain similar pledges from other senior officials of the Justice Department who would be in the chain of command? During the Watergate scandal, Attorney General Elliot Richardson and his deputy, William Ruckelshaus, felt bound by the commitments they had given Congress not to fire special prosecutor Archibald Cox. A similar chain of obligation should be forged now, to circumscribe Trump’s ability to sack Mueller.

Given the expectation that Rosenstein (and probably others) would quit rather than fire Mueller, the White House seems to be thinking about installing a new attorney general who wouldn’t have the recusal problem and could be counted on to fire Trump’s nemesis. Members of Congress are said to be gaming this option, thinking of ways to block a recess appointment or to extract a promise from any Sessions successor to leave Mueller alone. That’s another good firewall.

Protecting Mueller by statute may be impossible because of the constitutional separation of powers. If he is fired, though, Congress could enact a new independent counsel law, at least providing the authority needed for a continuing investigation that would get to the truth of what happened. In dealing with this administration, lawmakers and other officials can’t wait until the bomb detonates; they should begin to take precautions now.

Read more from David Ignatius’s archive, follow him on Twitter or subscribe to his updates on Facebook.