Philip Bobbitt of Columbia Law School has a suggestion for the North Korean situation. He published it on Lawfare:
There is, however, an available strategy that has not been considered and may promise success: a nuclear guarantee for the North Korean regime from China. If China were to give a credible nuclear guarantee to North Korea in the case of a U.S. invasion or preemptive strike against Pyongyang, there would be little point in North Korea risking the survival of its regime by developing long-range nuclear weapons. Such a policy should not be confused with the current mutual defense pact between North Korea and China, one cornerstone of which is China’s no-first-use policy. From Kim’s point of view, there is much security to be gained by such a guarantee of deterrence against the U.S. and much security to be lost if North Korea continues its present course when further technological revolutions in the U.S. render the North Korean arsenal ever more vulnerable. Our aim must be to reorient Kim Jong Un’s paranoia, making him more afraid of losing a unique opportunity for security in the eyes of his own people than he is afraid of dependence on China.
I am somewhat dubious that Kim would follow such an option. While it certainly has some positives, it also results in him being disarmed. And from history we know that Communist states do tend to be aggressive towards their neighbors, so what Kim would be doing is casting his lot with a state with an ideology that has a history of gobbling up weaker neighbors: China. China may be today’s sort-of ally, but it could easily become tomorrow’s invading force. Especially with the United States led by a vacillating idiot who has no idea how to operate in the Far East.
There are costs to having nuclear weapons, costs that exist in the diplomatic and technical sectors, and if they are large enough I could see Kim considering such a move. But the fact that they’ve clawed their way this far up the cliff of nuclear weaponry, well, you’d have to wonder if Kim would really want to give up all these gains and make himself more vulnerable to the huge country directly on their northern border.