In the effort to understand North Korea's decision to test a nuclear weapon this week, several theories have been advanced.
The North Korean military probably wanted to test and prove a weapon it had spent years developing and that had performed very poorly in its first test in 2006. Kim Jong-il, probably fading from the scene and hoping for one of his sons to succeed him, wanted to please his country's powerful military at a crucial time in the transition process.
North Korean hard-liners in general, perhaps somewhat worried by President Obama's pledge of openness as well as his international popularity, may have preferred to rekindle tension in the U.S.-North Korean relationship - believing they must portray the United States as a bully when it reacts to North Korean provocations in order to stay on good terms with China and Russia. North Korean leaders also may have been frustrated by Mr. Obama's relative lack of attention to their part of the world to date.
All these theories probably have a kernel of truth. In addition, while North Korea risks some tightening of sanctions as a result of this test, on balance it probably will not pay a huge and enduring price for its provocation. After all, it has tested before and suffered only modest consequences.
Other countries that have tested the bomb have generally been penalized for only a relatively short time as well. This is not good news, of course - but it does suggest there is a certain logic, however unfortunate and however twisted, to North Korean behavior.
In shaping the U.S. and international response, the Obama administration need not worry too much about political criticism at home. Partisans on both sides will attempt to portray the nuclear test as a vindication of their own approach and a referendum on the other side's failed philosophy. But in fact, both sides and all approaches have failed over the past decade or so. The Clinton administration did a good job with the 1994 Agreed Framework, but in its second term, it generally failed to pursue a broader agenda except to send Secretary of State Madeleine K. Albright to Pyongyang on a visit.
Meanwhile, it appears that during that time, Pyongyang began to develop a secret uranium-enrichment program and also sold nuclear-related technology to Syria. President George W. Bush's hard-line policies, especially during his first term, led to the breakout of North Korea from the Nuclear Nonproliferation Treaty and its decision to reprocess enough plutonium to build six to eight weapons, roughly quintupling the size of its arsenal. Mr. Bush's new approach in his second term, particularly under chief negotiator Christopher Hill, was more flexible but in the end did not fare very well, as evidenced by where we are today.
Let's face it: It's tough to deal with the North Koreans. Not only is North Korea perhaps the most brutal government on Earth toward its own people, but it also is Machiavellian in its dealings with the outside world.
What North Korea should want, in my view, is to strike a deal in which it surrenders its nuclear capabilities and begins to reform its country as Vietnam has done - in exchange for outside aid, trade and recognition.
However, North Korea cannot bring itself to accept even the modest amount of change and risk that such a policy would require, so its leaders dig in their heels and revert to brinkmanship with the outside world (as well as more abuse of their people).
Ideally, after the inevitable and necessary flurry of international activity to penalize North Korea for its latest transgressions, we will get back to a serious negotiating agenda. The basic bargain noted above should still be our goal. However, it is not the most likely outcome, unfortunately.
From this point onward, much of the purpose of our negotiations regarding North Korea - done with the North or more likely without it, and done with just allies or China and Russia, too - should be to prepare the groundwork for other and even worse scenarios.
Here is one such terrifying concern: a North Korea that, either because of the willful action of the government or the failure and collapse of that government, can no longer be trusted with the security of its nuclear arsenal (still estimated at perhaps six to eight bombs).
We might, for example, discover that North Korea had made contacts with a terrorist organization to explore the possible sale of plutonium (or even an assembled nuclear bomb). This scenario is unlikely - probably less likely, in fact, than a successful negotiation to dismantle the North Korean nuclear arsenal. But it cannot be dismissed.
In this situation, a fairly airtight quarantine of North Korea could be needed for an extended period. In principle, such a quarantine should be feasible, but it will take effort to set up, and some of that effort should happen before the actual crisis.
An examination of trade data suggests that North Korea's shipping with the outside world probably involves fewer than a few dozen ships of cargo a week. In principle, it is certainly possible for a U.S.-led coalition to stop all such vessels, if one is willing to employ force to destroy engines or otherwise disable the ships. It may even be possible, if a major effort is organized, to inspect each of these ships for illicit cargo.
The real hard part of this mission is probably not the military dimension. North Korea has a reasonably long coastline - about 1550 miles. However, reconnaissance aircraft operating off South Korean territory or American aircraft carriers typically can spot vessels dozens if not hundreds of miles away. So continuously maintaining a half-dozen aircraft "orbits" on each side of the country, with fighter escort to protect the reconnaissance planes and fire, if necessary, on any North Korean ships, certainly could be maintained indefinitely.
Planning is required to do this right, but it should be doable. Remember, we are presuming a scenario in which it is feared that North Korea is about to sell nuclear material to a group that might use it against the United States, so a serious U.S.-led response would be expected.
Rather, the hard part of this mission would be the need for international coordination, especially with China. For starters, it would be of paramount importance, of course, not to sink any Chinese ships trying to trade with North Korea.
Then it would be necessary to ask for China's help - and provide any American assistance that might be needed - in better securing the land border between China and North Korea. All sides would have to think through rules of engagement as well as avoid shooting at North Korean assets and hurting innocent people, if possible, but to be sure of stopping nuclear materials from getting beyond North Korean territory if necessary.
None of this is fun to think about. However, North Korea has just made it easier to talk about, diplomatically and strategically, with other key states - and we probably should avail ourselves of the opportunity.