Washington CNN  — 

President Donald Trump signaled possible progress on a fix to the Iran nuclear deal, as US and European negotiators near agreement on how to keep the US from leaving the international pact.

“We could have at least an agreement among ourselves fairly quickly,” Trump said during talks with French President Emmanuel Macron in Washington – which are aimed in part at urging Trump to stick with the 2015 agreement. “I think we’re fairly close to understanding each other. And I think our meeting, our one-on-one went very, very well.”

The comment is the first indication that Trump might be open to staying in a deal he’s excoriated, one that exchanges curbs on parts of Iran’s nuclear program for nuclear-related sanctions relief.

The US and Europe are working on a supplemental agreement that would address areas inside and outside the deal that have troubled Trump, and have reached agreement on Iran’s missile program, nuclear inspections and its regional activities, but hurdles remain.

Despite the high-level European lobbying effort – German Chancellor Angela Merkel arrives Friday and British Prime Minister Theresa May could follow – and progress by negotiators, sources within and close to the Trump administration tell CNN that the White House, subject to the whims of the ever-impulsive President, could still leave the deal.

“If Macron comes to the table with a good deal … Trump will be able to claim he fixed [President Barack] Obama’s fatally flawed agreement and check that box and move on to use other levers of national power against Iran,” said Mark Dubowitz, CEO of the Foundation for Defense of Democracies.

The deal has powerful enemies. Secretary of State-designate Mike Pompeo is a critic, and suggested during negotiations that it would be easy to simply bomb Iran. And the new national security adviser, John Bolton, has been telling Europeans the deal is “unfixable.”

Even so, parties to the deal tell CNN they are “optimistic” and “very close.” The US and European negotiators aren’t working on “fixing” the nuclear deal – Europeans and Iran refuse to re-open it for renegotiations.

But sources familiar with the talks tell CNN the two sides have agreed on several issues that would be part of a supplement to the Iran deal.

Progress on a supplement to the deal

According to a source familiar with the talks, the negotiators have agreed on measures that would use powerful US and European sanctions to target Iran’s long-range missile program and missiles of other ranges.

They have agreed on a common position that the International Atomic Energy Agency has the right to inspect all nuclear sites, including military sites, and that there will be a range of consequences for Iran if it denies access.

And the partners will take a range of measures to address Iran’s activities in the Middle East, including possible European sanctions against Hezbollah entities, sanctions targeting Iran’s activities in Syria and Iraq, and others that focus on maritime navigation and cyber. Some of these measures will be public; many will be private and involve intelligence sharing, according to a source familiar with the talks.

But areas of disagreement remain, particularly on the issue of “sunset clauses.” These sections of the deal expire after a few years, though the pact forbids Iran from gaining nuclear weapons in perpetuity. The US wants an automatic resumption of sanctions if Iran starts certain nuclear activities once those sunset clauses expire. Europe, according to the source, wants intervening assessments before sanctions snap back.

A senior State Department official, speaking to reporters Sunday about those ongoing talks, said that “we have made a great deal of progress, but it is – we’re not there yet.”

Macron will likely spend the rest of his visit working hard to bridge those gaps. If he succeeds, the supplemental agreement could exist on its own as a deterrence to Iran expanding its missile and nuclear programs, or it could represent the first phase of diplomatic negotiations to work with Iran on a “JCPOA 2.0.”

If the US and its European allies fail to reach an agreement, the administration can reapply sanctions and leave the deal quickly or can slowly start reimposing penalties. That kind of slower, “rolling snapback,” the source said, means the US wouldn’t immediately leave the deal, giving the Europeans more time to see if they can get Iran to agree to concessions.

One option the White House could pursue is to avoid reimposing nuclear sanctions and instead target Iran’s Central Bank for the country’s support of the Syrian regime. May 12 is also Trump’s next deadline to waive US sanctions against Iran’s Central Bank, a step he has to take every four months under a US law on the Joint Comprehensive Plan of Action.

With the clock ticking on Trump’s May 12 deadline, Macron has likely emphasized the benefits of Europe and US acting in solidarity. Sanctions have less force if a broader group isn’t enforcing them.

Iran lobbying hard

The Iranians are also engaged in their own high-level lobbying effort. Tehran’s foreign minister, Mohammad Javad Zarif, visited New York on Sunday, offering interviews, and held forth Monday on Twitter to offer some support to Macron.

“President Macron is correct in saying there’s no ‘Plan B’ on JCPOA,” Zarif tweeted Monday. “It’s either all or nothing. European leaders should encourage President Trump not just to stay in the nuclear deal, but more importantly to begin implementing his part of the bargain in good faith.”

Zarif said Monday night that the US hasn’t held up its obligations under the nuclear deal, leaving ordinary Iranians disappointed.

“People expected the international community to perform the way Iran has performed,” Zarif said in remarks at the Council on Foreign Relations in New York. While several international assessments have found Iran is complying with the deal, Zarif noted that under Trump, the US has yet to issue a single license allowing for US investment in Iran.

“The United States is already in violation,” he said, “and people ask, “What happened?” and that leads to resentment.”

The European countries making up the “E3” – France, Germany and the UK – will not even publicly discuss contingency plans in the event the US walks away. Doing so, officials say, simply lends credibility to the idea that there are workable alternatives to the agreement.

It’s not clear what Iran would do if the US leaves the deal.

“This is not a case in which you have an obvious answer as to how the Iranians would respond should the Trump administration pull out,” said Firas Maksad, director of the Arabia Foundation.

If Tehran remains in the pact with the Europeans, they will lose some financial benefits of the deal because there will be a higher risk for companies investing in Iran if the US pulls out. At the same time, Tehran would still be forbidden from enriching uranium.

“There’s a moral hazard for the Iranians going about business as if the Americans never left,” Maksad said.

But if Iran responds by walking away from the deal too, it “puts them on a confrontation path with the United States and the Europeans at a time when they’re pretty stretched thin in the region, and in the socioeconomic protests that continue to bubble up throughout the country,” he said.

One possibility, Maksad said, is that Iran responds with asymmetric attacks targeting US interests in the region: US troops in Iraq, special forces in Syria, diplomats and diplomatic facilities across the Middle East.

CNN’s Jeremy Diamond, Michelle Kosinksi and Kevin Liptak contributed to this report.