A nuclear deal with Iran may be concluded before the deadline of June 30th. But the deal could undermine stability in the region, not promote it, unless the US and Europe are willing to contain Iran and reassure its neighbours.

Western and Iranian negotiators say an agreement on Iran’s nuclear programme is within reach. A deal that puts a brake on Iran’s nuclear programme would be a momentous achievement, but only if it can be verified and enforced. It may not be. The prospect that an agreement could bring Iran in from the cold – after lifting international sanctions and restoring trade and diplomatic relations – yet still leave room for it to cheat, is making Tehran’s neighbours nervous. Without Western willingness to contain Iranian influence, a deal will make the region more volatile.

There are two reasons why a comprehensive deal might fall short. The negotiators on both sides still have hard work to do. On April 2nd, the United States, France, the UK, Germany, China and Russia (otherwise known as the EU3+3), and Iran announced that an accord had been reached on the political contours of a final, comprehensive deal. This political framework, however, has many loose ends. Iran says an agreement will expire after 10 years, but the US says some restrictions on its nuclear programme should apply for up to 25 years. Iran says research and development on advanced uranium centrifuges can continue under a deal. The US disagrees. Iran does not want to give inspectors access to military sites. The US, and the International Atomic Energy Agency (IAEA), the UN’s nuclear watchdog, insist it should. They also say that Tehran must be more transparent about the possible military dimensions of its nuclear programme. If these issues are not resolved, a deal would either have little value or collapse.

Another reason for pessimism is that the deal may be skewed in Iran’s favour. The political framework agreed on April 2nd says Iran will freeze – not dismantle – its enrichment capability and reduce – not remove – its uranium stockpile. In return the UN, US and Europe will cancel most sanctions (except some proliferation-related sanctions and those linked to its missile programme and sponsorship of terrorism).

The problem is that those sanctions worked; they brought Iran to the negotiating table. But once sanctions are lifted US and European leverage will vanish. Any Iranian violation of the agreement will be difficult to detect, and even more difficult to respond to through a concerted international effort. US officials are overconfident when they suggest that it will be possible to create a reliable system to ensure that sanctions could reactivate, or ‘snap back’, automatically. The negotiators will have trouble devising a procedure that is immune to a Chinese or Russian veto in the United Nations Security Council – a necessary condition to put the sanctions back in place. The Security Council is more divided than five years ago as relations between Russia and the West have soured. The Russian ambassador to the UN, Vitaly Churkin, said on May 13th that there could be "no automaticity, none whatsoever" about re-imposing sanctions. In short, the West will have to compromise at the UN to get a deal.

The West could still re-impose its own sanctions, but once a nuclear deal has been reached, it may also be difficult to maintain transatlantic unity. Iran has the fourth-largest oil reserves and the second-largest reserves of natural gas in the world. It is actively promoting a bright economic future – fuelled by its ample hydrocarbon reserves – that European firms can be a part of. And a future pipeline connecting Iran’s gas fields to Turkey’s trans-Anatolian pipeline would contribute to the EU’s energy security. As more European firms enter the Iranian market, and in the absence of blatant Iranian violations of the nuclear agreement, European governments might favour protecting their commercial and energy interests over a unified transatlantic response to an ambiguous violation of the deal.

Ultimately, however, the US and Europe hope that their concessions during the negotiations will encourage Tehran to help stabilise the Middle East. The EU’s foreign policy chief, Federica Mogherini, said on April 28th that she was convinced a deal could “open the way to a different role of Iran in the region”. The West hopes a nuclear deal turns Iran into a helpful partner – but hope is not a strategy.

The US and Europe are right that Iran is needed to fight the Islamic State terror group, reach a solution in Yemen, and bring Syria’s civil war to an end. But it is risky to assume that Iran will suddenly change its colours after a nuclear agreement and become more helpful on all regional security issues. Why would it? Despite years of tough sanctions and economic stagnation, Iran is now a rising power in the Middle East. Its population is young, well-educated and large; second only to Egypt in the region. It has a strong sense of national identity and culture; huge hydrocarbon reserves, and a regional network of allies and militant groups, such as Hezbollah. Iran’s influence in the region has increased since the fall of Saddam Hussein. With a hand in Lebanon, Syria, Iraq, and Yemen, its reach stretches from the Eastern Mediterranean to the southern entrance of the Red Sea and the Straits of Hormuz. Riyadh, highly insecure and deeply suspicious of Iranian intent, feels encircled. Even in the Persian Gulf, a vital international waterway, Iran is flexing its muscles: on April 28th the Iranian navy forced a Danish container ship to divert its course and two weeks later it fired warning shots at a Singaporean cargo ship. The Sunni Arab world and Israel are rightly concerned about Iran unshackled from its sanctions; it will make Iranian assertiveness in the region more likely.

Viewed from the region, the nuclear deal is another sign of US withdrawal from the Middle East. Just as in Syria, where the West pushed to rid Syria of chemical weapons but did little to end the civil war, Sunni Arab states – including Saudi Arabia, the UAE and Kuwait – think that the West is negotiating with Iran about weapons, while doing little to challenge Tehran’s ambitions. Over the past two years, countries around the world have sought assurances from Washington. In areas of intensive geopolitical competition from East Asia to Eastern Europe, countries like Japan and Poland have asked questions about US commitment to their security, and received some reassuring answers from the US. Now it should be the turn of America's allies in the Middle East. At a Camp David summit on May 14th, President Obama made his case for an Iran nuclear deal to several Gulf leaders. The success of his efforts remains uncertain.

Paradoxically, an agreement that was meant to avoid another war in the Middle East may add to the region’s turbulence, unless a balance of power can be maintained. The Gulf countries and Israel primarily look to the United States to deter Iran. Washington will most likely give them some security assurances and sell them more sophisticated military equipment. But Europe has a role to play too.

European countries should help make sure Iran keeps its end of a nuclear deal by taking a tough line on sanctions; providing enough resources to spy on Iranian nuclear facilities, and improving the ability of Gulf countries to stand up to Iran. The EU should insist on gradually phasing out the sanctions, not removing them instantaneously. Measures such as those that blocked Iranian shipping companies from accessing the European reinsurance market and underwriters have been central to the sanctions’ overall success. The EU should only remove these measures if Iran meets clear commitments; for instance on reducing its uranium stockpile or disabling its enrichment cycle. Importantly, if needed, the EU should be willing to reactivate the sanctions unilaterally (or with the US), even without a UN resolution.

Paris, London and Berlin will actively promote their defence exports, seeking to persuade countries in the Middle East that stronger forces are necessary to keep Iran at bay. In May, France announced the sale of fighter jets to Qatar, and negotiations on a similar military package continue with the UAE. Germany has sold four advanced submarines to Israel. Saudi Arabia is the UK’s largest defence technology export market. But alongside selling more kit, Europe should help improve the ability of Arab militaries to counter threats from Iran by improving their professionalism and skills.

The UK, in co-operation with allies, should continue to use its intelligence capacities to monitor Iran’s nuclear supply chain. This would help to verify Iranian nuclear commitments. If the West is to keep Iran honest, Tehran has to know that its activities will be very closely scrutinised. The UK and other European governments should also direct more intelligence resources to disrupt Hezbollah’s military wing; that organisation has been on the EU’s list of terrorist organisations since 2013.

France, more than any other European country, has stood up for Arab interests during the Iran talks. It has also gained Arab credit for showing its resolve against Islamist terrorists in places like the Sahel. On May 5th, President Francois Hollande became the first foreign head of state to attend the summit of the Gulf Co-operation Council (GCC), a political and economic forum for Arab Gulf countries. Paris should use that diplomatic credit to persuade Arab Gulf countries not to over-react to a nuclear deal, and to make clear that they should end support for Sunni militant and terrorist groups: the prospects for stability in the Middle East will not be helped by continuing sectarian violence.

The EU’s high representative, Federica Mogherini, has an important role to play too. She chaired the nuclear talks and her shuttle diplomacy was essential to agreeing the political framework in April. But her triumph will only last as long as an agreement holds. Her diplomatic access with the Iranians should allow her to push Tehran to stick to a deal. But perhaps her biggest challenge is that she should convince Iran to play a constructive role in places like Syria, Iraq and Yemen.

An ugly consequence of a nuclear deal is that it may encourage Arab countries to seek the same nuclear technology that Iran has. A nuclear agreement will most probably legitimise Tehran’s right to uranium enrichment, so Saudi Arabia has said it wants a nuclear fuel cycle too. This poses a serious problem to the West: an agreement meant to avoid the spread of nuclear technologies, may do just that. Riyadh could get the technology from Pakistan, which is widely believed to have developed nuclear weapons with Saudi financial assistance, and has a poor record on nuclear non-proliferation. But Laurent Fabius, the French foreign minister, also discussed nuclear power projects when he visited Riyadh in April. So the West faces a choice: it could decline Saudi requests and push Riyadh towards Islamabad, or it could help Saudi Arabia develop civilian nuclear technology and keep an eye on its nuclear programme. The latter option is preferable.

A nuclear deal may still collapse. But if a deal is reached, Europe should engage with Iran, but be willing to contain it too.

Rem Korteweg is a senior research fellow at the Centre for European Reform.