Containing the North is not a simple task. President Bill Clinton worked out a deal that froze the North’s plutonium program for eight years, only to see the agreement collapse under George W. Bush. The North’s nuclear program is now far more advanced, making getting rid of it, or even containing it, a lot harder.

North Korea’s leader, Kim Jong-un, is certainly playing a dangerous game; Nikki Haley, the United States ambassador to the United Nations, warned Monday that Mr. Kim is “begging for war.” But unless he is completely deranged he must know that war with the United States would be suicide. He seems to regard nuclear weapons as his only guarantee of survival in the face of American hostility.

He has reason to worry: Col. Muammar el-Qaddafi, the Libyan leader, gave up his nascent nuclear program in 2003 in return for promises of economic integration with the West. But when rebels rose up against him, he was bombed by the United States and its allies, then executed by rebels.

Defense Secretary Jim Mattis and Secretary of State Rex Tillerson have insisted that the United States is not aiming for regime change. But it could be doing considerably more to lower the temperature and lead the way to a more peaceful solution. On Sunday, Mr. Mattis seemed intent on doing just the opposite, promising a “massive military response” in return for “any threat” — not just an attack but the threat of an attack — against the United States; its territories, like Guam; or its allies. And while Mr. Mattis and Mr. Tillerson have both hinted at dialogue with the North, Mr. Trump tweeted that “talking is not the answer!”

Ms. Haley pressed the Security Council this week to impose an oil ban on North Korea. That’s a likely nonstarter, since it would mostly affect China, which is the North’s primary oil supplier and has long resisted such a ban because it fears it could set off a collapse of the Kim regime, a flood of refugees into China and the reunification of the Korean Peninsula under South Korea. Many experts also doubt the usefulness of sanctions as a tool to force the North to abandon its nuclear weapons, which Pyongyang sees as the only real leverage it has on the global stage.