The agreement this week between the governments of Iraq and Iran to enter a formal relationship to fight the Islamic State group should be deeply troubling to the United States. The Islamic State, also known as ISIS, is a grave threat to the region and is responsible for the horrifying beheading of American journalists and an aid worker, as well as the brutal slaughter of countless innocent Muslims and Christians in Syria and Iraq. But as grave a threat as the Islamic State is, Iran is a much greater threat — especially if it acquires nuclear weapons.

In November, the U.S. decided to extend nuclear talks with the Iranians, despite stalling on the part of the mullahs. The practical effect of the decision is to give the Iranians more time to make a bomb.

Lest anyone believe the sometime assurances of the Iranians that their desire to enrich uranium is purely for peaceful purposes, a news story on the United Nations' website in September raises suspicion. It says International Atomic Energy Agency Director General Yukiya "Amano noted (that) the Agency is not in a position to provide credible assurance about the absence of undeclared nuclear material and activities in Iran, and therefore to conclude that all nuclear material in Iran is in peaceful activities." That translates from diplomatic-speak into: We're not buying the Iranians' story.

A comprehensive study of Iran's nuclear programs was released in Brussels in November by the nongovernmental organization International Committee In Search of Justice, a group made up of current and former European parliamentarians and other experts. What the study shows is that Iran has a dual nuclear program — a civilian side, which appears to pursue peaceful nuclear energy, and a military program, which skirts sanctions by obtaining dual-use nuclear materials or simply smuggling bomb-making materials into the country. Leadership for the civilian and military programs frequently overlaps, with scientists and others switching places between the two programs as needed.

Meanwhile, the Obama administration largely looks away, instead pursuing negotiations that will never persuade the Iranian regime to give up its nuclear weapons agenda. Part of the problem is that the administration doesn't want to take on the Islamic State directly in Iraq, preferring to provide American military advisers who will play a severely limited role while the Iranian Revolutionary Guard Corps actually provides thousands of troops on the ground.

But expediency in the fight against the Islamic State is a bad strategy for the U.S. and for the world. If — more likely, when — Iran develops nuclear weapons, those weapons not only will be used by Iran to intimidate its neighbors but also could well be put into the hands of terrorists whose reach extends far beyond the immediate region.

So what can and should be done? I asked Maryam Rajavi, the leader of the National Council of Resistance of Iran, to give her sense of what might actually persuade the Iranians to give up nuclear weapons. "They will only forgo the bomb if they sense that their survival is in danger and if they feel that the risk of insisting on the nuclear project outweighs the risk of abandoning it," she told me.

Rajavi talked about the mistakes the U.S. has made during the negotiations, giving the regime time to improve its ballistic missile programs, as well as enrich uranium. The regime, she said, "will dodge the signing of a comprehensive agreement as long as it possibly can, unless international pressure forces it to retreat."

Rajavi believes that the movement she leads is a direct threat to the mullahs. "In their confrontation against a decaying tyranny," she noted, "the Iranian people have a democratic alternative with a clear platform that seeks a secular and pluralistic republic, gender equality, a society based on respect for human rights and the abolition of the death penalty, abdication of the mullahs' Shariah laws, providing equal economic opportunities to all, a nonnuclear Iran, and peace and coexistence with the rest of the world."

Too bad the U.S. has been unwilling to recognize Rajavi's group, only taking it off the official terrorist list after the group challenged the designation in U.S. courts. Rajavi is no threat to the U.S., but she may just be the biggest challenge to the real threat we face in Iran.