Sunday’s New York Times had a cautionary tale, but perhaps not the one it intended. Silicon Valley executive Sal Shafi worried that his 22-year-old son Adam (pictured) had turned to jihad and contacted the FBI with his concerns. The young man was arrested and in December he was indicted by a federal grand jury , accused of providing material support to the al-Nusrah Front in Syria.

The Times piece focuses on the father’s anguish about ratting out his kid and landing him in jail. Shafi wished for a middle ground between doing nothing and putting the kid in the slammer, and sought to develop an intervention approach that could be used. That didn’t work out, and Shafi ended up feeling wronged by the government, warning parents with a similar problem, “Don’t even think about going to the government.”

In fact, Sal Shafi seems like an outstanding father, taking all the steps for his son that a born-here American would do. And there’s the rub: among Muslim immigrant children, the normal separation process from the parents can sometimes take the form of jihad. The immigrant parents are busy getting settled among strangers in a new culture, while born-here kids or immigrants who arrived young have different issues.

The kids may feel not quite American, depending on the home life, and tend to hang out with other young people of the same demographic, hence the common formation of gangs among second-generation youth.

The problem of young Muslims turning jihad is common: thousands have left Europe to fight in the Middle East, rejecting the freedoms that westerners treasure. The Tsarnaev brothers who bombed the Boston Marathon, had plenty of opportunities handed to them, but preferred to kill for Allah. Dozens of young Somalis have left Minnesota for their ancestral home for jihad.

I have a book in the stack titled, Europe’s Angry Muslims: The Revolt of the Second Generation that expresses where much of the trouble lies.

Mass-murdering jihad cannot be screened out by careful investigation of new immigrants — such as the Syrian refugees Obama is rushing to admit — because it can reappear in later generations. Muslim immigration is a bad idea, period.

FREMONT, Calif. — The banging on the door jolted Sal Shafi awake.F.B.I. agents were looking for his son. “Where’s Adam?” they yelled. “Where’s Adam?”

Terrified, Mr. Shafi led the agents, guns drawn, up the stairs toward his son’s bedroom. He watched as they led his 22-year-old son away in handcuffs, backed by evidence of Adam Shafi’s terrorist ambitions.

He had come to the attention of officials not by a well-placed informant or a sting operation. His father, concerned and looking for help, had simply picked up the phone and led the government right to his son. For months, over the objections of his lawyer, Mr. Shafi had been talking to the F.B.I., believing he was doing the right thing.

“My God,” he thought, soon after the arrest in July. “I just destroyed Adam.”

Had things been different, Mr. Shafi, 62, a Silicon Valley executive, might have become a much-needed spokesman for the Obama administration’s counterradicalization campaign. Who better to talk to other parents about the seductive pull of terror organizations? Trust the government, he would tell them. They do not want to take away your children.

Despite nascent efforts to steer young people away from terrorism, the government’s strategy remains largely built on persuading people to call the F.B.I. when they first suspect a problem.

“Alert law enforcement,” Attorney General Loretta E. Lynch said in December. “It could simply be your neighbor having a bad day. But better be safe than sorry.”

For parents, particularly those who see their children as misguided but not dangerous, the decision to make that call can be agonizing. Do you risk sending your son to prison? Or hope things improve and he does not hurt anyone?

The Justice Department praised Mr. Shafi’s efforts to save his son, but said in court that his son was living a “terrifying” double life. Prosecutors said Adam Shafi was “such an unpredictable threat” that he was too dangerous to be anywhere but a jail cell. Mr. Shafi and others, though, say the case shows that there were never any alternatives.

“This is an abject failure, that there is no system in place that doesn’t result in spending 20 years in jail,” said Seamus Hughes, a former National Counterterrorism Center official who once helped implement the Obama administration’s strategy for countering violent extremism.

The Justice Department’s campaign against American supporters of the Islamic State is rife with examples of family members acting out of desperation. Mothers have hidden passports and money to keep their sons from traveling. In Minnesota, a fight broke out as relatives tried to keep a young man from flying out of the country. In Texas, a family lured a 19-year-old home from Turkey by tricking him into thinking his mother had fallen ill.

Mr. Shafi chose a different route. He did what the government asked. His story is a desperate search for someone to help his son.

A Frantic Call The Shafis were vacationing in Cairo in the summer of 2014, visiting extended family, when they awoke on a Saturday to find Adam gone. He sent a text message to a younger brother, saying he had left “to protect Muslims.”

Mr. Shafi has never been deeply religious — “don’t do bad things,” is how he describes his faith — but his son had embraced religion. Outwardly at least, that meant charity. He made sandwiches and delivered them to San Francisco’s homeless. He talked about opening a free health clinic. Perhaps, Mr. Shafi thought, Adam, who was 21 at the time, was at a mosque working on a social cause.

But when he did not come home, Mr. Shafi became frantic. A protective father of five, he had installed tracking software on his children’s phones. But it did not work overseas. On Sunday, he called the American Embassy in Cairo. An official there was polite but dismissive and told him to wait another day.

“Maybe he’s been recruited,” Mr. Shafi said. That grabbed the man’s attention.

Mr. Shafi now says he was merely trying to prod the embassy into helping his son. But he acknowledged that, at the time, he was also thinking about the parents on the news who discovered that their children had fled to join the Islamic State.

At the embassy later that day, Mr. Shafi told officials that he worried that his son might be following extreme imams online, according to court documents. His son, he said, had been “grieving about what is happening to Muslims” abroad. “Maybe he is in Syria? Iraq? Gaza?” Mr. Shafi said.

It turned out that Adam Shafi was in Turkey, a common gateway for foreign fighters to Syria. Not long after the embassy meeting, he texted his family that he was on his way back. He told his family he had gone to witness the plight of refugees there.

“Why didn’t you let us know?” Mr. Shafi demanded. He remembers his son’s response. “He said, ‘You wouldn’t have let me go.’ Which is true. You say you’re going to visit refugees by yourself? Hell no.”

Back home in California, Mr. Shafi’s lawyer ordered him not to talk to the F.B.I. But when two agents arrived at the house a few weeks later, Mr. Shafi invited them in.

“We don’t have criminal minds,” Mr. Shafi said later. “Maybe I’m naïve. I’ve never dealt with the authorities before. I wanted to cooperate.” He arranged for the agents to interview Adam at a coffee shop.

In conversations over many months, court documents show, Mr. Shafi told the agents that he worried about his son’s depression and said he had encouraged counseling. Sometimes, when the television showed people suffering in war-torn Syria, his son would leave the room and cry, Mr. Shafi said.

With his son under F.B.I. investigation and facing few options, Mr. Shafi arranged for him to visit a suspected terror financier, Armin Harcevic, in a nearby jail. Mr. Shafi told the F.B.I. that he hoped it would help him “see the error in his ways or at least the grave consequences,” according to court documents.

Once, Mr. Shafi said, the agents mentioned the Boston Marathon bombing and said they believed his son had been radicalized. Mr. Shafi laughed. “I don’t think so,” he told them. “I can assure you that Adam is not violent.”

The F.B.I. had good reason to doubt those assurances — agents had been secretly eavesdropping on Adam Shafi’s phone conversations.

“I just hope Allah doesn’t take my soul until I have at least, like, a couple gallons of blood that I’ve spilled for him,” he said in one conversation last June, according to court records. He also mused about killing American soldiers.

In another call, he said the Islamic State killed too indiscriminately, but he admired the Nusra Front, which is linked to Al Qaeda. Nusra, like the United States, is fighting both the Islamic State and the Syrian government of President Bashar al-Assad. But it is a designated terrorist group, and supporting it is illegal. “I am completely fine dying with these guys,” he said, according to court documents.

Then, on June 30, 2015, Mr. Shafi’s phone-tracking software alerted him that his son was at the San Francisco airport, at a gate for Turkish Airlines, trying to go to Turkey again.

Sent Home From Turkey Mr. Shafi scrambled to contact overseas relatives to intercept his son in Istanbul, but F.B.I. and Homeland Security agents had met him at the gate and were interviewing him at the airport. He told them that he no longer wanted to live in the United States and that he wanted to help the refugees in Turkey.

“Adam claimed that some people helped by building a house, while others picked up a gun,” Christopher Monika, an F.B.I. agent, wrote in court documents. Adam Shafi told the F.B.I. he was not going to pick up a gun. Eventually, the agents sent him home.

But days later, the F.B.I. went to the Shafi home with a warrant for attempting to support a terrorist organization — a charge that carried up to 20 years in prison — and led Adam Shafi away in handcuffs. His case was kept under seal while his family and his lawyers tried to negotiate a way out. Normally, that means a plea deal and a hope for leniency. Mr. Shafi pitched something else — a program in which counselors, mental health experts and religious leaders worked with Adam to set him straight. If all went well, Mr. Shafi hoped, his son could avoid prison and a criminal record.

Though the White House and a congressional task force have endorsed this concept, no such program exists. So Mr. Shafi tried to create one. He flew to Washington in November to attend a Brookings Institution seminar on radicalization. There he met Daniel Koehler, a German de-radicalization expert who offered to help.

“There have simply been too many cases of families who didn’t have any help,” Mr. Koehler said in an interview. “I thought back then that this could be a good test case.”

The F.B.I. has quietly and slowly embraced the notion of interventions. In a few cities, agents work with parents, mental health experts, community leaders and sometimes religious figures to help minors or mentally ill people who agents believe have the intent, but not the capability, to hurt people. Though civil libertarians — and some F.B.I. agents — are skeptical of what they see as blurring the line between social work and law enforcement, supporters say interventions are an alternative to long-term surveillance, which strains F.B.I. resources.

Law enforcement officials said they have offered interventions to only about a dozen people, and they acknowledge that it is too soon to say whether they work.

At 22, Adam Shafi was not eligible for such an intervention, but his father and lawyers remained optimistic. The government did not dismiss the idea out of hand, they said. Then came the attacks in Paris and San Bernardino, Calif. “You see these events that narrow the universe of what’s possible,” said Joshua Dratel, a New York lawyer representing Adam Shafi. There would be no deal.

In December, the Justice Department unsealed the case and prepared for trial. In court documents, prosecutors said that neither a well-intentioned father nor the threat of an F.B.I. investigation were enough to steer Adam Shafi away from terrorism. Mr. Shafi’s efforts aside, prosecutors said, his son was simply too dangerous to remain free.

The process has shaken Mr. Shafi’s faith, both in his decisions as a parent and in his government.

“Every minute, I just imagine him in that solitary confinement, facing 20 years, because I cooperated with the government,” he said, adding, “It’s a horrible feeling. I can’t get rid of it.”

Less than a year ago, he had offered to quit his job and help build support for government counterterrorism programs. His message now to parents of troubled or confused children? “Don’t even think about going to the government.”