President Trump has been saying for a long time, though somewhat less recently, that the aim of his aggression on Iran, in partnership with Israel, was to stop Iran ever having a nuclear weapon.
On the eve of the war Iranian negotiators offered the US a revised JCPOA without the sunset clauses and with IAEA monitoring. I do not know the technical details, but that certainly sounds like something which would have potentially provided a realisitc path to stop Iran acquiring a nuclear bomb, while allowing their sovereign right and right under the NPT to have a civilian nuclear progeamme.
But Trump has been talking less about this recently. He seems to have got bogged down in the question of control of the Strait of Hormuz. Today a senior US official has, apparently, conceded that a signed agreement on the nuclear question with Iran, may not be possible, and the US might have to pivot to a strategy of just monitoring and blowing up any signs of a nuclear programme being resussitated. [1]
This seems to align with a prediction I saw John Mearsheimer make either before the start of this war, or soon after it started. He criticised it, arguing that the US would not be able to defeat Iran, and would therefore not be able to get Iran to sign up to no nuclear programme, but that, a wounded, but not defeated, Iran would now have every reason to develop a nuclear bomb. This scenario now seems to be being admitted by the US administration. Assuming Iran does now decide it would be in its interests to have a bomb it is far from clear to me that a strategy of ad hoc bombing will actually be successful in preventing this. Iran has the know-how. They probably still have access to centrifuges. They may well still have access to already highly enriched uranium. A bomb can be developed in one underground facility and it only takes one ballistic missile to fire it.
There are too many techincal details here to enable me to weigh up the risks either way, but on the surface, at least, a transparent programme with IEAE monitoring sounds to me like a safer bet to prevent Iran acquiring a nuclear bomb than a reactive bombing campaign. And starting an existential war against them certainly gives them the motivation to develop a nuclear bomb.
Notes.