Could Kenya have prevented the hotel siege?
The deadly militant raid on a hotel complex in Kenya has raised questions about whether the security forces have learned any lessons from past terror attacks, including the four-day siege on the Westgate shopping centre in 2013.
These days individuals and vehicles entering any major public premises in Kenya usually have to go through checks by private security companies involving a range of tools - metal detectors, X-ray machines, bomb detectors and sniffer dogs.
Though Kenyans have varying opinions about how seriously the security personnel take this process.
One place where they would be expected to be conscientious is the scene of the latest attack, the complex that includes the DusitD2 hotel, known by its address: 14 Riverside.
It is home to a variety of businesses and a major hotel which was frequented by professionals, government officials and foreigners. In other words, the kind of location that the Somalia-based militant group al-Shabab would target knowing that the world would notice.
Yet however strict the security measures and however conscientious those enforcing them are, there is only so much the building owners can do to secure their property and clientele, as Tuesday's events highlighted.
The main responsibility lies with the Kenyan authorities.
Most of the recent al-Shabab attacks on Kenyan soil have been around the border with Somalia, which appeared to feed a semblance of control and stability in the rest of the country amid a lingering threat.
This however assumes that al-Shabab always plans its major actions in Somalia.
Risk analyst Mathias Muindi thinks that this latest attack has signs that there was some level of preparation by Kenyan militant cells.
"The evidence collected about the attack suspects has revealed links to parts of Kenya that are traditionally non-Muslim and non-Somali, where security agencies may not have previously paid much attention," he says.
"The problem now is that they do not have the adequate manpower to run an expanded and robust nationwide intelligence operation."
Who are al-Shabab?
- Emerged in Somalia after the collapse of Islamic Courts Union in 2006
- Linked to al-Qaeda
- Battle the UN-backed government in Somalia
- Impose a strict version of Sharia in areas of Somalia under their control
- Have launched attacks in Kenya and Uganda - both countries have troops in Somalia
The quality and effectiveness of the government's anti-terror efforts will be scrutinised yet again - in particular whether crucial intelligence from local and foreign sources is acted upon.
Kenyan intelligence officials argue that over the years they have had successes intercepting some suspected militants, potentially preventing more attacks and proving that they are making progress.
They add that it has been nearly four years since the attack the university campus in the town of Garissa and more than five years since similar attack in the capital, referring to the Westgate siege in 2013. The suggestion is that such incidents are not the norm.
Clearly, some lessons were learned from Westgate.
The scale and depth of the emergency response - police and military counter-terror units, foreign security personnel, ambulance and fire brigade - that arrived at 14 Riverside showed organisation, in contrast to the shambles five years ago.
Security agents arrived relatively quickly and showed composure as they evacuated civilians and screened them before letting them go, to be sure that the attackers did not slip out unnoticed.
However, there were still some worrying lapses.
'Training is not enough'
Security officials delayed enforcing a strict security cordon, meaning that there could have been more civilian casualties if there had been further explosions, a tactic al-Shabab has used in Somalia.
A suspicious vehicle in the car park that security agents thought could have been used by the attackers remained unattended. Footage also showed an unexploded grenade lying in a corridor of one of the buildings as security agents shuffled in and out a few feet away.
More on the hotel siege:
- The victims of the Kenya hotel attack
- 'How we survived Kenya hotel siege'
- In pictures: Attack in Kenya's capital
- 'Our deaths are displayed for consumption'
There are wider issues to consider too for Kenya's security chiefs.
"There is a lot of spending on training the security forces yet we only see limited effects because their welfare is poor," says George Musamali, the director of a private security firm.
"Training is not enough. Equipping is not enough. Something needs to be done about human resource to make sure that these people are fully motivated to do their work properly."
He also calls for a better channel of communication between the government and the public, not just in the aftermath of attacks but as a norm so that intelligence from the civilians can be properly gathered and used.
The government responded to this week's attack by using a familiar tactic: downplaying the impact of al-Shabab's actions.
This is part of an active effort to control the narrative and win the propaganda war that has accompanied this insurgency.
Kenyans were warned against sharing gruesome images from the attack and on Tuesday evening Interior Minister Fred Matiang'i announced that the affected buildings had been secured and security forces were mopping up the area.
But this came as members of the public were reporting that their friends and relatives were still in the complex hiding from the attackers.
Mr Musamali feels the government's tone only pushes away the public and loses their trust.
The government is up against a group that has arguably the most advanced media operation of any militant Islamist movement in Africa, including established radio and digital outfits.
It often films its attacks in Somalia, including the devastating assault on a Kenyan army base in the town of el-Ade exactly three years to the day of this week's attack. Some of its media material is produced in Swahili, clearly targeting audiences in Kenya, revealing its cross-border ambitions.
The threat will not go away in the short term and changes still need to be made.
Andrew Franklin, a Nairobi-based security consultant and ex-US marine, says it is clear that the government's security agencies and the many private security companies are not working together enough "and that is evident in the obvious security glitches around Nairobi".
Yet again, Kenya has suffered a big loss and as its people come to terms with this week's events they will wonder why it has to take catastrophe for more lessons to be learned.