That's been a central question around the world since the 11 September attacks on America in 2001. And it's one that some European countries are now wrestling with -- in particular Spain, which in March had Europe's worst terror attack since World War II.
"Yes, there is fear here. What I can tell you is that people are just afraid that this kind of thing could repeat itself," says Jose Manuel Suarez Robledano, a spokesman for Spain's Professional Association of Magistrates.
In response to the Madrid train bombings, which killed 191 people, Spain has struggled to find ways to clamp down on Muslim militants while maintaining respect for religious rights.
But finding a balance is no easy task, as Spanish Interior Minister Jose Antonio Alonso recently discovered.
Alonso recently proposed the enforced registration of all Muslim clergy and mosques in Spain, and the monitoring of sermons to prevent militants from preaching violence to the country's estimated 500,000 Muslims.
But his proposal was greeted with a chorus of criticism -- from the political opposition and civil rights groups as well as Spain's Union of Islamic Communities. All said it was unconstitutional and violated the civil and religious rights of Muslims.
Robledano's organization of professional judges and magistrates agreed. Robledano tells RFE/RL the interior minister's plan would amount to spying. He says that would be a violation of rights that most Spaniards would not accept, despite fears of further terrorist attacks.
In that sense, Robledano says most Spaniards would reject the scaling back of certain rights that has occurred in the United States in the name of fighting terrorism -- such as preventive detention or holding suspects at length without charge.
"Spaniards do believe that democracy needs to be protected with strong security measures, otherwise the very democracy itself could collapse. [However,] I do not believe that certain measures that have been taken in the United States would be well received here," Robledano says.
The Interior Ministry proposal appears to have retreated under the wave of public criticism. But it has spawned a heated debate that some Muslims are welcoming: How best to balance the fight against terror with respect for civil rights?
The Union of Islamic Communities rejected Alonso's proposal and said Spain's mosques are no more than places of "prayer and peace." But not all Muslims agree.
Mustafa el-Merabet, the president of Spain's Association of Moroccan Immigrant Workers, says, "The fact that a place is holy does not mean that it is impermeable to the introduction of elements, messages or people that can try to work against it and use this holy place to spread certain values that are just not compatible with democratic values."
He says that while his group does not agree with everything in Alonso's proposal, it welcomes the debate that it has spawned.
El-Merabat says his organization, which is secular, is following up the interior minister's ideas with a counterproposal of its own.
Under that plan, Spain's Muslim communities would take a pledge to reject all violence in mosques and places of worship and agree to a system of self-control led by local and national councils made up of Muslim leaders.
"The competencies of this council go from the control of the mosques and prayer centers where the faithful, the Muslims, take a lead role in rejecting violent messages, violent sermons, and that they assume responsibility as a community, as individuals, in defending the values of a democratic state," el-Merabat says.
El-Merabet points out that Spain already keeps a voluntary registry of places of worship, including more than 200 mosques. But he says that the government needs help keeping track of hundreds of other makeshift places of worship, where authorities believe Islamic militants may be inciting followers to violence.
"There is a huge number of these [prayer] centers that no one knows about. They're not in any registry. No one knows who the leaders are, what they do or what is said there," el-Merabat says.
Spanish investigators say the alleged ringleader of the Madrid bombings, a Tunisian, led prayers in one of these makeshift religious sites.
Robledano of the judges' organization says that while the government monitoring of sermons would be both illegal and impractical, authorities have every right to scrutinize people and places where they have evidence of wrongdoing.
"If, of course, people carrying out religious activities are actually engaging in a provocation or the intention of a conspiracy -- what, in the United States, is defined as a conspiracy -- to commit crimes, then this, yes, is a crime," Robledano says. "And in this case, of course, the vigilance of the police would be required, as would be [eventual] detentions."
Meanwhile, the official voice of Spain's Muslim community -- the Islamic Commission of Spain -- says it will be meeting monthly with officials to find a way to balance safety concerns with religious freedom.