Editors’ Note: The perpetrators of the Paris attacks want a response that inspires more violence and creates more fear and division. A handful of thugs with automatic weapons can never truly threaten a great nation like France, Jeremy Shapiro writes—only the wrong response can do that. This post originally appeared on Slate.

The mind reels at the horror of the Paris attack. The body politic demands a response. And so a response it will have. Unfortunately, if experience is any guide, that response will be borne more of anger than of wisdom.

This is very understandable, even natural. But even in this moment of pain, we should understand that such a reaction is the intent of the attack. The purpose of terrorism, a weapon of the weak, is to goad the strong to lash out. The perpetrators want a response that inspires more violence and creates more fear and division. As the dramatic outpourings of solidarity demonstrate, a handful of thugs with automatic weapons can never truly threaten a great nation like France. Only the wrong response can do that.

Measured responses to terrorist outrages are alas rare. In times of national trauma, politicians will not even dare utter words of restraint lest they be swept up in the righteous anger gripping the populace. Civil liberties are curtailed, and wars are waged that often have little relation to the threat at hand. Generally, there is—much later—a period of national reckoning when the sins of the moment of crisis are both expiated and forgiven. But nations, like teenagers, seem unable to learn from others’ experience and anticipate such consequences in their rush of emotion.

Measured responses to terrorist outrages are alas rare.

In a way, France should be well-placed to avoid that well-trod but sorry path following Friday’s attacks. The French have often looked back over the long arc of American counterterrorism errors and excesses—from Guantánamo, to the war in Iraq, to the torture scandal—and congratulated themselves on their relative prudence.

This self-perception ignores some of the ugly history of counterterrorism in France itself, but it does accurately reflect a remarkable process of learning. France has long been on the “bleeding edge” of terrorism, confronting the menace in all its guises—from bomb-throwing anarchists, to transnational Islamist networks, to lone wolf madmen. In the process, a succession of failures and scandals, particularly in the 1960s and ’70s, taught French policymakers a few hard-won lessons that will hopefully be applied again today.

First, terrorism is a permanent problem that can only be managed, not solved—more akin to fighting crime than waging war. As such, counterterrorism measures must also be permanent and consistent with the values of French democracy. In the 1960s, the French responded to terrorism emanating from Algeria by establishing an emergency State Security Court. Similar to the military tribunals in the United States after 9/11, this court was composed of military officers, held its proceedings in secret, and had no provision for appeal. It was often seen as an instrument of political oppression and after many scandals was abolished when a new political party took power in 1981. When a new wave of terrorism appeared in the mid-1980s, the French had to relearn how to fight terrorism. This time they created a permanent and separate judicial branch, within the normal system of French justice, which focused exclusively on terrorism and was able to fuse the surveillance capacities of French intelligence and the investigation capacities of French magistrates. Over time, they developed an impressive capacity, unique to France, to understand and anticipate the actions of terror networks trying to operate in France. The lesson was that emergency measures that responded to an immediate crisis but sacrificed treasured democratic ideals would ultimately prove unsustainable and counterproductive.

[T]errorism is a permanent problem that can only be managed, not solved—more akin to fighting crime than waging war.

Second, terrorism needs to be fought more at home than abroad. France, like all nations, would prefer to think of terrorism as problem that emanates from overseas and can be stopped far from the nation’s shores. In the 1980s, France responded to terrorism from Lebanon with retaliatory attacks in Beirut and Damascus, Syria, and eventually by sending ground forces to Lebanon. But this did little to improve their terrorism problem, and they soon had to bring the fight against terrorism home. France lacks the power to go abroad to address the root causes of Middle Eastern conflicts and Islamist extremism. Geography and globalization mean that isolating France is simply impossible. Securing the homeland is really the only path to greater safety.

Finally, a successful attack does not indict this entire approach to counterterrorism. Every failure requires an understanding of what went wrong. But France has developed a broadly effective system for dealing with terrorism and has a long record of success doing so. France has long been a primary target of extremist Islamist ideology, with numerous threats to France emanating from al-Qaida and other groups. But until earlier in 2015, there had been a notable lack of successful attacks over the past 20 years, especially compared with many of France’s neighbors. During that time, French authorities claim that dozens of networks had been broken up and plots averted, including planned terrorist attacks on the FIFA World Cup, the Strasbourg Cathedral, and the American Embassy in Paris. But to say that the problem must be managed is to accept that even the best counterterrorism system will sometimes fail to stop attacks.

Unfortunately, there is substantial reason to doubt that the French politics of the moment will allow these lessons to guide the nation’s response to Friday’s attack.

The question of Muslim integration and immigration had already become arguably the central issue in French politics. The far-right National Front party will no doubt seize this opportunity to turn renewed French fears of violence by Muslims and cultural resentment against Muslim communities into gains in the upcoming regional elections.

This political reality will put enormous pressure on the government to react quickly and forcefully, to create emergency measures, and to lash out abroad to satisfy the public anger: Essentially, to ignore the lessons of the past. The rapid French airstrikes on ISIS targets in Syria may well be a harbinger of things to come. Experience implies that they will not inhibit ISIS’s capacity to launch such attacks, and may increase their incentive to do so.

The question of Muslim integration and immigration had already become arguably the central issue in French politics.

So how should France respond to such an outrage? There are no easy answers and much depends on the specifics of the Paris attack that we do not yet know. But it has long been clear that the French intelligence and counterterrorism organizations are stretched thin. Keeping an eye on suspects is enormously expensive both in terms of manpower and money. Recent successful attacks, such as the Charlie Hebdo attack in January 2015 and the attack on the Jewish Museum in Brussels last year, were not so much intelligence failures as surveillance failures. Previously identified suspects had simply slipped too far down the priority list to merit the use of scarce resources. Counterterrorism surveillance is something the French authorities know how to do—it does not require new powers or more restrictions on civil liberties. But they will likely need significantly more people and money to provide their previous level of protection.

It is also certain that France needs better cooperation with its European neighbors. Cooperation has improved greatly in recent years. But there remain wide differentials in capacities, and national security services remain more focused on their own problems than on ensuring the safety of their neighbors. Logically, this implies a greater role for the European Union in establishing standard best practices, in coordinating and even in directly fighting terrorism. But there is little enthusiasm for that among national authorities who distrust the counterterrorism competence of Brussels or among national publics who blame the EU for a host of ills.

Such unsexy efforts to increase intelligence budgets or improve cross-national bureaucratic cooperation, more than airstrikes in distant lands, are the heart and soul of counterterrorism in Europe. They could go a long way to protect France from further attacks, even if they might provide little solace to a wounded, angry, and divided nation.