Donald Trump, who campaigned for president promising to bring his unique dealmaking skills to gridlocked Washington, assumed office facing a twin choice. On the one hand, he would have to decide whether, as candidate Trump had repeatedly pledged, to undo “the worst deal ever” with Iran that the Obama administration and the world’s major powers had negotiated in 2015 to block that country’s pathways to the bomb for at least 15 years. Conversely, he would also have to decide whether to do a deal with North Korea to constrain its burgeoning nuclear and missile programs—capabilities that by 2020, if left unchecked, could allow the Kim Jong Un regime to strike the U.S. homeland with a nuclear weapon mounted on an intercontinental ballistic missile (ICBM).

A few days past the 100-day mark, the Trump administration’s signals on these urgent nuclear challenges are mixed. On Iran, Secretary of State Rex Tillerson reported to Congress that the Tehran regime “is compliant” with its commitments under the Joint Comprehensive Plan of Action (JCPOA), otherwise known as the Iran deal, but President Trump accused Iran of “not living up to the spirit” of the agreement—a reference to the Islamic Republic’s destabilizing regional behavior that is beyond the scope of the nuclear accord. On North Korea, Trump has warned of “a major, major, conflict” with the country if diplomacy fails, while Tillerson has stated that Washington’s precondition for any direct negotiations with Pyongyang is precisely the outcome the United States seeks—North Korea’s denuclearization.

Yet even as an outcome rather than a precondition of negotiations a full rollback of the North Korean nuclear program to zero warheads is simply not an attainable near-term diplomatic objective. After the United States’s regime-changing military interventions in Iraq and Libya, the Kim Jong Un regime is not going to relinquish nuclear weapons viewed as essential to its survival. The Trump administration thus faces the choice of pivoting from the unobtainable objective of denuclearization to the alternative—an imperfect nuclear deal that would freeze North Korean nuclear and missile capabilities at their current level. In short, the template for preventing a North Korean nuclear breakout that could directly threaten the United States is the Iran nuclear agreement—the “worst deal ever negotiated.” That deal constrained Iran’s uranium enrichment program to ensure that a latent capability to produce bomb-grade fissile material remained latent. Tillerson, rejecting the Iran nuclear deal as a relevant precedent, has argued that the accord “represents the same failed approach of the past that brought us to the current imminent threat we face in North Korea.”

That “approach” was a twin strategy of pressure and engagement that the Obama administration pursued to bring Iran to the negotiating table and into compliance with its obligations under the Nuclear Non-Proliferation Treaty. The 2013 election of a reformist Iranian president, Hassan Rouhani, who had campaigned on a platform of resolving the nuclear issue to win the lifting of economic sanctions, inaugurated an intensive diplomatic effort culminating in the landmark JCPOA agreement of July 2015.

The Iran nuclear accord was a deal, not a grand bargain. As a deal, the agreement blocking Iran’s access to weapons-grade enriched uranium was transactional, not transformational. U.S. hardliners remain critical of the agreement because of this—that is, the JCPOA does not affect Iran’s destabilizing regional role and its human rights abuses. This persisting divide in the U.S. debate—whether transactional diplomacy that is not transformational should be advanced or rejected—explains how Iran can be simultaneously “compliant” with the JCPOA and not living up to the “spirit” of the accord. The same divide will shape the possibilities for nuclear diplomacy with North Korea.

The North Korean nuclear challenge is a slow-motion Cuban Missile Crisis—one that is playing out not over 13 days, as in October 1962, but over the next few years. North Korea, which tested its first nuclear weapon in 2006, is now on the verge of a strategic breakout—quantitatively (by ramping up its warhead numbers) and qualitatively (through mastery of warhead miniaturization and long-range ballistic missiles)—that directly threatens the U.S. homeland. Unclassified projections of North Korea’s nuclear arsenal by 2020 range as high as 100 warheads, which is, incredibly, approaching half the size of Britain’s.

Tillerson has declared that the Obama policy of “strategic patience” is over, but what follows remains unclear. The military option that Trump administration officials repeatedly affirm is “on the table” runs the catastrophic risk of escalating into a general war on the Korean peninsula. General Gary Luck, the former commander of U.S. forces in Korea, estimated that such a conflict would result in 1 million casualties and entail economic costs of $1 trillion. If neither using force to eliminate the threat nor acquiescing to a North Korean nuclear breakout is palatable, the remaining “option on the table” is diplomacy.

No domestic political change in North Korea comparable to the election of a reformist president in Iran is in the offing. Nonetheless, Trump, like Obama with Iran, is similarly positioned to take advantage of changes that may make the nuclear problem he faces more amenable to negotiation. Namely, the factor that may permit diplomacy to succeed now when it has failed in the past, is China, which can no longer be a cost-free “enabler” of North Korea through its lackadaisical enforcement of sanctions. A North Korean nuclear breakout would be a game changer not only for Washington, but also for Beijing. China’s calculus of decision must now take into account the adverse strategic consequences of the North’s emergence as a major nuclear power, conceivably including South Korea and Japan reassessing their non-nuclear status. Moreover, as the  former State Department official Edward Fishman observes, the sanctions “the United States has imposed on North Korea are nowhere near as harsh as those on Iran before the 2015 nuclear deal.” That creates ample scope for the international community, including China, to exert meaningful pressure on North Korea to accept a freeze of its capabilities.

The political space may now exist for a pivot to serious diplomacy through coercive engagement to prevent a breakout. With North Korea already possessing a nuclear arsenal estimated at a dozen weapons, the Trump administration has no good option. Transactional diplomacy to cap, not fully roll back, the program is the least bad. A freeze would block North Korea from ramping up its arsenal size to 100 weapons by 2020 and preclude the additional testing that the North still needs to master the miniaturization of nuclear warheads and reliable long-range missiles. Tillerson has already taken an essential step for transactional diplomacy by telling the UN Security Council that “we are not seeking regime change.”

A freeze would also meet the core interests of all the major parties. For North Korea, it would leave the Kim family regime in power with a minimum deterrent. For China, a freeze would preserve a strategic buffer state while averting the adverse consequences of a North Korean nuclear breakout. For the United States, such a deal would be characterized as an interim step toward the long-term goal of denuclearizing the Korean peninsula—though in reality, that may never come to pass while the Kim family retains power.

As with the Iran nuclear deal, such an agreement with North Korea would be transactional, not transformational. U.S. hardliners would likely castigate any agreement that leaves the odious Kim regime in power with a capped nuclear arsenal as tantamount to appeasement. Indeed, the Iran deal shows that even an agreement that could stop a regime before it has nuclear weapons at all is an imperfect solution with many detractors because it does not address what they view as the source of threat—the character of the regime. The open question is whether Trump would take such an imperfect nuclear deal. If not, the administration is left with the bad alternatives of bombing or acquiescing.