It is arguably the greatest security challenge of the modern age - how to prevent "lone wolf" fanatics from committing devastating acts of terrorism.
As Canadian investigators continue their inquiries into the activities of Michael Zehaf-Bibeau, the Muslim convert who shot dead a soldier at the country's national war memorial before rampaging through the halls of the federal parliament, it is too early to say for sure what motivated him to undertake these acts of extreme violence.
But there are strong suggestions it was an Isis-inspired attack in revenge for Canada's decision to join coalition air strikes against Islamist fanatics in Syria and Iraq.
Zehaf-Bibeau had earlier had his passport removed by Canadian authorities as a "high-risk" traveller. That he is said to have raised his arms in triumph after shooting dead an unarmed reservist and wore a Palestinian-style keffiyah during the attack all point to an act of Islamist-inspired terrorism.
Coming so soon after another isolated attack this week, in which another radical Muslim convert killed one soldier and injured another in Quebec before being shot dead by police, the Canadian authorities have every right to suspect this was a jihadist terrorist attack on the heart of government.
The challenge they now face is to establish whether Zehaf-Bibeau was acting on his own initiative, or on instructions received from an Islamist terrorist mastermind based in Syria or one of the many other "liberated" territories Islamist militants have established in the Arab world.
Isolated acts of terrorism can take many forms, such as the self-styled Unabomber, who engaged in a nationwide bombing campaign in the US in the 1990s as a protest against the evils of modern technology, or the massacre of young Norwegian Labour activists in 2011 carried out by right-wing extremist Anders Behring Breivik in protest at Oslo's immigration policy.
These are equally difficult for the security authorities to prevent unless they are given warning that an individual's extreme eccentricity could lead them to commit acts of mass murder. Intelligence officials on both sides of the Atlantic are becoming increasingly concerned that radicalised young Muslims are being encouraged to carry out lone attacks rather than work together on more complicated plots, such as the September 11 attacks against the US or the July 7 suicide bomb attacks in London in 2005.
Intelligence chiefs have warned that NSA whistleblower Edward Snowden has made the job of monitoring the activities of Islamist terror cells more difficult, as his disclosures have provided al-Qaeda and its affiliates with clues as to how terrorists are targeted.
But Scotland Yard's recent disruption of an Islamist terror cell that was preparing to carry out gun attacks at military targets in London similar to Zehaf-Bibeau's in Ottawa suggest the security services still retain the ability to track the activities of high-value targets.
Monitoring individuals is more problematic. This week's attacks in Canada seem to have been taken straight from the al-Qaeda manual, which urges followers to kill "a disbelieving American or European" whenever the opportunity arises.
The murderers of Fusilier Lee Rigby in Woolwich in May 2013 were said to have been encouraged to carry out the atrocity by reading Islamist propaganda on the internet, and Metropolitan Police Commissioner Sir Bernard Hogan-Howe has warned about the threat to British security posed by the five or so young Britons said to be travelling to Syria each week to join the call for jihad.
Many will return home having been exposed to the hard-line Islamist ideology of groups such as Isis. Alternatively, many others will be radicalised simply by listening to the sermons of radical Mullahs. And so long as the Mullahs continue to pump out their poisonous rhetoric, there will always be impressionable young Muslims willing to commit random acts of violence. The Daily Telegraph