Regarding nuclear weapons, the US message to Iran has been “do as we say, not as we do.” We tell Iran that they cannot have nuclear weapons, but we do so in the context of relying upon these weapons for our own security and being silent about Israel’s nuclear arsenal. This is clearly an irksome double standard for Iran, one that would be far easier to tolerate if the US showed it was serious about eliminating its own nuclear arsenal and pressuring the other nuclear weapons states, including Israel, to do the same.
Further, Iran was one of three countries, along with Iraq and North Korea, named by George W. Bush as belonging to an Axis of Evil. We invaded Iraq, which had no nuclear weapons, and negotiated with North Korea, which does have them. Our behavior, on its face, would seem to be an incentive to countries not on friendly terms with the US to develop nuclear arms and justify their actions in the name of national security.
US saber rattling must give pause to Iran and, for that reason, Iran will likely stop short of actually creating nuclear weapons. On the other hand, it seems that Iran is motivated to continue to push the envelope. Its leaders most likely believe that the strategic costs to the US of attacking Iran would be too great for the US to actually initiate an attack, particularly since it is still engaged in wars in Iraq and Afghanistan.
The bigger danger to Iran is an Israeli attack on its nuclear facilities, but it is doubtful that Israel would act without approval by the US. A preventive Israeli attack on Iran would be far more complicated and far less likely to succeed than its 1981 attack on Iraq’s Osirak reactor. An attack by Israel could result in a more general war in the Middle East, which would be disastrous for the region and would almost certainly lead to restricting Middle East oil exports with consequent global economic chaos.