There is no question that the Central Intelligence Agency recruits heavily among Iranians.

Not only is that the CIA's job, but the energy-rich Islamic Republic of Iran is one of the world's primary intelligence targets.

If the Iranians are telling the truth about capturing 17 CIA spies, many units at the CIA's headquarters in Langley, Virginia, will be in damage-control mode for months to come.

Typically the CIA recruits foreign "assets" through the use of what are known as official-cover officers — "handlers" who masquerade as diplomats and strike friendships with local people around the world.

These officers enjoy diplomatic immunity. They can be expelled from the host country, but are generally protected from prosecution if caught engaging in espionage.

However, since the Islamic Revolution of 1979, the US has had no diplomatic presence — and thus no official-cover officers — stationed anywhere in Iran.

This has made it immeasurably more difficult for the spy agency to collect accurate information from local sources.

How does the US recruit spies in Iran?

It follows that the CIA's need for dependable assets inside Iran has increased exponentially in the past 40 years. And because the CIA's mission priorities reflect those of the White House, the agency is now even more desperate for knowledgeable sources inside the Islamic Republic.

In the absence of an embassy and diplomatic immunity, it is extremely dangerous for CIA case officers to operate on Iranian soil.

So the spy agency recruits many of its assets from members of Iran's highly educated and westernised elite who are able to travel abroad.

Most of the 17 individuals who were apprehended for alleged espionage activities on behalf of the CIA appear to come from that small westernised elite.

They could be academics and other technical experts who work for the Islamic Republic's national defence sectors.

That is unlikely, however, because such experts are tightly monitored by the Iranian security services when travelling abroad, as well as within Iran.

CIA recruits — providing the Iranian media reports are true — are thus more likely to have jobs of peripheral, though not wholly negligible, importance in Iran's military and energy sectors.

Why do Iranians risk spying on their country?

Moreover, the descriptions in Iranian media reports of how these individuals are recruited and trained sound convincing but there is no absolute rule as to why they do it.

People spy against their country for all sorts of reasons, with material rewards and ideology being the top two.

But there are many others, such as relocation to a well-off country or foreign citizenship, ego (the feeling that one has been mistreated or slighted by an employer), the need for revenge, medical help and, in some cases, even love.

It is impossible to know what motivates every Iranian who spies against his or her country for the CIA, or other foreign intelligence agencies.

Officials in Tehran said on Sunday that all of the alleged spies are Iranian nationals and were lured by the CIA with promises of receiving work visas allowing them to go to America.

Others were already in possession of visas and were reportedly pressured to spy for the US in order to have them renewed.

The reason why someone agrees to spy against their country is never straightforward. ( Unsplash: Rene Böhmer )

How is secret information traded?

A government-sanctioned documentary, which aired on Iran's state owned television on Monday, claimed that the 17 spies did not know each other, but all had been trained independently in clandestine tradecraft.

The training allegedly included setting up and using secret communications systems, as well as carrying out dead drops without being detected.

Dead drops utilised containers made to resemble rocks, which were located in the Iranian countryside and elsewhere in the Middle East, according to Iranian officials.

Some of the assets communicated with their handlers while attending science conferences throughout Europe, Africa and Asia.

All of the above are standard methods of the espionage trade.

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Watch Duration: 23 seconds 23 s US Secretary of State Mike Pompeo says Iran has 'history of lying'

Did Iran really uncover 17 US spies?

Losing 17 assets in one big sweep sounds fantastical.

If it is true, it would mark one of the biggest intelligence-collection disasters in the CIA's 72-year history.

Furthermore, given that — as the Iranians themselves have said — the 17 alleged spies did not know each other. It would have taken a massive amount of counter-intelligence resources to detect, build cases and apprehend 17 separate foreign assets.

What is more likely to have happened is that the Iranians detected a small number of CIA spies — possibly no more than two — and then slowly extended their counter-intelligence investigation to incorporate those two individuals' close associates, personal friends, or even relatives.

At that stage, Iranian authorities would have used their investigative privileges to "clean the house", so to speak.

They would have targeted employees of agencies or companies with access to sensitive information who are deemed too pro-Western, have a history of publicly criticising the Iranian regime, for example.

That is probably how the investigation grew to incorporate as many as 17 alleged spies.

The 17 people who Iran has accused of being CIA spies are likely to be employees of companies with access to sensitive information. ( 1233 ABC Newcastle: Robert Virtue )

But there is another, larger, concern

What is more worrying for the CIA is that the Iranians appear to have visually identified a number of CIA case officers, whose job is to recruit and handle foreign assets.

These are official-cover diplomatic personnel who are stationed in countries such as Austria, India, Turkey and Zimbabwe.

But the Iranians claim that these diplomats are in fact official-cover CIA personnel and have now publicised their names and faces.

At one point during Monday's television program, a blonde Caucasian woman is seen advising an unidentified man about how to avoid surveillance by Iranian intelligence officers in the United Arab Emirates.

She is heard speaking Farsi with an unmistakable American accent.

If the Iranians are right, it means that the mysterious Farsi-speaking woman, along with several other individuals, will need to be recalled back to Washington as soon as possible.

It also means that their overseas careers are now at an end, since foreign counter-intelligence services know that they are in fact not diplomats, but intelligence officers.

Additionally, the CIA will have to reassess the safety of these officers' assets and foreign contacts on a case-by-case basis.

Numerous human-intelligence operations — some of them many years in the making — will need to be halted or completely terminated.

Joseph Fitsanakis is an associate professor with the Intelligence and National Security Studies Program at Coastal Carolina University.