The moment of truth for U.S.-Iranian relations—and for President Obama’s foreign policy legacy— is nearly upon us. With a June 30 deadline looming for the nuclear talks, we’ll learn soon enough whether Obama’s poker skills are good enough to keep the two countries off the path to war.

Last week’s news was hardly reassuring: The International Atomic Energy Agency (IAEA) reports that Iran may have recently increased its nuclear stockpiles by as much as 20 percent since the 2013 Interim Agreement on Iran’s nuclear program. Whether that’s a late bargaining chip, a show of bad faith (though not a technical violation of the agreement) or both, it complicates the final deal.

Israeli Prime Minister Benjamin Netanyahu and his neocon friends in the U.S. insist that talk of inevitable war if there’s no agreement is just an Obama scare tactic. And they insist that there’s evidence of nuclear materials at an Iranian military base in Parchin. That’s a further deal breaker for them and at least another complication for the U.S. negotiating team.

But after eight years in which President Bush largely neglected Iran’s rapidly-growing nuclear program, these neocons (who chose to attack Iraq rather than confront Iran) still aren’t on strong logical ground when arguing that no deal is the best option now.

Obama and Secretary of State John Kerry are appeasers, they say. If the talks fail, no sweat. We’ll just apply tougher sanctions until the Iranians come crawling back to the table. This is currently the position of close to 100 percent of Republicans in Congress.

If only it were so simple. In the real world that these muddle-headed hard-liners apparently don’t inhabit, the multilateral sanctions that Obama so painstakingly built during his first term are crumbling. Russia is already selling a sophisticated missile defense system to Teheran and European corporations are itching to trade again with Iran. Congress could impose the harshest sanctions imaginable and Iran would easily circumvent them.

Of course this reduced leverage doesn’t mean that the U.S. should give in on the critical fine print of the deal. As in any negotiation, one or both parties may walk away from the talks (or threaten to) at the 11th hour. The big ones always require some brinksmanship at the end.

At Camp David in 1978, President Carter was sure the talks had failed only hours before the breakthrough. At Dayton in 1995, the late Richard Holbrooke, the lead negotiator, had to conspicuously place the luggage of the U.S. delegation at the curb, signaling that the Americans were leaving, before the warring parties in the former Yugoslavia came back for one final fruitful session.

Going back to his days in the Illinois State Senate, Obama has been a poker player, though he doesn’t always play his hand well with Congress. Now he has to hold and fold with great finesse. If the president is too anxious for a deal and doesn’t double-rivet the details on inspections and snap-back sanctions, a cheating Iran—bent on a nuclear bomb—will overshadow his domestic accomplishments and render him a naïf on foreign policy.

If, on the other hand, there’s no deal, Iran will be only months away from a nuclear breakout status that would present the world with a fait accompli. Either path could easily lead to war.

Obama’s strategy—sound in theory—has been to play for time and transparency with the hope that Iran’s supreme leader, the Ayatollah Ali Khamenei, ill with cancer, will have passed from the scene when this deal expires in a decade. But the strategy depends on a genuinely intrusive inspections regime to give the world confidence that Iran is living up to the terms of the agreement.

As Iran sponsors terrorism in countries across the Middle East and imprisons innocents (including a Washington Post reporter) on trumped-up charges, who isn’t tempted to stalk off? But that’s when it’s important to remember that diplomacy is most significant when conducted with enemies, not friends. Recall the deals Ronald Reagan struck with what he called “the evil empire.”

Of course Khamenei isn’t exactly Mikhail Gorbachev. He gave a graduation speech last week reiterating that Iran would allow no inspections of military bases or “interrogation” of nuclear scientists. These aren’t deal breakers, but they underline how much work remains in the next month.

Since March, I’ve been worried about the creation of a commission to approve inspections. It seemed to be a recipe for endless litigation of where and when International Atomic Energy Agency (IAEA) inspectors could do their jobs. But a majority-rule provision means that even if Iran, Russia, and China object to an inspection, Western nations can insist on it. “If we want access, we get it,” one senior White House official told me.

But isn’t the exclusion of military bases a huge loophole that Iran could drive a truck of fissile material through? Not really.

First, “anytime, anywhere” access to military bases would be an assault on the sovereignty of any country. (We didn’t have it with the Soviet Union). And given that’s there’s no evidence of any weaponization (warheads on missiles, bombs ready to be loaded on planes), such access isn’t necessary. What’s relevant is whether Iran agrees to what the experts call “uranium accountancy”—strict oversight of the supply chain of all uranium (not to mention the plutonium banned under the deal). That needs more specificity in the final agreement, but the details so far are encouraging.

Like so much else in our daily lives, the world of inspections has been changed by cameras. The preliminary deal calls for “continuous video monitoring” at all facilities handling nuclear materials. Equally significant is the inclusion of a “dedicated procurement channel,” which means that the purchase by Iran of any dual-use technologies that could used in building a bomb (or moving nuclear materials to military bases) would be closely monitored. Since the interim agreement in November of 2013, the IAEA has had daily access to key sites, which apparently would also be part of any final deal.

The U.S. technical experts I spoke with outlined “numerous new trip wires,” “many additional data points” and a “new suite of tools” to prevent and detect cheating.

“This is the world’s hardest obstacle course if you’re a proliferator,” said one, adding that the relative absence of leaks from non-political career nuclear specialists in Washington was significant: “There are enough people in the government with real knowledge that if they really thought this was a [White House] snow job, you’d know about it.”

This hardly means that Kerry won’t have to hang tough in Geneva next month, likely pulling an all-nighter around June 29 and maybe even walking out. Iran will have to back off its demand that all sanctions must be lifted first—before it does anything to fulfill its end of the bargain—and that inspectors cannot interact with the nuclear scientists who handle the equipment they are inspecting.

This is not only possible, but likely. Recall how only last year Khamenei was indignantly demanding that Iran keep 100,000 centrifuges; the deal now calls for 6,000, a more manageable number to monitor. Iran will likely allow interviews with scientists, as long as they are not described as “interrogations.”

“People think we’re too eager for a deal,” a senior administration official told me. “Actually, they’re the ones who have raised public expectations. They will suffer an enormous letdown if this deal collapses and they have a lot of incentive to get it done.”

We’re about to find out how much. From introducing health care reform over the objection of his aides to approving the raid on Osama bin Laden’s suspected compound, Barack Obama has been a risk-taking president. This one may be his biggest bet of all.