The Central Intelligence Agency, established through the National Security Act of 1947, was primarily intended to be a centralized clearinghouse for information to prevent another Pearl Harbor-style attack on the United States. Be that as it may, the initiation of what would eventually be termed the Cold War soon after led to the rapid expansion of the Agency’s role, to include running actual spies and engaging in classic covert actions. The CIA took the lead in the U.S. pushback against Moscow and developed tactically into the principal offensive weapon in America’s conduct of the Cold War. Russia and its allies responded in kind. Indeed, the Cold War against the Soviet Union and its allies might well be termed the war of the spies.

Espionage employing human agents, as opposed to technical intrusions, is a high-risk and morally questionable business. It was justified after World War II because the United States was confronted by a cluster of enemies who were militarily powerful and fully capable of hitting the American homeland with nuclear weapon-tipped ballistic missiles. Given that level of confrontation, the most important secrets were those relating to the intentions of the leadership of countries like Russia and China—and it is only possible to obtain that kind of information from an actual spy who penetrates the inner councils of the hostile regimes. That is precisely why so much time and effort has been put into recruiting, training, and supporting spies overseas.

On May 20, the New York Times reported that “Killing CIA Informants, China Crippled U.S. Spying Operations”.  The article described how an entire network of American spies in China had been identified by the counterintelligence services of that country and rolled up between 2010 and 2012, “crippl[ing] U.S. spying operations…for years afterwards.” Some of the “eighteen to twenty” sources, including high level government officials, were executed while others were imprisoned. It is to be presumed that all who were not shot outright were tortured. The Times report stated that a thorough damage assessment has been conducted but it had proven impossible to identify the actual cause of the disaster, so it remains unknown whether there was a mole or some tradecraft or communications failure that had brought about the death and imprisonment of so many American agents.

In reality, the rolling up of entire American espionage networks is not exactly that unusual because of the way intelligence agencies operate even when their actions have not been betrayed from within. Sweeping arrests of American spies have occurred not only in Russia and China, but also in Cuba, Iran, India and France. In theory, every single high-level spy in what is referred to as a “denied area” with a hostile and capable counterintelligence service is compartmented off from any other spies operating in that country, but the reality is that agents are often recruited and handled in such a way that the exposure of one individual puts all the others at risk.

To be sure, the mole explanation is attractive because it is more convenient to blame an individual than it is to critique an entire system. But as the presumed mole has not been discovered, it also leads to the presumption that he or she might still be active. CIA and FBI moles have been devastating. Aldrich Ames, Robert Hanssen, and Edward Howard provided the Soviet Union with information that led to the betrayal of numerous agents and the virtual destruction of espionage networks that took years to develop. In this case, investigators identified several possible moles, one of whom had quit the Agency and moved to an unnamed Asian country, but a solid case to proceed with an arrest could not be developed.

And then there is the tradecraft angle. Tradecraft is the term used to describe how an American case officer identifies, develops, recruits and then runs a spy. The Times account reveals that highly-sensitive Chinese agents were routinely met by their handlers in Beijing. There were encounters in restaurants where the local counterintelligence service employed the waiters and had microphones implanted on all of the tables. I must admit that I find it unimaginable that even a Chinese-American case officer would risk meeting a Chinese official in the high-security environment that Beijing represents, but that is apparently what the FBI investigation determined. It would be a piece of cake for local surveillance to pick up the agent, interrogate him, and develop a clear picture of the CIA modus operandi in the city. Once you have one spy you have the key to identifying all of them.

The other two notable vulnerabilities are how and where foreign spies are recruited and what they use to communicate. How would you recruit a Chinese official or scientist who would have information that Washington wanted? You would approach him when he is outside China on business, vacation, or studying. But the problem is that those places where American intelligence can operate freely are relatively easily identifiable and are also well known to the counterintelligence service in Beijing. So a Chinese physicist recruited by U.S. intelligence while doing postgraduate studies at an American university would intensify interest in others who also attended that university, some of whom might also be spies.

Back in my time in the Agency, a number of hostile intelligence services identified vacation and business destinations in the Middle East where their officials were being spotted by CIA, approached, and sometimes recruited. Knowing this, they could focus on recent travelers to those areas and were able to turn several of the agents while also identifying a number of others. The Chinese counterintelligence service could certainly have done the same in assessing its travelers that it considered sensitive from either a political or occupational point of view.

Knowing how the opponent is approaching and recruiting spies from among your countrymen also provides an opportunity to run a dangle operation, which can be used to enter, identify, and disrupt an intelligence network. A dangle is essentially a double agent who will pretend to work for the Americans while really working for his own country. U.S. intelligence polygraphs new agents but “swirl” examiners confess that lie detectors work best on Americans, who find it hard to lie when confronted by a machine that they believe can tell what is the truth. Asians and Arabs are regarded as particularly difficult to examine effectively because their cultures make it possible to mentally compartmentalize their responses. Guilt-ridden Catholics are easy.

And then there are the communications, seen by many as the most vulnerable element in agent handling. No one writes letters anymore, so secret or invisible writing is passé, but electronic communication using satellites is very much in. Messages from spies are encrypted, but anything encrypted can be unencrypted if enough time and effort are committed to the project. One should assume that the counterintelligence services in Moscow and Beijing are very good at what they do and quite willing to work hard. American intelligence services probably used the same technical system to stay in touch with all their spies in China, so when you catch one of them and analyze his procedures and equipment you are probably well on your way to catching all of them. And when you uncover a “nest of spies” you inflict serious collateral damage on whoever recruited them. In this case, prospective Chinese agents willing to trade secrets for money will come to the logical conclusion that the United States government is unable to protect them.

The best way to avoid the pain and embarrassment of having one’s human sources exposed is to cut back on spying in most places most of the time because running agents will inevitably mean occasionally getting caught. It is perhaps more important to consider why one spies in the first place. Unique information that protects a vital national interest is certainly desirable, but unleashing thousands of numbers-driven case officers worldwide to collect information that is either of passing interest or no interest at all is both a waste of resources and an invitation for international humiliation when something goes wrong. With that in mind, one has to wonder how many of the Chinese who paid the ultimate price were actually providing information that was essential to policymakers in Washington. Perhaps none of them were.

Philip Giraldi, a former CIA officer, is executive director of the Council for the National Interest.