David Ignatius of the Washington Post is reporting that early in 2012 Ankara informed the Iranians of the identities of a number of Israeli intelligence sources that were being routinely met in Turkey. Per Ignatius, who is particularly well connected to the Israel government and its security agencies, 10 Iranians who were spying for Israel were, as a consequence, arrested, denying Israel one of its “significant” sources of information. The op-ed “Turkey Blows Israel’s Cover for Iranian Spy Ring” spins the revelation somewhat, perhaps predictably suggesting that the CIA regards the exposure as an “unfortunate intelligence loss.” Not knowing if the story is even true (it is being denied by Turkey in a follow-up New York Times article and has not been confirmed by Israel) or who the sources were and what their access to sensitive information might be, it is impossible to judge if that is an accurate assessment or just a red herring being put out either to protect other operations that are still running or to confuse Iranian counterintelligence. It also generously assumes that Israel was sharing the raw and presumably highly sensitive information obtained with Washington, which is unlikely.

I have no particular liking for the Iranian Revolutionary Guards, who traditionally play a key role in overseas intelligence operations as well as counterintelligence inside Iran. During my time in Istanbul in the late 1980s the intelligence war being waged against Iranian government hit teams was very intense indeed, with Revolutionary Guard units infiltrating Europe to kill opponents of the Khomeini regime. Former Prime Minister Shapour Bakhtiar was murdered in Paris in 1991 after an unsuccessful attempt eleven years earlier that killed a policeman and a bystander. Bakhtiar was one of at least 63 Iranian expats assassinated in Europe. I personally lost two sources who were murdered in Istanbul and was also myself on the receiving end of an assassination attempt by an Iranian agent that was thwarted with the assistance of the Turkish intelligence service (MIT).

Turkey has by default become a favorite venue for Iranians both supporting and opposing the regime to wage their proxy wars because it is Iran’s only contiguous neighbor that permits entry to Iranians without the necessity of obtaining a visa. It is also a stepping stone for dissidents to escape Iran, as every European country has a diplomatic mission in Turkey and there are regular, direct flights to nearly every capital in Europe, as well as to the United States.

Ignatius assumes, wrongly, that friendly relationships between intelligence services create something like mutual free-fire zones. Turkey’s closest intelligence relationship is with the United States, but even there one finds certain rules in place. His assumption that Turkey would not normally “‘shop’ Israeli agents to a hostile power” is incorrect, as Ankara would view unilateral operations run on its soil as a very serious violation of bilateral understandings.

The CIA is only allowed to conduct operations inside Turkey that are compatible, meaning acceptable to Turkey politically speaking. The Agency can run those operations without any direct Turkish involvement but has to share the results. Of course, both sides cheat as much as they think they can safely get away with. Knowing that, during my time in Istanbul, MIT was extremely aggressive in enforcing the rules, conducting regular heavy surveillance on identified CIA officers as well as carrying out random checks on other Consulate officials who appeared to be a bit too active trolling on the cocktail circuit.

This did not mean that CIA did not operate unilaterally, but it did so very carefully, frequently using officers who were brought into Turkey from elsewhere on civilian passports and who were therefore unknown to the Turks. Even then, the Turks sometimes caught the Americans with, shall we say, their pants down. One operation eerily similar to the incident recounted by Ignatius involved an American officer from Germany using business cover for meeting with eight Iranians in Istanbul. The men would return home to obtain information on targets of interest to Washington, then travel out to Turkey at intervals to be debriefed. The meetings were not detected by the Turks, but the American Case Officer made the mistake of trying to go through an airport metal detector with a pen clipped to his jacket, leading to a request to empty his pockets that produced eight false Iranian passports. He spent three nights in a Turkish prison trying to explain himself, a not very pleasant and sometimes painful experience, as viewers of the film “Midnight Express” might recall. When I went searching for the missing American, I wound up spending a night in the same slammer to teach a lesson about proper behavior until CIA fessed up to its “oversight” and we were both released.

Regarding Israel, a relationship that would be regarded as having many caveats, Turkey would have been willing to share information of mutual concern and might even countenance an Israeli-run operation jointly managed with MIT, but it would closely watch any suspect Israelis and would come down hard if the Israelis were detected running something independently. That is clearly what happened in the case cited by Ignatius. Though Ignatius takes pains to explain that the exposure was not due to poor tradecraft by the Israelis, that assumption is difficult to swallow given that the operation was blown. Be that as it may, the Israelis were punished for their transgression.

Ignatius also states that the election of Prime Minister Recep Tayyip Erdogan, with his incremental tilt towards the Palestinians, has presented a “unique challenge” for the Israel-Turkey intelligence relationship. Ignatius is no friend of Erdogan, having had one highly publicized run-in with him at Davos in 2009. Nevertheless his assessment might well be true, though the decisive factor in souring the so-called partnership was undoubtedly the killing of nine Turks by Israeli commandos on board the Mavi Marmara in international waters in May 2010. Given that backstory, it is easy to understand why Turkey would want to embarrass Prime Minister Benjamin Netanyahu.

Ignatius is too ready to accept Israeli excuses for its intelligence failures. He cites how MIT’s head, Hakan Fidan, is described by the Israelis as “the MOIS Station Chief in Ankara,” MOIS being the acronym for the Iranian intelligence and security service. It is a clever jab but ignores the reality of Turkey’s geopolitical vulnerabilities. The bottom line is that Iran is a more important neighbor to the Turks than is Israel, an on-again off-again intelligence partner for Ankara maintained largely to satisfy the United States Congress, which is quick to punish any perceived slight to Tel Aviv. Ankara would work hard to cultivate good relations with Tehran out of its own interest, assuming, rightly, that the Iranians have more to offer in areas that the Turks regard as high priorities, most notably the Kurds. Israel, on the contrary, has exploited the Kurds to work against Iran, raising legitimate suspicions in Turkey about how deep that relationship runs.

All of which is to say that in the world of smoke and mirrors there are no permanent friends and no permanent enemies. Ignatius reveals a tale likely fed to him by his Israeli contacts that seeks to exonerate their own failings while casting Turkey in a negative light for exposing an operation against nearly everyone’s preferred enemy of choice, Iran. But, of course, it is more complicated than that. Israel’s increased regional isolation makes a working relationship with it less of an asset than it might have been 20 years ago, while Iran appears to be moving towards an enhanced international role and relevance.

The Turks understand that very well.

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