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.

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.

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.

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.

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.