Would Colonel Qaddafi have given up that nuclear weapons program if he had known what was to come? Would the United States and Europe have used force against a nuclear-armed country? Not likely. And therein lies the rub with North Korea. Mr. Kim and his father built a nuclear arsenal for the very purpose of ensuring the security of their state against the kind of intervention that happened in Libya, which is why North Korea has insisted the United States promise not to invade as part of any deal.

“I heard directly from the Chinese that the Libyan model did not inspire confidence in Pyongyang,” said Antony J. Blinken, a deputy secretary of state under Mr. Obama. “I would be very concerned that the combination of Libya and then Trump tearing up the Iran agreement sends exactly the wrong message to Kim Jong-un and undermines whatever hope exists for negotiations.”

Mr. Bolton raised the Libya example in weekend interviews on “Face the Nation” on CBS and “Fox News Sunday,” his first television appearances since becoming national security adviser early this month.

“We have very much in mind the Libya model from 2003, 2004,” he said on Fox. “There are obviously differences. The Libyan program was much smaller, but that was basically the agreement that we made.”