There’s a dirty little secret about the North Korean nuclear deal brokered by President Bill Clinton in 1994.

It actually worked.

The so-called Agreed Framework failed to accomplish everything it set out to achieve. And under the administration of George W. Bush, the agreement ultimately fell apart. But it did manage to do something significant.

“The Agreed Framework froze [the North Korean nuclear] program for eight years before [the agreement] finally collapsed,” says Matthew Bunn, a nuclear policy expert at Harvard University’s Kennedy School of Government.

Bunn says the North Koreans were guilty of cheating at various times, “but still, there was no plutonium being produced for nuclear weapons.”

That’s one important lesson learned from North Korea, Bunn says. When the US was engaged with trying to implement the terms of deal, he says, there was real progress.

“When we returned to isolation and sanctions, [the North Koreans] pulled out of the Agreed Framework. They reprocessed the plutonium, put it into nuclear weapons, pulled out of the Nuclear Non-Proliferation Treaty, [and] tested a nuclear bomb,” Bunn says.

Prior to the 1994 agreement, US intelligence agencies estimated that the North Koreans had possibly hidden away enough nuclear material to build one or two nuclear weapons.

“Now, they have ... a dozen nuclear weapons,” says Jeffrey Lewis, an arms control expert at the Middlebury Institute of International Studies at Monterey. “Zero, one or two is not great. But — 12 is worse.”

And they might have a lot more, Lewis adds. But there are no inspectors in the country to find out.

In the end, the Agreed Framework fell apart because of a lack of trust. There was simply insufficient political will on the part of the US and North Korea.

“Both sides [were] feeling the other was cheating and that they weren’t getting what they had expected to get out of the deal and it was sort of one problem after another that led each side to conclude this deal isn’t working,” Bunn says.

The essence of the Agreed Framework was a trade-off. North Korea would freeze its nuclear program in exchange for energy assistance from the US. But both sides hedged. Washington dragged its feet on funding shipments of fuel oil and construction of a new research reactor for the north. And Pyongyang started cheating, namely, by opening up a covert pathway to nuclear weapons with a secret uranium program.

But the deal was more of a grand bargain, Lewis suggests. “The Agreed Framework was premised on the idea that North Korea would give up its nuclear weapons, and we would gradually treat them like a normal country. But they’re not a normal country. And nuclear weapons weren’t the only problem we had with them,” he says.

North Korea’s appalling human rights record never improved substantially. The country also continued to develop ballistic missile technology. These were big problems for Washington. And Lewis says they contributed to the demise of the Agreed Framework.

But if the Bush administration was content to allow the nuclear deal with North Korea — brokered by its predecessor — to fall apart, Lewis says, only a few short years later, the White House found itself deploying its diplomats to pursue another agreement with North Korea that looked a lot like the one that President Clinton made.

“They negotiate[d] a freeze with the North Koreans, but they can’t call it that. So, they called it ‘disablement,’” Lewis says. “[It was] a triumph of politics over substance.”

The legacy of the North Korea experience can be seen in the details of the Iran deal. There are more provisions for inspectors, for example, to detect cheating on the part of the Iranians. The accord also does not aim to change the behavior of Iran in the region. Nor does it hold out the promise of moving toward political normalization between the US and Iran. Lewis says the Iran deal is more of a narrow quid pro quo: Iran gets sanctions relief in exchange for limitations on its nuclear activities.

As with the North Korean case though, success for the Iran agreement will depend on all sides having the political will to safeguard trust and deliver on its own side of the bargain.