FOUR MONTHS AGO, the Obama administration radiated optimism that a deal could be struck curbing the most dangerous parts of Iran’s nuclear program. What’s followed has been a dismal summer. Not only has Iran not agreed to stop its production of higher-enriched uranium, but it has increased its stockpile by 30 percent since May, according to a new report by international inspectors. Not only has it rejected proposals from the United States and five partners that it close an underground production facility near the city of Qom, but it has doubled the number of centrifuges installed there.

Rather than negotiate with the international coalition — the last formal talks were in June — Tehran this week is hosting a meeting of the Non-Aligned Movement at which it is defiantly reasserting its right to uranium enrichment, despite multiple U.N. Security Council resolutions ordering it to stop. Meanwhile, terrorist attacks by the Iranian Revolutionary Guard and Lebanon’s Hezbollah have targeted Israeli diplomats and tourists in half a dozen countries.

What’s particularly striking about Iran’s behavior is that the nation’s leaders seem to ignore the possibility that it will provoke Israel into launching a military strike on the nuclear facilities in the coming weeks. Perhaps supreme leader Ali Khamenei doesn’t take the Israeli threat seriously, though clearly he should; perhaps he might welcome such an attack as a way to rally domestic and international support, bust out of tightening economic sanctions and justify a unqualified race for a bomb.

Whatever the case, Iran’s behavior has pushed the Obama administration into an awkward position. Most U.S. diplomacy now appears to be directed at persuading Israel to hold off on a strike at least until next year, though that could mean allowing Iran’s nuclear capabilities to advance to the point where only U.S. military action would be effective. Last week, the White House, anticipating the new report by inspectors from the International Atomic Energy Agency, insisted there was still “time and space” for diplomacy.

That’s probably correct. Despite its advances, Iran still is at least a year or two away from a bomb. It is making only slow progress, at best, on constructing the more advanced centrifuges and missiles it would need to complete an arsenal. Israel and the United States agree that the supreme leader has not yet made a decision to pursue a bomb, and U.S. officials say any such “breakout” move would probably be detected. Meanwhile, the regime is likely to grow steadily weaker, especially if its closest ally, the Syrian dictatorship of Bashar al-Assad, is overthrown.

Tehran’s refusal to negotiate seriously and its continuing buildup of nuclear capacity is nevertheless steadily increasing the danger that the Middle East will be engulfed by a new war — one that could interrupt oil supplies, damage the global economy and exacerbate the sectarian conflict already underway in Syria, Iraq and Lebanon. An optimistic view would be that Iran is playing a familiar game of brinkmanship. If so, there may not be much more time to step back.