During the 2016 presidential campaign, Donald Trump described the Joint Comprehensive Plan of Action (JCPOA), otherwise known as the Iran nuclear deal, as “the stupidest deal of all time” and vowed that if he became president he would “rip it up.”

Now, as president, Trump’s posturing suggests he’s ready to do just that.

The deal was the most controversial of the Barack Obama administration’s foreign policies. It was widely criticized for lifting the economic sanctions against Iran without eliminating the long-term threat of Iranian nuclear weapons or its ongoing missile development program, nor curbing that country’s aggressive and destabilizing policies in the Middle East.

In turn, the Obama administration insisted that, “the agreement will block all of Iran’s pathways to a nuclear weapon,” and that it would put off for another 15 years its ability to field atomic weaponry.

Did the deal make sense? That depends on your perspective and what assumptions you make about the state of Iran’s nuclear program.

The agreement does block Iran from developing the components it would need to construct a nuclear bomb. It no longer has access to plutonium from its Arak facility and is prevented from enriching uranium to a weapons-grade level.

Iran can restart some aspects of its nuclear program after eight years, but the prohibition on producing plutonium or weapons-grade uranium effectively prevents it from developing an atomic device for the next 15 years.

But while its footprint has been dramatically reduced, Iran was able to keep its basic nuclear infrastructure under the guise of maintaining a research program and manufacturing radioactive isotopes.

This dual use structure means Iran would find it at easier to scale up a nuclear weapons development program than if it had completely dismantled its program.

And although a reduction of centrifuges from 20,000 to 6,000 is significant, that still leaves Iran with more centrifuges than either Pakistan or North Korea had when they developed their nuclear weapons.

While the smaller number of centrifuges would slow down production of a sufficient quantity of weapons-grade uranium, it still gives Iran the ability to do so should it break the agreement.

The presumption underlying the agreement is that in 10 to 15 years, when the deal must be revisited, Iran will be easier to work with. That may well be true but there’s no assurance and the evidence doesn’t suggest it’s likely.

Lifting economic sanctions means Iran can ratchet up its oil exports, get access to the western financial system and get control of US$100 billion to $150 billion in funds and assets that were frozen.

Moreover, by normalizing its relations with the West, especially with the European Union, it gained access to non-military technology. These developments make Iran much stronger and enhance its ability to project power in the Middle East. It also allows it to strengthen its various proxies, like Hezbollah.

The agreement didn’t eliminate the prospect that Iran will develop nuclear weapons, it simply deferred it. It did what politicians are prone to do with a pressing problem: push it far enough ahead to make it someone else’s problem.

Whether the tradeoff made sense depends on how close you think Iran was to developing nuclear weapons. The Obama administration insisted Tehran was on the verge of developing such weapons. This seems unlikely. If it was still years away from having a functional nuclear weapon, then the U.S. traded the sanctions for a capability Iran wouldn’t have had any time soon.

That doesn’t mean it wouldn’t have had that capacity eventually or that deferring it might not have been prudent. It does mean, however, that there was no rush to complete an agreement and that further negotiations might have resulted in a more favourable outcome.

The rush to get an agreement done, ostensibly because Tehran was on the verge of having a nuclear weapon, was likely driven more by the desire of the Obama administration to add a successful agreement to its foreign policy legacy than any danger. It was more about a president’s vanity than it was about Mideast security.

Critics argue that Iran has already violated the agreement, and that the U.S. should pull out and immediately reinstate sanctions. Four major issues have been cited:

Iran is operating more advanced uranium-enrichment centrifuges than is permitted and has announced that it has the capability to mass produce centrifuges.

It has exceeded limits on the production and storage of the heavy water being used to produce radioactive isotopes.

It has covertly procured nuclear and missile technology outside the framework specified in the deal.

It has refused to allow International Atomic Energy Agency (IAEA) inspectors access to nuclear search and military facilities.

Let’s deal with each of these charges in turn.

According to the IAEA, there’s no evidence Iran is operating more advanced uranium-enrichment centrifuges than is permitted under the deal.

In April, Ali Akbar Salehi, the head of Iran’s Atomic Energy Organization, announced that the country is prepared to mass-produce advanced IR-8 centrifuges on “short notice.”

Declaring you’re prepared to mass-produce advanced centrifuges, however, is not a violation of the deal unless you produce them.

Iran did violate the quota on the maximum amount of heavy water it could retain. It claimed this was an error that has since been rectified. While technically a violation, it has little practical consequence unless you have the means to convert that heavy water into weapons-grade plutonium.

The deal specifies Nuclear Suppliers Group “trigger list” items. This list also includes dual-use items – ones with both military and civilian uses. According to the IAEA, Iran has not obtained any trigger list items outside the framework specified by the deal.

What constitutes a dual-use item is subject to interpretation. Just because an item isn’t listed on the trigger list doesn’t mean Iran can’t find a military application for it in its missile development program. It’s likely that Iran is exploiting loopholes in the trigger list to import technology that has applications to its missile development program and that is not expressly prohibited under the deal.

The final issue is that of inspections. While the deal doesn’t mention military facilities specifically, it does specify that IAEA inspectors can visit “any suspicious sites” that they have reason to believe are engaging in illicit activity.

Iranian officials have declared on several occasions that they won’t grant access to military facilities. The IAEA, however, has not asked for such access. If it does and is denied, that would constitute a breach of the deal.

Would the U.S. be better off to withdraw from the agreement?

It is hard to see how. First, there’s little support among America’s allies to cancel the agreement and restore sanctions barring clear evidence of Iranian violations. So any U.S. actions wouldn’t be matched by its allies.

The U.S. doesn’t need to pull out of the agreement to impose new economic sanctions on Iran. It can do so in response to Iran’s continued missile development program, its human rights abuses, or its aggressive and destabilizing foreign policy in the Middle East.

It’s hard to see how such actions will prove effective, however. The U.S. has been sanctioning Iran for the better part of 40 years – ever since the takeover of the American embassy in Tehran in 1979. It’s unlikely that U.S. sanctions alone will have much impact on Iran’s behaviour. There’s little in the way of economic or trade activity between Iran and the U.S.

The U.S. can expand its sanctions to include foreign companies that trade with Iran. Such sanctions would prove more onerous but it would also create conflicts with America’s EU allies and further isolate the U.S. on the issue.

Possible military responses are limited. A ground invasion of Iran to force a regime change is not viable. That would be extremely difficult and completely upend the Middle East. Nor is there any political support for such an action.

Many of the facilities are deep underground and heavily reinforced. Bunker-buster bombs might succeed in damaging or destroying a facility, but there’s no assurance that would be enough to prevent Iran’s development of a nuclear weapon.

For now, diplomacy, as limited as its effectiveness might be, remains the best option.

If the deal was flawed, that’s ultimately the fault of the Obama administration. But flawed or not, it has been made. Sanctions have been lifted, Iranian frozen assets have been released and Iran has been granted access to western markets and the international financial system.

Pulling out of the agreement won’t reverse any of this. In fact, it could present the U.S. with the worst possible outcome: a lifting of sanctions and the ability of Iran to return to its nuclear development program should it choose.

For now, American interests are best served by continuing to participate in the deal while vigorously enforcing its provisions and continuing to look for and document any evidence of Iranian violations.

That doesn’t mean that the U.S. should not address the continuation of Iran’s missile development program, its funding and arming of subversive organizations in the Middle East, or its aggressive foreign policy.

Rather, it means that pulling out of the agreement won’t resolve any of these issues. Addressing these issues will require a different framework and agreement.