A deal with North Korea would be good, but that doesn’t mean any deal with North Korea would be good. We hope and are fairly confident that this was President Trump’s thinking as he called off the June 12 meeting with North Korean dictator Kim Jong Un.

[READ: Trump's letter to Kim Jong Un canceling North Korea summit]

Trump takes pride in his deal-making skills and knows that a good deal is unattainable if one is unwilling to walk away. President Obama didn’t think that way, which is why we got the Iran deal we did. Iran demanded that its military facilities not be inspected, that it be allowed to continue developing ballistic missile, and that its revolutionary guards should decide how the cash windfall from the deal should be spent.

These hardliners of course then spent tens of billions of additional dollars tightening their grip on Iran’s domestic economy and international terrorism. The deal frayed U.S. credibility with regional allies by granting Iran big concessions at nil cost.

Iran got all this because Obama was unwilling to walk away from the negotiating table. To him, a bad deal was better than no deal.

Trump wants a North Korea deal if it makes things better. He doesn’t want one if it doesn’t. And there’s plenty of reason to worry a creaky deal, cobbled together clumsily leaving loopholes, would make things worse, for it would rely on previously non-existent North Korean goodwill rather than on up-front sacrifices, strict verification, and explicit and swift penalties for duplicity.

Any deal with Kim Jong Un will come at serious cost, because it will grant legitimacy to Kim, who heads the most evil and murderous dictatorship on Earth. A few regime loyalists enjoy comfortable lives in North Korea’s capital, Pyongyang, but most live in poverty and squalor that are both material and moral. Hundreds of thousands are locked away in prison camps and treated as sub-humans who deserve the back breaking work, disease, malnutrition, and often torture that is their lot.

By right, Kim should be deposed and prosecuted for mass murder. His long-suffering subjects deserve to be liberated. But that’s not possible without causing greater evils via a mass-casualty war. So, even though shaking hands with Kim and cutting a deal is a necessary evil, it presumes his continued control of the country. It is deeply unfortunate.

So what we get from the deal has to be very substantial. There must be a serious payoff, not some gauzy and worthless sheen to a hoped-for presidential legacy, as was the case with Obama.

Ideally, Trump’s deal with North Korea, if it comes, would be for complete denuclearization, but at a minimum it must involve the verified dismantling of Pyongyang’s ballistic missile program. Those weapons are the means by which Kim could strike America. Any deal that sustains those weapons would be disastrous for long-term security both of the U.S. and of its regional allies.

Trump must also ensure that any deal is not seen to reward North Korea immediately for its development of nuclear weapons and ballistic missiles. If others, such as Iran and Cuba, believe they can win concessions and earn American thanks by completing ballistic missile programs, they will do so. The completion of one diplomatic endeavor with Pyongyang would be offset by proliferation of nuclear tipped ballistic missiles elsewhere. The U.S. must thus stringently enforce Kim's delivery on his promises. If he attempts to bend an agreement he has signed, he must meet an immediately implemented and drastic sanctions regime.

What of the security guarantees that Kim so craves as part of any deal? Officially ending the Korean War and disarming North Korea of its ballistic and nuclear weapons would be worth security guarantees. They, however, would be tied to similar North Korean pledges to abjure attacks on South Korea or U.S. interests.

Trump must also provide for the improved lot of North Korea’s civilian population. While this might partly be provided by South Korean and other international aid grants to the North’s infrastructure, it must also take the form of civilian participation in business deals arising from the nuke deal.

So Trump must to do the opposite of what his predecessor did in Iran. He must make clear, as we trust he is, that he will accept a good deal — or no deal at all.