HIS last Facebook post was perhaps the only clue of Raed Jaradat’s yearning for vengeance: it showed a Palestinian teenager lying dead with her headscarf soaked in blood and the message “Imagine if this were your sister.” Dania Irsheid, 17, had been shot by Israeli security forces in October 2015 at the entrance to the Ibrahimi mosque (Jews call it the Cave of the Patriarchs) in Hebron. Police said she had tried to stab Israelis; Palestinian witnesses say she was unarmed.

The next day Raed, a 22-year-old accounting student from the town of Sair, near Hebron, went to a checkpoint nearby and stabbed an Israeli soldier in the neck before he, too, was shot dead. Later his 19-year-old cousin, Iyad, was killed during stone-throwing clashes with Israeli troops. Raed and Dania had never met but, at his funeral, their fathers said their children should be married “in Paradise”.

Such is the rhythm of the Palestinian “stabbing intifada”. Since its outbreak in late 2015, there have been hundreds of knife and car-ramming attacks against Israelis. If the violence has ebbed, it may be in part because the Israel Defence Forces (IDF) have become better at forestalling attacks. Israeli spooks reckon they have lessons to offer Western countries struggling to stop lone wolves.

One is that conventional intelligence organisations, even Israel’s well-honed system, are designed to penetrate organised terrorist groups, so they struggle to spot imminent attacks by self-radicalised individuals or small groups. After reviewing the profiles of scores of attackers, IDF intelligence officers found they often acted on the spur of the moment. They were rarely linked to militant factions, and were not especially religious or poor. Many had a grievance: a son who felt unjustly treated, a brother who was disinherited, a bride who was beaten by her husband, and so on.

Sometimes they were teenagers bullied at school who wanted to be admired as “martyrs”—Clark Kent becomes Superman, as one officer put it. Often they were so inept that they appeared to be trying to commit “suicide by IDF”. And, as with teenage suicides, there was a pattern of copycat attacks, or at least a tendency of those close to a “martyr” to seek revenge. In Sair, for instance, 13 people have died since 2015 in attacks on, or confrontations with, Israelis.

These days IDF algorithms monitor the social-media accounts of young Palestinians to look for early-warning signs. These include “tripwire” terms such as the “sword of Allah” or “day of the sword”, associated with the writings of past attackers. The IDF also monitors the activity of relatives, friends, classmates and co-workers of recent “martyrs”.

The parents of those deemed suspicious might receive a telephone call or a visit from the Shin Bet security service, and their names could be passed on to the Palestinian Authority. Their phones are tracked to see if they meet other suspects, or leave their districts to move towards potential Israeli targets. In such cases, security forces detain the suspect.

How much of this could be applied in the West? Perhaps not much. Israel holds millions of Palestinians under occupation. Its security barriers restrict their movement and keep them segregated. The army can seal off restive areas, enforce curfews and impose punishments, such as the demolition of homes. In contrast, most Muslims in the West move and mix freely as full citizens. Israeli-style ethnic profiling and ubiquitous electronic surveillance would be neither possible nor desirable.

Still, cleverly fusing clues from social media with other information might help, as could early intervention to steer suspects away from possible violence. That means keeping would-be attackers online, where they can be watched.