The former chief of staff for a Canadian prime minister says it's a complicated and expensive job trying to protect high-profile politicians like Mayor Naheed Nenshi.

The Calgary mayor recently acknowledged that he faces racist attacks "almost every day." He made the remarks after a local school trustee candidate received a death threat on Facebook.

Ian Brodie says he had to deal with a constant barrage of threats against former Prime Minister Stephen Harper. Brodie is now an associate professor in the Centre for Military, Security and Strategic Studies at the University of Calgary. The following is an edited transcript of an interview with CBC's Silvana Benolich.

Q: How challenging is it to protect someone who is so high profile? Our mayor is a local figure, you could say he's a national figure too. How difficult is it to do that?

If you could put the mayor in a box and lock him in the building with access to no citizens, it's easy. The difficult part is to balance it out with — he's a public figure, he wants to be out meeting citizens and citizens want to be out meeting him. If you are in a completely uncontrolled environment, an open space like a park, where you can't control who is coming and going in a space, that's an extremely difficult situation to deal with.

In the case of the prime minister, we tried to make sure he was indoors, in an enclosed space. We tried to make sure, even if it was a public event, that we had tickets so we could see the names of the people who were coming to make sure they could be screened ahead of time. And then we had access controlled to the space. We also wanted to make sure always that the prime minister could get out of a space quickly.

Calgary Mayor Naheed Nenshi takes a selfie with people attending the city's Comic and Entertainment Expo in 2014. A mayor should be out meeting citizens, says U of C associate professor Ian Brodie. (@nenshi/Twitter)

Q: So you can't put (Nenshi) in a cocoon. What would you do if you were his chief of security?

First of all it's very expensive. In the United States… all sorts of people are trying to make a scandal out of this. But it's the price of having a government and an elected political leader who is out and about with citizens. I always grind my teeth at those (news) stories because it is expensive. It depends on dozens and sometimes hundreds of protective officers. These are police officers who are trained to be able to anticipate situations and get the prime minister or the mayor out of harm's way as quickly as possible if something happens. And constant vigilance of social media, newspaper threats, incoming mail.

Q: Given that the mayor says he receives almost on a daily basis threats – racist threats in particular – do you have any idea if he has enough personnel or resources to deal with that sort of threat?

A: You are never quite sure. The nightmare scenario is something like the Stampede parade. You know where the mayor is going to be, you know basically when he is going to be in the parade. He's going to be exposed in front of thousands of people going through the middle of downtown. There's thousands of places for people to hide if they want to cause trouble. And if something goes violent, there's thousands of other people at risk.

Calgary Mayor Naheed Nenshi rides a horse during the Calgary Stampede parade in Calgary last month. Such events are a "nightmare" in terms of security, says Brodie. (Jeff McIntosh/The Canadian Press)

I've always found for those sorts of big public events — the local police, the Alberta sheriff, the RCMP — they have extremely good plans for that sort of thing. But those are extremely difficult and expensive events to prepare for. But for day-to-day events, if there is a specific threat, you don't say where the mayor is going to be too far in advance. That's difficult too though. You want to let citizens come and speak to the mayor, speak to other members of city council.

Q: The mayor is acknowledging an increase in the number of hate-type attacks… Is that something you are seeing?

A: The difficulty is with easy access to social media, with Twitter and Facebook and so on and so forth, is to judge how serious a particularly racist comment on somebody's Facebook page or a threatening Tweet, how much is that a real threat that police and protective officers should be taking care to keep track of?... Nobody wants to be subjected to a racist or other offensive comment on their Facebook page and there's no excuse for that sort of thing. At what point does that become so serious that you have to protect a candidate for political office, because they should be protected too.

Q: That sounds like it's a real challenge. How do you ferret out whether a threat is benign or credible?

A: Yes, this is where police and intelligence agencies are able to keep track of people's comments on all sort of public forums to kind of judge — is this one person's first comment they have made or is part of a pattern of comments they are making elsewhere? Are they part of a group or do they have access to someone who can help them mount an attack, or take some more active step? That's the difficult part of the policing and intelligence function that's a constant 24-hour-a-day struggle.