The world powers in November reached an interim deal with Iran to freeze and even roll back a portion of its nuclear program in exchange for some sanctions relief. The arrangement went into effect on Jan. 20 and is set to expire in six months. Another interim deal may be signed then, according to the agreement’s “Joint Plan of Action,” but the proposal calls for a comprehensive long-term solution by late January, 2015.

Though Iran is often painted as the only party at fault here, the situation is far more complicated. The International Atomic Energy Agency (IAEA) and even some of the “P5+1” powers — the five permanent members of the United Nations Security Council, the United States, Britain, France, Russia and China, plus Germany — that are now negotiating with Iran, are also guilty of misconduct and unprofessionalism.

As the agency in charge of monitoring the Iranian nuclear program, the IAEA’s conduct should be beyond reproach. Unfortunately, it is not. As former IAEA inspector and 30-plus year veteran of the U.S. weapons complex, Robert Kelley has stated, “[t]he IAEA work to date, including the mischaracterization of satellite images of Parchin, is more consistent with an IAEA agenda to target Iran than of technical analysis.”

Similar flawed environmental analysis by the IAEA may have also occurred in Syria. “By openly providing a questionable technical basis for inspections,” Kelley, a nuclear engineer, summed up, “the IAEA is leaving itself open to a serious loss of credibility as a technical organization.”

Since roughly 2008, Iran has been in formal compliance with its safeguards agreement and the “nuclear crisis” has been unnecessarily dragged out, in part by the P5+1 countries pulling strings at the IAEA. To rebuild trust and reach a lasting solution, all parties to the negotiations — Iran, the IAEA and the P5+1 countries — should now come clean about any past misconduct.

The IAEA was founded as a non-political, technical agency that inspects member countries’ nuclear materials to make sure none are diverted to weapons’ uses. The agency has, however, been veering from its impartial technical mandate and is selectively pursuing certain member nations based on sometimes questionable intelligence from other states.

The nuclear agency needs to return to being the technical and impartial inspection shop it was designed to be. It should never be viewed as politically biased.

Reforming its funding stream is an overdue first step to restore confidence in the agency’s impartiality and removing any potential conflicts of interest. About a quarter of the agency’s funding comes from the United States. All told, about 65 percent of the IAEA budget is from the United States and its allies — which could make the directorate beholden to political pressure from Washington. Modernizing the agency’s management structure may also help make it more effective.

As long as most of the IAEA funding comes from Washington and its allies, however, the agency is likely to have biases and be susceptible to politicization and conflicts of interest. Consider how it has handled Iran’s case.

First, Iran has never been accused of manufacturing nuclear weapons. The IAEA did determine that Iran was in “non-compliance” with its safeguards agreement in 2005. But this had to do with technical nuclear material accountancy matters — “non-compliance” does not mean Iran was making nuclear weapons. Back then Iran did not have the fissile material needed to make bombs — even if it wanted to.

Because of this technical non-compliance finding, however, the IAEA referred Iran’s nuclear “file” to the U.N. Security Council. In an unorthodox and controversial application of international law the Western faction of the Security Council then pressed — and succeeded — in applying Chapter 7 sanctions on Iran. Normally such a step is reserved for situations when there is a “threat to the peace, breach of the peace, or act of aggression.” Such a finding was never made here.

The states that have not signed the Nuclear Non-Proliferation Treaty and have covertly developed nuclear weapons — such as Israel, India and Pakistan — could be viewed by some as far larger “threats to the peace.” But their cases have never percolated up to the Security Council. So NPT member nations with nuclear material accountancy errors have been treated more harshly by the Security Council than non-members that actually manufacture nukes.

This practice could be a disincentive for nations to remain in the Nuclear Non-Proliferation Treaty. It might even discourage countries from signing on to future non-proliferation pacts.

South Korea and Egypt both violated their safeguards agreements in 2004 and 2005. But these U.S. allies were never even referred to the Security Council — let alone targeted for sanctions.

Pierre Goldschmidt, a former deputy director of safeguards at the IAEA, notes “there is a danger of setting bad precedents based on arbitrary criteria or judgments informed by political considerations.”

As Nicholas Wright and Karim Sadjadpour argue convincingly in the Atlantic, Iran is acting just like humans do in being prepared to pay a high cost — economic sanctions and international isolation — in rejecting what it sees as unfair play.

IAEA records show that all substantial safeguards issues had been resolved in Iran’s favor by 2008. So Iran was again in compliance with its safeguards agreement at that date. Yet its nuclear files still remain at the U.N. Security Council. The chief issue outstanding is the “Possible Military Dimensions” (PMD) dossier, largely supplied to the IAEA by third-party intelligence agencies.

Even if authentic, the substance of this dossier may not be relevant to IAEA safeguards. But, according to Kelley, at least some of the evidence purporting to show weaponization research work continuing past 2004 may be less than compelling:

“[The] evidence, according to the IAEA, tells us Iran embarked on a four-year program, starting around 2006, to validate the design of a device to produce a burst of neutrons that could initiate a fission chain reaction. Though I cannot say for sure what source the agency is relying on, I can say for certain that this project was earlier at the center of what appeared to be a misinformation campaign…. Mohamed ElBaradei, who was then the agency’s director general, rejected the information because there was no chain of custody for the paper, no clear source, document markings, date of issue or anything else that could establish its authenticity,”

Ferenc Dalnoki-Veress and I recently analyzed a graph that was leaked to the Associated Press by “a country critical of Iran’s atomic program,” in an effort to implicate Iran’s nuclear program. We found that the graph — which is evidently part of the IAEA’s case against Iran — amounted to nothing more than a “slipshod analysis or an amateurish hoax.”

The former British ambassador to the IAEA, Peter Jenkins, reviewing a new book on Iran’s nuclear program, recently weighed in on the dossier. “Since early 2008,” Jenkins wrote, “the case against Iran has rested mainly on material stored on a laptop. The material came into U.S. hands in 2004, and was passed to the IAEA in 2005. For two and a half years IAEA officials regarded the material as dubious and made no use of it. It was only in 2008 that they started to press Iran to answer for it.”

Iran, however, has not “refused to cooperate” on these accusations. Tehran has cooperated to the extent that it has said that the accusations are false and the evidence fabricated. This may well be the case, at least for some part of the documents contained in the dossier.

Much is also made of Iran’s reluctance to let agency inspectors into the Parchin military site. Yet the inspectors visited this site twice in 2005 and found nothing of concern.

As Hans Blix, former head of the IAEA, explained: “Any country, I think, would be rather reluctant to let international inspectors to go anywhere in a military site … In a way, the Iranians have been more open than most other countries would be.”

From a technical perspective, the unauthenticated “PMD” allegations make little or no sense. Even the recent ominous-sounding “Polonium” and “Exploding Bridgewire Detonators” issues have perfectly rational explanations. In short, every “PMD” issue that has been made public and is authenticated has shown to have a plausible non-incriminating explanation. The Associated Press has reported that about 80 percent of the evidence the IAEA has against Iran comes from just the United States, Israel and other close allies. This would perhaps be acceptable if the intelligence were always of high quality and authenticated but, evidently, this is not always the case.

Jim Walsh, a research associate at the Massachusetts Institute of Technology, made an excellent suggestion about what to do with Iran’s “PMD” file. Mark Hibbs explained it: “If the nuclear activities were in the past, I don’t care. It’s dead, and it’s regretful, but let’s do a deal with Iran that moves forward.”

In 2008, when virtually all the substantial safeguards’ issues had been resolved, the U.N. Security Council could have annulled the sanctions and returned Iran’s “file” to the IAEA. Unfortunately, the agency and Security Council practice has been less than objective and seems to be susceptible to politicization.

There is, fortunately, a simple way out of the byzantine bureaucratic mess. The U.N. Security Council could adopt a new resolution verifying that Iran is now technically in compliance with its safeguards agreement. This would annul the previous U.N. resolutions calling for sanctions, and return Iran’s “file” to the IAEA. Individual countries that wanted to maintain unilateral sanctions would, of course, still be free to do so.

Another reason that the current set of U.N. nuclear sanctions on Iran should be annulled is because their prescription of zero enrichment will not be met. The negotiations between the world powers and Iran center on limits to enrichment — not on outright suspension. The 2006 U.N. Security Council demand that “Iran shall suspend all enrichment-related…activities” is outdated. As written, the old sanctions resolutions are essentially irremovable because their demands will not be met.

A new U.N. resolution superseding the older ones would better capture the truth today, while returning Iran’s file to the IAEA, the proper agency responsible for nuclear safeguards verification.

The IAEA already spends the second-highest amount on Iran’s nuclear inspections. Only Japan, with a vastly greater nuclear infrastructure, accounts for a bigger chunk. About 12 percent of the IAEA’s $164 million inspections budget is spent on Iran. This is due to go up to roughly 18 percent during the interim deal, because of the even more rigorous — and thus expensive — inspections.

To reach a comprehensive deal, both sides should now own up to past mistakes and make amends. For example, Iran should consider ratifying the Additional Protocol, which would provide more confidence that it would continue to abide by its safeguards agreement. (Brazil and Argentina, which also enrich uranium and had nuclear weapons programs in the past, should consider doing the same.)

Iran should also consider removing the spent fuel from its Arak heavy-water reactor for disposition by a third country to prevent it from becoming a plutonium source. Tehran should be open to a frank discussion about whether it undertook weaponization research during the times of tension with Iraq in the 1980s and 1990s.

Sweden and Switzerland, which had clandestine nuclear weapons programs even after they signing the NPT, are now in good standing with the world powers. So a resolution should not prove impossible.

In the spirit of reconciliation, the P5+1 states and the IAEA could admit to having used unorthodox procedures, partly motivated by political considerations, in handling Iran’s case. They should now support passing a new Security Council resolution that annuls the past U.N. nuclear sanctions, and better captures what a realistic end-state of Iran’s nuclear program would look like.

Reforming the IAEA’s management structure and funding streams should also be seriously considered to improve the agency’s professionalism. Bringing in a new IAEA chief who is seen as more apolitical than the current one could also be helpful.

The IAEA should also revisit whether it will continue to accept intelligence from third parties — particularly non-NPT member states.

Jenkins, the former British ambassador to the IAEA, summed it up well: “talk of an ‘Iranian nuclear threat’ is…premature. Consequently, the draconian measures implemented by the U.S. and its allies to avert that threat are unreasonable and unwarranted.”

PHOTO (TOP): International Atomic Energy Agency Director General Yukiya Amano addresses the media after a board of governors meeting at the agency headquarters in Vienna, January 24, 2014. REUTERS/Heinz-Peter Bader

PHOTO (INSERT 1): A security official talks to journalists in front of Bushehr main nuclear reactor, 1,200 km (746 miles) south of Tehran, August 21, 2010. REUTERS/Raheb Homavandi

PHOTO (INSERT 2): Iran’s Foreign Minister Mohammad Javad Zarif speaks to the media during a news conference following the E3/EU+3-Iran talks in Geneva, November 24, 2013. REUTERS/Ruben Sprich

PHOTO (INSERT 3): Seated at the table are French Foreign Minister Laurent Fabius (L), U.S. Secretary of State John Kerry (4th L), Iranian Foreign Minister Mohammad Javad Zarif (C), European Union foreign policy chief Catherine Ashton (4th R), Russian Foreign Minister Sergey Lavrov (3rd R) and British Foreign Secretary William Hague (R) during a meeting of the foreign ministers representing the permanent five member countries of the United Nations Security Council plus Germany on the sidelines of the UN General Assembly at the UN Headquarters in New York, September 26, 2013. REUTERS/Brendan McDermid