BERLIN—Of the countless memorials testifying to Germany’s legacy of concentrated security and unchecked surveillance, the Stasi Museum in Berlin is one of the more explicit. Emerging in 1950 as the security arm of the German Democratic Republic, the Stasi earned particular infamy over its nearly four-decade existence for the spying operations it conducted on its own citizens, and how it wielded that intelligence to control people’s lives.

Located in the Stasi’s former headquarters in Berlin, the museum reinforces the deep wariness many Germans still feel toward their security services. The building’s three floors are now stuffed with objects and reminders of the activities once planned within its walls: shopping bags that disguised hidden cameras, and exhibits on more mundane tasks agents carried out, including redacting suspicious lines from outgoing letters. An unattributed quote runs across one display: “Comrades, we have to know everything.”

The country’s federalized security system, unique among major international powers, is another symbol of those fears. Initially conceived during Germany’s post-war Allied occupation and later extended across a reunified country after the GDR’s fall, the system devolves police powers primarily to the 16 states, and establishes firewalls between the different security and intelligence services.

Dr. Tobias Bunde, who teaches at the Hertie School of Governance in Berlin, said that Germans view the system as critical to curbing the overreach of modern intelligence services, and as a critical safeguard of the open society that is now core to their political identity. “They’re really two sides of the coin, in a way,” he said. “Many people here say, ‘We don't want to live in a society that restricts civil liberties. Let's be very, very careful if someone proposes a tighter security apparatus and anything that looks like a less liberal version.’”

The result is a system that reflects Germany’s historically rooted anxieties. But the December terrorist attack on Berlin exposed that this system may also be ill-equipped to deal with the threats of today. The investigation into the attack, where 12 people died when Anis Amri, a Tunisian national, plowed a lorry through a popular Christmas market, exposed the tensions German Chancellor Angela Merkel is attempting to navigate between protecting civilians and preserving their civil rights. The failure to detain and deport Amri, who died in a shootout with Italian police four days after the attack, highlights where that effort has fallen short.

Amri, suspected of entering Germany in the summer of 2015, moved around the country using different aliases. Though he had a prison record in Italy (believed to be his entry point into Europe), and was eventually linked to radical Islamists in Germany, poor coordination between various state and national agencies made him difficult to track. When he eventually came under surveillance last March, officials were unable to gather enough evidence to prosecute him and the probe was eventually dropped, according to the Berlin Public Prosecutor’s Office.

Amri did remain on the radar of the German security services; The Wall Street Journal reported that officials had met seven times to discuss his activities. Authorities even rejected his asylum claim in June, but were unable to deport him because he lacked a passport and Tunisia would not confirm his citizenship. (Documents confirming his identity, which would have paved the way for his deportation, did not arrive from the Tunisian government until two days after his strike on the Christmas market.)

Soon after the attack, right-wing nationalists moved quickly to pin the blame on Merkel's open-border refugee policy and to exploit the heightened security concerns it has generated, despite the fact that Amri apparently arrived in Germany before Merkel introduced the initiative in August 2015. More than one million asylum seekers have made their way to Germany since Merkel eased entry restrictions in response to the European refugee crisis. While the move earned her plaudits around the world, her popularity on the home front has dipped amid the rising security concerns.

Following the Christmas market attack, the leadership of the anti-immigrant Alternative for Germany (AfD) called the victims, “Merkel’s dead.” Some of her allies responded to the attack with demands for migration and security reforms, while domestic intelligence officials acknowledged the risk of terrorists hiding among the new arrivals. Others defended the state’s efforts within the confines of current security laws. “I think security authorities went to the maximum limit of our state of law. They did everything they could and were allowed to do,” Ralf Jäger, the interior minister of North Rhine-Westphalia, where Amri lived briefly, told The Wall Street Journal.

Ahead of elections later this year, members of Merkel's government have sought to stave off criticism from nationalist opponents with targeted proposals to expand the state’s security capabilities, including using ankle bracelets to monitor people thought to be a security threat and granting the state broader detention powers for asylum seekers. A list of sweeping proposals offered by the Interior Ministry and backed by Merkel also call for centralizing the intelligence services and strengthening a federal police force that, under current law, is only allowed to operate in transportation hubs and near borders. Though the proposals must still be approved by parliament, security services have already stepped up their activities, introducing a new tool to analyze terrorist threats and conducting a raid on 50 sites last week.

But that operation netted only one arrest, and added to the antipathy the proposals have drawn from some circles. The general secretary of the Social Democrats (SPD), Merkel’s coalition partner, has dismissed the “knee-jerk calls” to tighten security laws, as part of a broader outcry against increasing surveillance and centralizing security.

Meanwhile, Merkel’s government has stuck with its open-door policy. This response—holding the line on a liberal refugee program and patching up the gaps that Amri exploited—bears all the hallmarks of the her customary pragmatism: Without blunting her stance on refugees, she aims to tout policies designed to counter the terrorist threat in the run up to the September vote, depriving the AfD and other opponents of a potential cudgel.

Given the political sensitivities over domestic security, Merkel will have to tread lightly. A massive overhaul proposed under her predecessor failed, and earlier incremental reforms under her government were heavily contested. In a society constantly confronting its own legacy, the new round of proposals may backfire. Fears of the surveillance apparatus were “always the explanatory variable against [reform],” Thorsten Benner, the director of the Global Public Policy Institute in Berlin, told me. “Imagine a GDR or a Nazi state with today’s surveillance apparatus.” Now, Benner said, “People actually want a complete government that has these powers, that can go after bad guys.” If Benner is right, this is a dramatic shift: the fear of another terrorist attack may be so great that Germans are willing to part with key elements of their open society.

Even those who are quick to recall the country’s dark history acknowledge that it may no longer retain its emotional purchase. “As a history professor, I’m part of that elite reinforcing that agenda of [having] no national security state,” Dr. Siegfried Weichlein, a professor of German history at the University of Freiburg, told me. “In every family, you’ll find memories of that—of murder, of being jailed for nothing, being thrown out of university for trumped up charges. The education system reinforces this and rightly so. On the other hand, when I look at my kids, it doesn’t really mean a thing to them.”

Both sides of this debate are keenly aware that Germany may be dismantling these checks, just as right-wing nationalism experiences a renaissance. Of course, while virtually no political pundits predict the AfD will score well enough in September to take over the government—the party continues to hover at around 15 percent in polls—with the unexpected outcomes of recent votes in Britain and America, there are no guarantees. The AfD may not seize power, but it could well earn seats in the national parliament for the first time.

Meanwhile, Donald Trump's unpredictability throws America’s intelligence sharing relationship with Germany into question. Intelligence secrets leaked by Edward Snowden in 2013 revealed a long history of collaboration between the U.S. National Security Agency and the German intelligence services, inspiring outrage in Germany over the government’s eagerness to embrace surveillance methods the country’s history seemingly warns against. The current circumstances may blunt those concerns.

For the academics and civil society activists who fear even a gradual erosion of Germany’s open society, proposals that expand the reach of the state smack of overreach. Yet Jörg Drieselmann, the managing director of the Stasi Museum, welcomes this debate. Arrested at the age of 19 by the Stasi when a colleague reported him for storing an anti-government sign at their workplace, he spent the better part of a year in prison before being expelled to West Germany. He became a political activist until the Berlin Wall fell, and was recruited to help assemble and then run the fledgling museum.

The lesson he hopes the museum imparts is, surprisingly, not to fear state security. “What I imagine is a public discussion of to what extent we are ready to diminish individual freedom in order to protect our lives,” he said. He is not sure whether the country’s well-guarded civil liberties will emerge intact from the current debate. Or if they even should.

Drieselmann sees little point in holding Germany hostage to a fear of what the security services might become under a future administration. He has faith that, under the current system, it is safe to support the government’s request for security reforms and, if they eventually become unnecessary, that there will also be an opportunity to roll them back.

“We have to accept that the good old days are gone,” Drieselmann said. “We have to take care of ourselves. It’s like walking on a blade to find a balance between security and freedom. We have to negotiate every day to what extent we accept a lack of freedom.”