Of the myriad of mind-blowing flaws contained in the Iran nuclear deal—a subject that has dominated the foreign policy debate across the country this summer—there’s one angle that hasn’t gotten enough attention.

It’s the possibility that Iran could outsource its nuclear program.

In other words, Tehran could play along with the P5+1 (China, France, Germany, Russia, the U.K., and the United States) as set forth in the July Joint Comprehensive Plan of Action signed in Vienna.

But at the same time, Iran could collaborate with another state to advance its nuclear weapons program—outside the prying eyes of the International Atomic Energy Agency’s inspectors operating inside the Islamic Republic.

What better candidate for cooperation than Pyongyang?

First, there’s no doubt that North Korea has the bomb, having conducted three tests (2006, 2009, and 2013), possibly using both plutonium and uranium.

Next, according to some U.S. government assessments, Pyongyang may have already miniaturized the underground testing device into a nuclear warhead, capable of being mated to a ballistic missile.

Plus, North Korea has been willing to share its nuclear know-how. Remember the furtive Syrian nuclear facility that the Israeli air force demolished in 2007?

Pyongyang was building that covert nuclear complex—no doubt for proliferation and not peaceful power purposes—for its pal, Damascus.

Moreover, while public evidence is often scarce and sometimes sketchy, there’s good reason to believe that North Korea and Iran already have some sort of security relationship.

For instance, it’s been asserted that some Iranian ballistic missiles (for example, Shahab) are based on North Korean ballistic missile technology (the No Dong) or transfers (the Scud).

(For its part, Pyongyang might also want assistance from Tehran on its space launch/satellite/long-range ballistic missile programs to fill in its current technological weaknesses in areas where Iran has excelled.)

As such, since ongoing tech ties can probably be assumed, not a lot of diplomatic spade work needs to be done to begin some level of “nuclear networking” between North Korea and Iran.

If, as many suspect, that isn’t already ongoing.

Lastly, neither country is a fan of the United States. From a strategic perspective, both Iran and North Korea would benefit from the existence of another that threatens America with nuclear-tipped intercontinental ballistic missiles.

Essentially, there’s plenty of motivation for these two states to get together on nuclear and/or missile matters.

We can expect that we’ll hear an even more full-throated defense of the Iran nuclear deal from Team Obama in the days to come with Congress returning after August recess, based on the notion that the pact has temporarily restricted Iran’s nuclear program.

But even if you believe that the deal has some hope of constraining Iran’s nuclear weapons development in the near term, there’s no sign it has ended Ayatollah Ali Khamenei’s atomic aspirations for the long term.

Iran’s protestations to the contrary, it seems clear the Islamic Republic was actively pursuing the bomb. That likely hasn’t changed.

This means that we should expect that Tehran will look to not only move forward within the framework of the Vienna-hatched deal on its nuclear program, but also move forward without the agreement using the possible assistance of a partner like Pyongyang.

Originally published in The Boston Herald.