In the spring of 2000, I lived for a month in a Taliban madrasa, a religious seminary, located on the Grand Trunk Road outside of Peshawar, in Pakistan. The chancellor of the madrasa, a wrinkled, bearded, and often barefoot man named Samiul Haq, was said to be a confidante of Mullah Omar, the Taliban leader. I did not believe, when we first met, that he would agree to my presence in his school. I was open about my intentions: my goal was to write about the religious education of Pashtun boys who would soon be fighting on behalf of the Taliban, and by extension al-Qaeda, in Afghanistan.

It turned out that Haq was keen to have me understand the work of his madrasa. In our first meeting, he even made an attempt at bonding. “The problem is not between us Muslims and Christians,” he said. “The only enemy Islam and Christianity have is the Jews. It was the Jews who crucified Christ.”

In my travels, Palestinian terrorists generally understood the implication of my last name, as did many members of Hezbollah, the Shia extremist group. But Islamists in Pakistan and Afghanistan seemed less Semitically attuned.

“I’m Jewish,” I said.

He paused. “Well,” he said, “you are most welcome here.”

Not long after my stay at the madrasa, I visited a mosque outside Muzaffarabad, in Kashmir. The mosque was affiliated with Lashkar-e-Taiba, the group that would go on to commit the famous massacre in Mumbai in 2008.

The subject of my religion came up in conversation. The imam was fascinated. He was anti-Semitic, but impersonally so. His abstract detestation of Jews was trumped by a practical curiosity. He phoned a friend who, like him, had never met someone from my tribe. That friend brought another friend. Soon, we were having a colloquy on several subjects—the putative righteousness of Osama bin Laden’s cause, the alleged treachery of Bill Clinton—but our focus narrowed to matters of faith. I raised the subject of Muhammad’s often complicated, sometimes violent relationship with the Jews of Arabia. These men, like many Muslims, believed that the Jews had behaved perfidiously toward their Prophet, and they endorsed Muhammad’s decision to behead some 600 of his Jewish enemies, the males of the vanquished Banu Qurayza tribe.

The extremists don’t need a middleman anymore. Journalists have been replaced by YouTube.

Back then, it did not seem foolhardy to engage Muslim terrorists on the subject of beheading.

It was not as though they didn’t already hate Jews, and Americans. Even in the 1990s, the hatred, particularly in Pakistan, was sometimes palpable. I once went, at night, to a sketchy section of Rawalpindi, to interview a man named Fazlur Rehman Khalil, the leader of a terrorist group then called Harkat ul-Mujahideen. Khalil had co-signed bin Laden’s 1998 fatwa calling for the killing of Americans and Jews. He gave me tea, and told me that he would happily use nuclear weapons to eradicate the enemies of Islam. “If we had them, we would use them as necessary. But they’re very expensive,” he said. The conversation turned to the fatwa. Why Jews?, I asked. “Because you are from Satan,” he said. When we were done with the interview, our transaction complete, I left for my hotel.

I had glimpsed a treacherous and secret subculture, and I was happy, because a reporter’s deepest need is to see what is on the other side of a closed door. In exchange, I would tell people in the West about Khalil and his beliefs. I was appalled by his message, and I wanted readers to understand the horror of it. But Khalil believed he was doing good works, and he wanted the world to celebrate his philosophy. Back then, the transaction worked for both parties. Today, when I think about the meeting, I shudder.

I spoke recently with a friend, Dexter Filkins, of The New Yorker, about the assumptions we used to make. I first met Dexter in the spring of 1998, on the runway of the airport in Kabul, a couple of months after bin Laden issued his fatwa. The order seemed like the grandiose outburst of an impotent fantasist, and Western reporters who traveled in Afghanistan did not take it seriously, at least not as concerned their own safety. “I used to tell people that as a reporter for an American news organization, it was like we were wearing armor,” Dexter recalled. “People just didn’t go after American reporters.”

The attacks of 9/11 weren’t the decisive break in the relationship between jihadists and journalists. It was the decision made by a set of extremists in Pakistan to kidnap the Wall Street Journal reporter Daniel Pearl in January 2002 that represented a shift in jihadist thought. To his kidnappers, Pearl was not a messenger to the outside world, but a scapegoat to be sacrificed for the sins of his fellow infidels. Murder was becoming their message.

Danny Pearl was the reporter who first gave me telephone numbers for important figures in Pakistani extremist circles. Danny was generous, Danny was careful, but Danny was unlucky. Even after his murder, I convinced myself that this horrible moment was the exception that proved the rule. Non-Jewish reporters, meanwhile, could tell themselves that Danny’s death had more to do with his religion than his profession.

“It just seemed to me like a freakish anomaly,” Dexter said. “I went to the tribal areas in Pakistan, to Wana, by taxi, after he was killed. It used to be pretty easy. You could go into situations that were very dangerous, and the chances of being hurt were very small.”

Today, of course, Western journalists who seek out jihadists are courting death. The beheadings of James Foley and Steven Sotloff by ISIS, the Islamic State terror group, are persuasive arguments for prudence.

Why have some groups rejected the notion of journalistic neutrality? For one thing, the extremists have become more extreme. Look at the fractious relationship between al-Qaeda and ISIS, which is an offshoot of al-Qaeda but which has rejected criticism from Qaeda leaders about its particularly baroque application of violence.

Another, more important, reason relates to the mechanisms of publicity itself. The extremists don’t need us anymore. Fourteen years ago, while I was staying at the Taliban madrasa, its administrators were launching a Web site. I remember being amused by this. I shouldn’t have been. There is no need for a middleman now. Journalists have been replaced by YouTube and Twitter. And when there is no need for us, we become targets.

Three years ago, Dexter and I both found ourselves in Pakistan again, staying in the same anonymous guesthouse in Islamabad, which seemed safer than any alternative. Especially after the killing of Osama bin Laden, when so many people in Pakistan were contemplating revenge, the large hotels had become irresistible targets for terrorists. They were also infested with agents of the Inter-Services Intelligence (ISI) directorate, the handmaiden of many of the terrorist groups.

I was reporting on the security of Pakistan’s nuclear weapons; Dexter was investigating the murder of a Pakistani journalist who was killed, apparently, by agents of the ISI. Both topics were dangerous territory, and we came under harassment. I was followed; Dexter’s phone was tapped. Each time I returned to the guesthouse, I could tell that strangers had been in my room. One day, I got a call from someone who identified himself as a reporter for a major Urdu daily newspaper. “We understand that you’re a prominent Zionist, and we want to write about you on the front page,” he said.

Such an article would have gotten me killed. The reporter’s call represented an invitation from the ISI to leave Pakistan right away. I knocked on Dexter’s door. He had been in the country for a month, and he seemed haunted. His room reminded me of Martin Sheen’s in the opening scene of Apocalypse Now. Time to go, I said. In the taxi to the airport, we discovered that Dexter’s visa had expired. We edited his passport with a Sharpie, while standing behind a tree outside the terminal. The ISI did not impede our departure.

Each unhappy place has its own rules. In Iran, Western reporters are often welcome, and sometimes arrested while performing their duties. In Gaza over the summer, Hamas, the Muslim Brotherhood’s Palestinian branch, was both eager to help reporters inspect the damage done by Israeli air strikes, and rigorous about denying reporters access to the rocket crews launching attacks on Israeli civilians. In Lebanon, Hezbollah maintains a sophisticated media-relations operation designed in part to thwart independent reporting.

I no longer spend much time with Islamist groups. Today, even places that shouldn’t be dangerous for journalists are dangerous. Whole stretches of Muslim countries are becoming off-limits. This is a minor facet of a much larger calamity, but it has consequences: the problems of Afghanistan and Pakistan and Syria and Iraq are not going away; our ability to see these problems, however, is becoming progressively more circumscribed.

Once, in Upper Egypt, in Minya, a Salafist cleric was lecturing me on the characteristics of unbelievers. It was a typical rant, and it ended with a justification for sacred violence, to be directed by followers of the one true faith against those who defy God. I must have been tired, or frustrated, because I impulsively asked: “Why haven’t you personally killed any unbelievers? What are you waiting for?” Left unspoken was: Here’s my throat.

He answered simply, “Everything happens according to a plan.” In other words: All in good time.

Young reporters sometimes come to me for advice about working in the Middle East. In years past, I would tell them that this was an excellent idea: save some money, go learn Arabic, be a newspaper stringer, grab for the big stories, and you’ll have an interesting life. Steven Sotloff was one of those who sought my advice. His Middle East career was already under way (he was living in Israel at the time), and I prefer to think that he could not have been dissuaded.

But I’m capable of learning, and my advice now is to go somewhere else.