Security forces and intelligence agencies are also using computer algorithms to predict the likelihood that a given person will carry out a lone-wolf attack and to intervene before it happens.
Israel says its methods are working, pointing to a sharp drop in attacks carried out largely by young, disaffected Palestinians. But those methods have generated serious questions about an erosion of privacy, freedom of speech and human rights, for both Palestinians in the West Bank and Arab citizens of Israel --- people who rights groups say are most likely to be prosecuted on vague "incitement" charges or to end up on the wrong side of an algorithm.
For many Palestinians, the knowledge that Israeli authorities are tracking their social-media activities is seen as just another level of oppression and restriction in an intractable, decades-old conflict.
In 2017, Israel arrested about 300 Palestinians in the West Bank and East Jerusalem on charges related to posts on Facebook, according to a report by the Arab Center for Social Media Advancement. Official numbers have not been made public.
From shootings in San Bernardino, California, to Las Vegas to car-ramming attacks in Nice and Barcelona, the lone-wolf attacker has presented a particular challenge to law enforcement across the globe.
In Israel and the West Bank, some 65 people, including two Americans, a Briton and members of the security forces, have been killed in lone-wolf attacks since October 2015, according to the Israel Security Agency. Human Rights Watch reports that more than 270 Palestinians have been killed either carrying out such attacks or in subsequent encounters with Israeli troops.
A new law enforcement unit that includes police and general security personnel has worked to define algorithms to detect potential attackers and inciters.
"You adapt the algorithms, and you have human resources pinpoint people even before they go out and do what they want to do," said Gilad Erdan, Israel's minister of public security, who has also pressed Facebook and Twitter to shut down accounts that are used to call for violence.
The key terms the researchers look for online change with current affairs, Erdan said, although common key references include Gaza and al-Aqsa Mosque, which stands on a flash-point holy site in Jerusalem.
According to Erdan, the number of attacks against Israelis, most of them in Jerusalem and the West Bank, has fallen by almost 80 percent. He also pointed to a study that found some 60 percent of the lone-wolf attackers between 2015 and 2017 had posted messages on social media indicating their intention to target Israel.
Roni Alsheich, Israel's police commissioner, said that in addition to key words, the algorithms track the number of social-media posts by individuals, as well their relatives and friends.
"Step by step, we form a good picture," he said. "After so many years of terrorism, there's a lot of people around them that were terrorists, which maybe had an influence."
The challenge, Alsheich acknowledged, is being able to tell whether someone is really planning to carry out an attack --- and having enough evidence to charge the person before an attack occurs.
"It's difficult because we are democratic state, so sometimes it's not enough," he said. "It's about getting more and more information and ranking, to say this guy is very serious and this guy is maybe half and half, and sometimes we can't do anything in advance because there is not enough intelligence to arrest him."
In those cases, the intelligence services may instead detain a person for questioning, he said.
At a recent security conference in Jerusalem, Prime Minister Benjamin Netanyahu praised the "tremendous algorithms" for helping to bring down the number of attacks. He described having to maintain a balance between upholding security and descending into "tyranny."
Such a balance is not apparent in the occupied West Bank, said Fady Khoury, director of Adalah, an Israeli-Arab legal and human rights organization. While the algorithms may reduce the number of attacks, he argues, they are unfairly skewed toward Palestinians' online activity, with right-wing, anti-Arab posts receiving little attention.
Right-wing nationalist Jewish groups have also complained of being unfairly monitored.
"If you arrest all men right now, you prevent most rapes, but nobody thinks that's feasible in a democratic setting," Khoury said.