The closer the world gets to serious diplomatic engagement with Iran on its nuclear program, the more hard-liners in Washington and abroad will push military action if the effort fails. Prime Minister Benjamin Netanyahu of Israel, for one, has tried to goad the Obama administration to show Hassan Rowhani, Iran’s newly elected president, that “the military option which is on the table is truly on the table.”

Until the United States and Iran invest in diplomacy, there is no way to know if a deal is possible. But we cannot think of a faster way to sabotage this fleeting moment than to force Mr. Rowhani into a corner. President Obama has said he will not tolerate Iran’s acquiring a nuclear weapon and has repeatedly warned of a “military option.” Both he and Mr. Rowhani need courage, creative ideas and the skill to manage their domestic politics for the two nations to enter into a meaningful dialogue.

Both sides have made some reassuring comments since Mr. Rowhani, a relatively moderate cleric, beat out more conservative challengers to succeed Mahmoud Ahmadinejad. The major powers are eager for more concrete action. Mr. Rowhani could send signals by choosing a moderate cabinet and nuclear negotiator, and by agreeing to early talks, even a bilateral meeting with the Americans.

Sanctions have helped push Iran to the negotiating table, and the ones in effect should be enforced. But adding new ones, as some in Congress want, would reinforce Iran’s view that the Americans’ goal is to crush the mullah-led government, and would make negotiations impossible.