White House Chief of Staff John F. Kelly needs to draw a red line. Not with North Korea but with President Trump. For the sake of Kelly’s own reputation but even more for the sake of the country, there can be no more presidential improv on the subject of North Korea or military threats in general.

This red line should be both invisible and impregnable. Only Kelly and the president should know it exists, but they should also have a clear understanding: If it is crossed, Kelly will leave. This is essential and, more important, achievable.

Drawing this line is essential because Trump’s bellicose impetuosity must be contained. Words matter, and the words of a president matter most. Therefore, they must be carefully calibrated and vetted. President Barack Obama’s ad-libbed blunder on Syria and chemical weapons taught that red lines once drawn are not easily erased; if they are crossed without consequences, presidential credibility erodes.

Thus the danger of Trump’s off-the-cuff warning: “North Korea best not make any more threats to the United States. They will be met with fire and fury like the world has never seen.” Predictably, North Korea responded with escalating threats of its own: that it was “carefully examining” plans for “an enveloping fire” around Guam, and then that it would “turn the U.S. mainland into the theater of a nuclear war” at the first hint of an impending U.S. attack.

Administration officials were left scurrying to clean up and reframe language that none had reviewed in advance. “The words were his own,” said White House press secretary Sarah Huckabee Sanders. “The tone and strength of the message were discussed beforehand.” Translation: No one knew precisely what was coming. This is no way for any president to conduct foreign policy, certainly not this president and certainly not in a situation with stakes so high.

(Adriana Usero,Kate Woodsome/The Washington Post)

Mopping up, Defense Secretary Jim Mattis’s approach was to suggest that Trump should be taken seriously but not literally; his retelling moved the red line from threat to action, as in, North Korea “should cease any consideration of actions that would lead to the end of its regime and the destruction of its people.” Secretary of State Rex Tillerson took the tack of advising that Trump should be taken seriously and not seriously, depending on the listener; Tillerson encouraged Americans to “sleep well at night and have no concerns about this particular rhetoric” even as he asserted that Trump had to employ “language that Kim Jong Un would understand, because he doesn’t seem to understand diplomatic language.”

White House aide Sebastian Gorka met Tillerson’s call for calm with ominous analogies to the Cuban missile crisis. A senior White House official told The Post, incredibly, that “ ‘fire and fury’ doesn’t always mean nuclear. It can mean any number of things. It is as if people see [Trump] as an unhinged madman.” At the State Department, spokesman Heather Nauert gamely insisted that “we are all singing from the same hymn book.” Uh-huh.

This atonal cacophony is what happens without message control. But is it realistic to speak of controlling Trump? No president likes being told what to do; Trump does not merely chafe at such instruction, he actively rebels against it. So some people look at Kelly’s thankless task and conclude that he would be lucky to be able to manage down — to contain staff chaos and feuding. In this assessment, managing up is unattainable when up means Trump.

Yes, but, this is a matter of managerial triage. Let Trump be Trump, when it comes to domestic policy and politics. Let him pick Twitter fights galore, whether with fellow Republicans such as Senate Majority Leader Mitch McConnell (Ky.) or with Democrats such as Sen. Richard Blumenthal (Conn.), just to name week’s targets. Let him watch “Fox & Friends” to his heart’s content; let him even assail the Russia “witch hunt” or the “Fake News Suppression Polls.”

Just cordon off foreign policy, or the parts of foreign policy that could lead to military confrontation. Instruct the president that statements on those subjects must be debated and scripted. Would Trump agree? Would he — could he — comply? The chaotic, risky alternative makes it worth the try. Kelly’s power is at its apex. Trump cannot afford to lose another chief of staff. So the president needs Kelly more than Kelly needs this headache of a job.

And if the general wants to avoid being treated as just another menial fly-swatter, he will seize this moment to assert control, or leave having at least tried.

Read more from Ruth Marcus’s archive, follow her on Twitter or subscribe to her updates on Facebook.