A prominent Canadian-Iranian software engineer at Facebook, a superstar among technology students in Iran, traveled to Tehran in January to visit his family. It was a trip that would upend his life.
A few weeks later, the engineer departed under what he now describes as a coerced deal to act as an informant for the Islamic Revolutionary Guards Corps, the powerful arm of Iran’s military.
The engineer, Behdad Esfahbod, 38, said he was arrested by Revolutionary Guards intelligence agents on the streets of Tehran, held in solitary confinement for seven days and psychologically tortured into promising to cooperate, which he never did. He has since struggled as his mental health, marriage and career fell apart. He said he had considered suicide.
Mr. Esfahbod, who now lives in Edmonton, Alberta, and has since quit his job at Facebook, where he earned $1.5 million annually, broke his silence this week in an essay published on the website Medium.
His self-described descent into the clutches of Iran’s intelligence apparatus has touched an angry nerve among Iranians at home and abroad. Many view his story as part of a deeper malaise afflicting the country: The most promising young Iranian minds see their futures elsewhere, and are viewed with suspicion at home.
A graduate of the Sharif University of Technology, the country’s version of M.I.T., Mr. Esfahbod won a silver and gold medal in the International Olympiad in Informatics. His groundbreaking work for the past two decades has been instrumental in making non-English writing scripts available to web and android users the world over.
Mr. Esfahbod’s work at Facebook as well as companies like Google and Red Hat has made it possible to type and read in Persian, Arabic and languages of Asia and Southeast Asia, according to several technology experts.
Iranian officials did not respond to requests for comment about Mr. Esfahbod’s ordeal as described in his Medium essay, which he later confirmed in an interview. Messages left with Iran’s United Nations Mission in New York were not returned. Facebook declined to comment.
As Mr. Esfahbod tells it, plainclothes agents of the Revolutionary Guards intelligence wing snatched him as he awaited a taxi and took him to a special section of Tehran’s Evin Prison. They confiscated his laptop, phone, Iranian and Canadian passports and credit cards, and forced him to surrender the passwords to all his accounts. They downloaded 15 years of personal and professional digital history.
He was blindfolded and interrogated for long hours twice a day. His handler threatened to harm his brother and sister and keep him imprisoned for 10 years for spying if he did not cooperate. When he requested a lawyer, the agents laughed and reminded him he was in the custody of the Revolutionary Guards where words like lawyer carry no weight.
He broke, he said.
“I was disillusioned. I am not a political activist; all I was doing was trying to take my skill and education back to help. They said I was welcome to do that as long as I was an informant for them,” Mr. Esfahbod said in the interview.
His arrival and detention in Iran coincided with political turmoil that might have enhanced his value to the country’s intelligence operatives. The United States had just assassinated a top Iranian general in Iraq. Iran had responded with a ballistic missile attack on two American bases in Iraq and what it has described as the errant shooting down of a Ukrainian jetliner departing Tehran that carried Canadian citizens and many Iranians like Mr. Esfahbod, including 16 Sharif alumni.
“They told me you have a brother in America. You have a sister here. Remember the airplane we shot down? Remember we said it was human error? Same thing could happen to you and your family,” Mr. Esfahbod said in the interview.
His captors, he said, were mostly interested in gaining information about the Iranian technology community abroad, especially internet activists and engineers working on programs that help Iranians circumvent filters and gain access to secure connections.
They asked him to go out to dinner and have drinks with his contacts back in America and then report back.When he agreed, Mr. Esfahbod said, they released him.
For months afterward Mr. Esfahbod, who has a form of depression known as bipolar-2 disorder, suffered from anxiety and paranoia. He could not be alone, work or socialize. He constantly dreaded that someone was following him. He was on and off medical leave, he said, and his mental health deteriorated.
In June, Iranian agents contacted him on Instagram and called him multiple times. When he did not respond, they contacted his sister and demanded he call them. He did not oblige.
His ordeal has reverberated widely among Iranians, inciting outrage as an example of what they call the risk to those who return home from abroad only to be labeled a national security threat.
By targeting technology experts, the Iranian authorities appear to be casting a net that goes beyond the activists, dissidents and journalists typically in their sights. Iranian intelligence agents and hackers have attempted to steal the identities of Facebook users for surveillance purposes. The State Department has offered rewards on its Persian-language Twitter feed for information about what it has described as cybercriminal attempts to meddle in American elections.
Mr. Esfahbod’s ordeal in particular “has caused a shock wave in the activist and internet freedom community,” said Mehdi Yahyanejad, a California-based internet freedom activist working on anti-censorship technology.
Mr. Yahyanejad said that the community had always suspected that Iran would send agents to conferences to spy on participants. “Knowing that they are now pressuring high-profile individuals in the community to spy for them is very scary,” he said.
In Iran’s own technology circles, Mr. Esfahbod is regarded as a guru, someone young engineers and coders aspire to emulate. He had visited Iran at least once a year, his schedule brimmed with meetings at start-ups and tech companies. He was also invited to speak at universities, and students packed lecture halls to hear about his work.
The reaction to his arrest has been fierce among Iranian social media users.
“I am exploding with anger after hearing what they have done to Behdad Esfahbod,” read a Twitter posting by an Iranian identified as Mohamad Hossein Hajivandi. Another Twitter user, Ali Rastegar, wrote: “Why is there no limit to your crimes and crap? Isn’t anyone allowed to be successful in another country and not spy for you?”
Mr. Esfahbod’s struggle is far from over. Iran’s judiciary has sent him a summons, delivered to his sister’s house in Tehran, giving him a few days to report to the Revolutionary Court on allegations of threatening national security. He now says he will never be able to return to Iran, which means he cannot see his niece or help care for his aging father.
“They chase the best and brightest first into exile because of lack of opportunities at home,” said Hadi Ghaemi, executive director of the Center for Human Rights in Iran, a New York-based group. Then, he said, Iran’s authorities “target the diaspora for vicious political gain and attempts to turn the community against each other.”