WHEN Barack Obama welcomed the nuclear deal with Iran, declaring that it would cut off “every pathway” the Islamic republic could take to gaining a nuclear weapon, he remarked: “You don’t make deals like this with your friends.”

Arms-control agreements, such as those reached with the Soviet Union during the cold war, do not necessarily end mutual suspicion or hostility. Precisely because the signatories do not trust each other, they depend on verification that is rigorous enough to make cheating unattractive. Negotiating such deals is difficult and technically complex. The test of their worth is whether they make the world any safer.

In Iran’s case, that judgment rests on three questions. Does it make Iran less likely to try to produce a nuclear weapon in the lifetime of the accord? Is it robust enough to make cheating foolhardy both in terms of the likelihood and the consequences of being caught? Is there a reasonable chance that it will produce a lasting solution to the Iranian nuclear problem? The short answers are yes, probably and possibly.

The clumsily named Joint Comprehensive Plan of Action (JCPOA) adheres closely to a framework agreed on in Lausanne last April, while resolving a number of tricky issues, any one of which could have scuppered the enterprise. It seeks to stretch from about two months to at least a year the “breakout” time that Iran would need, should it choose to abandon all caution, to produce enough fissile material for a single nuclear weapon.

The deal reduces Iran’s capacity to enrich uranium by two-thirds, from nearly 20,000 centrifuges (about half of which were operating) to just over 6,000 at its Natanz facility for ten years. It will cut its stockpile of low- and medium-enriched uranium (from which the weapons-grade stuff is spun) by 96%, to no more than 300kg, by diluting it or selling it abroad for 15 years.

Fordow, an enrichment facility built under a mountain that seemed invulnerable to conventional munitions, will be converted into a physics research laboratory open to international collaboration. The core of a heavy-water reactor at Arak will be removed and redesigned so as not to produce weapons-grade plutonium. All of its spent fuel will be shipped out for the life of the reactor. No new heavy-water reactor will be built for 15 years.

Several stumbling blocks have been overcome, on such matters as: the access required by inspectors of the International Atomic Energy Agency (IAEA) to confirm that Iran is keeping its promises; the need for Iran to give a full account of any “possible military dimensions” of its nuclear programme; the penalties for violating the agreement, including a mechanism for the reimposition of sanctions; whether the arms embargo would be lifted along with economic sanctions; and how much research and development on advanced centrifuges Iran would be allowed to conduct during the first ten years of the agreement.

The talks have hammered out solutions that largely meet the concerns of Western negotiators. That reflects the stamina and skill of the negotiators (and the spine-stiffening role played by European allies). Iran appears to have withdrawn its objections to the IAEA investigating previous research related to weaponisation, which should allow the agency to complete its report by December 15th. Iran will not publicly own up to its past misdeeds. But establishing a baseline of what took place where and when will help the agency monitor Iran’s future behaviour.

Iran will now reluctantly allow the IAEA’s monitors to visit any sites they deem suspicious, including military facilities. That is a key provision of the Additional Protocol (AP) of the nuclear Non-Proliferation Treaty. Iran will implement the AP on a voluntary basis before legislating to ratify it in eight years’ time, when the IAEA hopes to conclude that Iran’s programme is wholly peaceful.

Inspectors will not be able to conduct the “anywhere, any time” visits that critics of the deal have demanded. But access to suspicious sites can be made mandatory by a joint commission consisting of representatives of all the parties to the deal (Iran, the five permanent members of the UN Security Council, Germany and the EU), which will have a built-in Western majority of five to three. Inspectors must provide grounds for their concerns about prohibited activities and give Iran an opportunity to deal with them. But refusal to grant access will be deemed a violation.

Although the process is convoluted, it still smashes through one of the red lines set out by Iran’s supreme leader, Ayatollah Ali Khamenei. His face may be partly saved by the requirement that the monitors all come from countries with which Iran has diplomatic relations—in other words, no American “spies”.

Sanctions will only start to be lifted as Iran makes good on its commitments. And there is a “snapback” mechanism to reimpose sanctions automatically in case of violations. If there are allegations that Iran is cheating, the joint commission will seek to resolve the dispute for 30 days. If that effort fails, it will be referred to the UN Security Council, which will have to vote to continue sanctions relief. A veto by a permanent member will therefore mean that sanctions are reimposed. The whole process will take 65 days.

Tooling up

The embargo on sales of conventional offensive weapons to Iran will remain in force for a further five years, while the ban on any technologies relating to ballistic missiles will stay in place for eight years. That means that the Russians, for example, will be able to go ahead with the sale of the S-300 air-defence system, but presumably not of strike aircraft or tanks.

Iran will be able to begin deploying advanced enrichment centrifuges after the first ten years of an agreement, but for 15 years it will have to keep its stockpile of low-enriched uranium below 300kg. After that, Iran will be able to develop the industrial-scale enrichment it seeks. Its breakout time to a bomb will in theory be much shorter. But its obligations under the AP are permanent, ensuring that an expanded nuclear programme will be more transparent than in the past.

None of this will satisfy the critics, who include Republicans (plus some Democrats) in Congress, and Binyamin Netanyahu’s government in Israel (who called it a “bad mistake of historical proportions”). Their minds were made up long ago that anything short of the complete dismantling of Iran’s nuclear infrastructure would be an abomination.

Privately, senior Israeli military and intelligence officials take a more nuanced view than the prime minister: they reckon that, if only for tactical reasons, the Iranian regime has accepted a hiatus in its nuclear ambitions of at least ten years; if implemented properly, the agreement can ensure this breathing-space. The consensus is that Israel’s top security priority is now the volatile situation with the Palestinians and the threat from Hizbullah, Iran’s proxy militia-cum-party in Lebanon.

For now, the agreement’s survival depends on American politics. Some of the fiercest reaction has come from Republicans hoping to succeed Mr Obama as president. Governor Scott Walker of Wisconsin vowed to “terminate” the deal on his first day in the Oval Office, put in place “crippling” sanctions on Iran and convince allies to do the same. Jeb Bush, another front-runner, said the deal was not the product of diplomacy but of “appeasement”. The next president could certainly derail the deal. But the immediate threat comes from Congress. Mr Obama expects Republicans to oppose him and has promised to veto any bill that seeks to undo his diplomacy. But he must worry about Democrats who might side with Republicans, giving opponents the two-thirds super-majority that they would need to override his veto. In the Senate 13 Democratic defections could kill the Iran deal. Mr Obama received an early boost when Hillary Clinton, the Democratic presidential front-runner, declared the deal to be an “important step in putting the lid on Iran’s nuclear programme”; she has in the past sounded more hawkish. Some Democrats have expressed unhappiness about concessions granted to Iran, notably over the relaxing of arms embargoes and the inspection of military sites. One sceptic, Senator Robert Menendez of New Jersey, called on Mr Obama to declare categorically that if Iran seeks a nuclear weapon America would take “any actions necessary” to stop it. At a press conference on July 15th, Mr Obama urged Congress to evaluate his Iran deal based on facts, not politics, and challenged members to offer a better alternative. On this Mr Obama has a point. Even if the sanctions regime could have been maintained—a big if—the idea that it would bring Iran to the point of accepting national humiliation was always implausible. Sanctions may have brought Iran to the table, but more pressure is unlikely to induce it to give up its programme. In any case, it is far from certain that more pressure can easily be applied. Were America to tear up the accord, European allies would be unlikely to reimpose sanctions.

Unintended consequences

Some worry that the deal will destabilise the region and encourage nuclear proliferation. Yet it is hard to see why any of Iran’s regional rivals should feel more threatened than they do now. Israel has overwhelming nuclear and conventional military superiority. Saudi Arabia may try to build an enrichment programme as big as Iran’s constrained one. But it does not want to become a pariah state by coming close to developing a nuclear weapon. If it wants a deterrent against Iran, all it needs is to call in past favours and park a few nuclear-capable Pakistani F-16s at an airbase. Nobody need know whether they are armed or not.