Injecting characteristic spontaneity into what might ordinarily have been a formal press conference Tuesday with the leaders of Latvia, Lithuania, and Estonia, President Donald Trump surprised the press—and some of his own top aides—by announcing that he would be sending the U.S. military to guard the border with Mexico. “We have a meeting on it in a little while with General Mattis and everybody,” Trump said. “I think it’s something we have to do.” If James Mattis, Trump’s stoic secretary of the Defense Department, was caught off guard, he didn’t show any sign. The announcement about the deployment—which experts quickly noted might be illegal under a 19th-century law restricting how the military can be used—was quickly followed by a more official statement from the White House, clarifying that Trump was referring to the National Guard. No details were provided as to whether the Guard would be asked to bolster intelligence operations at the border, as they have done in the past, or would be ordered to take on law-enforcement duties—or, indeed, whether the Guard would actually be deployed at all.

The confusion surrounding the chain of command between Trump and Mattis has been a recurring feature of the Trump presidency. In the first month of his administration, Trump skipped the interagency review process before announcing an executive order banning immigrants from several Muslim-majority countries from entering the United States, leaving most top agencies—including the Department of Homeland Security and Customs and Border Protection—in the dark, and officials scrambling to figure out what the ban actually did. The system broke down again over the summer, when the Pentagon effectively ignored the president’s tweets about banning transgender troops from serving in the U.S. military, necessitating an elaborate face-saving review process that ultimately resulted in a vague, watered-down version of the ban being announced last month. Both the immigration ban and the transgender troop ban were immediately challenged in court, and are headed to the Supreme Court.

Last week, Trump stunned the Pentagon again when he casually remarked during a rally that he would be withdrawing American troops from Syria “like, very soon” and would “let the other people take care of it now”—a move that directly contradicted Mattis’s repeated statements that the U.S. would stay in Syria as a stabilizing force. (“We have nothing, nothing except death and destruction,” Trump added, referring to the wars in Afghanistan and Iraq, where Mattis lost hundreds of American troops in battle. “It’s a horrible thing.”) On Tuesday, during his press conference with Baltic leaders, Trump doubled down, suggesting he would “bring our troops back home” soon, and that the idea is being discussed “very seriously.” On Wednesday, the White House dumped cold water on Trump’s enthusiasm for withdrawal, issuing a statement promising that “the United States and our partners remain committed to eliminating the small ISIS presence in Syria that our forces have not already eradicated.”

As The New York Times Magazine recently reported, the president still listens to and respects Mattis, whose military bearing (“the closest thing to General George Patton that we have,” Trump has said) and “Mad Dog” moniker continue to impress. “I think the president calls him for a gut check on all these things,” an executive close to Trump told the magazine. “He doesn’t do whatever Mattis says, but he does defer to him.” But as the rest of the guardrails surrounding Trump fall away, the pressure grows on Mattis to hold the line in the face of the president’s whiplash moods and impulsive instincts. Until recently, he was aligned in that effort with National Security Adviser H.R. McMaster, Secretary of State Rex Tillerson, and Chief of Staff John Kelly. Today, Tillerson is gone, McMaster has given his last public remarks before being replaced by the acerbic warmonger John Bolton, and Kelly is on the ropes—as my colleague Gabriel Sherman recently reported, Trump has mused about firing Kelly and replacing him with a new West Wing structure with four co-equal principals reporting to him. How Mattis might fit into that fractured picture remains to be seen.