A handful of hastily written emails spread shock waves across the United States last month. The threats were familiar, warning of gunfire, backpack bombs and mayhem in schools across New York and Los Angeles. The messages were routed electronically through Germany, but the author’s whereabouts are still unknown.

The two cities responded in dramatically opposing fashion. The Los Angeles Unified School District shut down more than 1,000 facilities, preventing over 640,000 children from attending class. Officials said that more than 1,500 buildings were searched and that police patrols would be expanded throughout the week. The price tag is estimated at around $50 million.

Meanwhile, New York authorities swiftly dismissed the threats as a hoax. Their snap assessment was made possible by massive investments in counter-terrorism capabilities since the devastating 9/11 attacks. New York's tough talking police chief said the sender probably indulged in too many episodes of the popular television drama, Homeland.

While publicly chastised by New York's mayor for over-reacting, the Los Angeles authorities’ can hardly be faulted for taking the terrorist threat seriously. The anonymous warning came on the heels of a brutal massacre of 14 people in San Bernardino earlier this month, less than 50 miles from LA. It turns out that counter-terrorism experts had been expecting attacks for months.

More and more cities are being held hostage to the threat of terrorism. In Europe, New Year fireworks and festivities were cancelled in Brussels because of a terror alert, while Munich evacuated two major railway stations on 1 January after an intelligence agency warned of an imminent attack.

The sense of unease in the US is palatable. In just the past few weeks, copycat threats were issued in Washington D.C., Miami, Fort Lauderdale, Houston, and Dallas. In New Hampshire, 17 schools were closed due to emailed threats sent to a single school.

Alerts issued by US Homeland Security – including last month's unprecedented warning of “self-radicalized actors who could strike with little or no notice” – are seldom accompanied with specific information. And with law enforcement agencies bogged down with dozens of warnings a day, the probability of more devastating attacks is growing.

Prank or not, the consequences of foreign and domestic terror are spectacularly costly. That is of course the point. Yet for many people there is wary resignation: urban terrorism is the new normal. They have a point. Reported terrorist events have skyrocketed in recent years. In the U.S., a new study documented a 158% increase in the number of threats to schools in 2014. More than a third of these were sent electronically and resulted in evacuations and shutdowns.

Cities are on the frontline of 21st Century terrorism. Islamist fanatics and right-wing extremists can literally email, post or phone in their threats. Counter-insurgency specialist David Kilcullen believes that cities themselves are under assault. “The goal is to shut [cities] down for as long as possible, separate people from one another, break down communities, and push them into mental fortresses,” he said. The result is that different ethnic and religious communities stop trusting one another and are more susceptible to exploitation.

Notwithstanding a recent surge in asymmetric threats, North American cities have a lengthy history of terrorism. Los Angeles was rocked by home-made bombs back in 1910 and parts of Manhattan´s Wall Street were decimated by a wagon-full of explosives in 1920. The single deadliest act of domestic terrorism in U.S. history occurred in Oklahoma in 1995. With the exception of 9/11, the vast majority of violent attacks in the U.S. are homegrown.

Western European cities are even more accustomed to the threat of terrorism. Well before the ascendance of Al Qaeda and the Islamic State, Londoners, Madrileños and Romans were battered by Ireland's Republican Army (IRA), the Basque separatist group Euskadi Ta Askatasuna (ETA) and Italy's Nuclei Armati Rivoluzionari. According to the University of Maryland´s Global Terrorism Database, there were more than 16,000 terrorist attacks in Europe over the past 45 years, most of them occurring during the 1970s and 1980s.

It is easy for Westerners to forget that the vast majority of terrorist actions occur in less well known cities far from the media headlines. A recent study of more than 1,300 cities ranked Baghdad, Mosul and Ramadi as the most terrorism-prone settlements on the planet. It also showed that Afghan, Egyptian, Libyan, Nigerian, Pakistani, and Somali cities are far more vulnerable to devastating violence than their counterparts in the United Kingdom, France or the U.S.

Consider the numbers. Between 2000 and 2014 there were 3,659 terrorist-related deaths in all Western countries combined. By way of contrast, there were 13,076 terrorist-related fatalities in Iraqi cities in 2014 alone. Cities in the Middle East, Africa and South Asia arguably have considerably more experience dealing with foreign and domestic terrorists than those in North America and Western Europe. So what are the take-away messages for city planners?

While obvious, there is no one-size-fits all response to urban terrorism. Preventing attacks by so-called “lone wolves” or "sleeper cells" in the U.S. requires a very different set of tactics than those used to counter sophisticated networks of highly-trained operatives in an active war zone like Yemen. In cities like Mosul, Mogadishu or Mumbai, terrorists are fielding highly elaborate operations and weaponry. Their goal is to deny the government's ability to secure the city for as long as possible.

With the goal of shutting shut cities down, terrorist groups frequently target “soft” targets where people are most likely to gather, like the recent Istanbul bombing, which took place in the Sultanahmet district, near the famous Blue Mosque, or the Jakarta attacks, which took place in a busy commercial area.

Extremist groups such as Al Qaeda, Al Shabaab, Boko Haram and Islamic State are expert at separating different population groups from one another. They then exploit this alienation to violent effect. By bombing street markets, transport hubs, sports stadiums, theaters and police stations, they force people indoors. According to terrorism expert John Sullivan, this amounts to physical and psychological siege.

More and more cities are designing-in resilience to counteract urban terrorism. Common procedures include extra layers of police surveillance in crowded spaces and the re-routing of traffic away from critical infrastructure. Other measures include unobtrusive adaptations and reinforcements to city landscapes to reduce blast exposure, physical barriers around government offices and major businesses in order to restrict access to would-be attackers, and the appointment of counter-terrorism advisers. The goal is to minimize risk without choking city life altogether.

Positive police-community relations are also widely acknowledged as an essential feature of counter-terrorism strategy. This is not about deploying more officers on the street, but rather investing in strengthening their cooperation with local residents. Kilcullen has observed how in many slums and degraded areas of Mumbai, Paris and Gaza, “locals simply don't trust the police – and often for good reason”. Until the mood changes, potential terrorists will find safe haven.

In the meantime, technology firms are lining-up from Baghdad to Boston to equip city authorities with the software and skills to disrupt foreign and domestic terrorism. Today there are more than 75 data fusion centers in major urban centers in the U.S. sharing information between federal, state and municipal agencies. Crime forecasting programs are increasingly routine. The Los Angeles Police Department has used predictive policing algorithms to positive effect since 2013. According to one company´s website, the LAPD is mapping historical crime trends to predict where future incidents might occur.

Cities are also shoring-up their intelligence and counter-terrorism arsenal. For example, New York recently launched a controversial cyber intelligence unit that taps into conversations of potential Jihadi recruits. Advanced electronic surveillance systems are commonplace from city air terminals to city streets. There are growing concerns from civil liberty specialists about how some of these measures confuse lines of authority, undermine privacy legislation, and militarize law enforcement. The real question, according to Kilcullen, “is how to make a society more resilient in a way that does not destroy our way of life in the city”.

A new generation of social media monitoring systems is also held up as another front against urban terrorism. The idea is to track millions of Facebook, Twitter, Youtube and Instagram feeds to detect would-be perpetrators who might telegraph their intentions. According to Gary Margolis, the CEO of Social Sentinel, a threat awareness group focused on schools, “each threat needs to be surfaced and addressed in the context of the public safety officials existing programmes. Alert services can augment the existing safety and security plans within schools, municipalities, and those responsible for protecting critical infrastructure."

There are clearly limitations with what physical, policing and technological enhancements in cities can achieve. Not every bit of critical infrastructure can be made blast-proof. The introduction of more CCTV cameras in a city like London or Nairobi may help with investigations, but they won´t necessarily prevent new attacks from taking place. Or will they? French railway authorities are planning to roll out up to 40,000 new security cameras that are designed in genuine Orwellian fashion to track would-be terrorists by monitoring excessive body temperature and signs of anxiety.

The truth is that there are not many examples of cities getting it right. Urban authorities are grappling with fast changing environments. In extreme cases such as Baghdad, metropolitan officials are applying the urban tourniquet of gated communities. In Tel Aviv, city residents are simply getting used to a heightened threat environment.

For the former advisor of the mayors of New York and London, Martin Powell, the strategy is straight-forward: “invest in good planning and coordination, actionable intelligence and strategies to harden targets." While dull, these strategies deliver results: the New York Police Department claims to have disrupted at least 16 terrorist plots since 2001. London says it foiled seven terror plots in October alone.

If cities are going to get to grips with these threats, they also need to think further ahead. Kilcullen is convinced that mayors and police chiefs may need to start normalizing the threat, investing in both prevention and consequence management. Businesses must regularly update their continuity plans and governments must improve their inter-agency communications to separate the signal from the noise. What is more, urban planners and private businesses would also be wise to invest in progressive urban planning, especially social inclusion and cohesion building in lower-income and marginalized neighbourhoods.

An inescapable conclusion is that city dwellers around the world will need to get used to the new normal. Governments cannot be expected to foil every terrorist plot. The trick is not to lock cities down, introduce mass surveillance and strangle the city. There is a temptation to erect barricades and build higher walls after each high profile terrorist event. Urban planner Richard Florida worries that “this could create a debilitating culture of fear”. What is needed is the empowerment of urban residents who, with the help of proactive police and new technology, can assume a more central role in preventing terrorism.

Author: Robert Muggah is the Research Director of the Igarapé Institute in Rio de Janeiro, Director of Research and Policy for the SecDev Foundation and a member of the World Economic Forum’s Global Agenda Council on Fragility, Conflict and Violence. He delivered a TED talk on fragile cities in 2015. He is participating in the World Economic Forum’s Annual Meeting in Davos.