After migrants were blamed for scores of sexual assaults during New Year’s celebrations in Cologne, followed by a string of lone terrorist attacks linked to the Islamic State, the authorities say they can take no chances. In addition to making the recent arrests, they have begun increasing funding to hire new personnel and to add video surveillance in many public areas.

The steps are a public acknowledgment of what officials have conceded privately for months: that Germany remains in the terrorist cross hairs. But the measures are also an attempt to blunt criticism that officials have been flat-footed and failed to anticipate problems left by the refugees in their wake.

The alleged security lapses have been especially highlighted by an intriguing case, now before a judge, of a teenage girl from Hanover who stabbed and seriously wounded a police officer during a routine identity check at a Hanover train station in February.

Opposition politicians in Lower Saxony say the authorities missed several clues that the girl, now 16 and identified only as Safia S. under German law, had long veered toward jihad. As early as 2009, Safia was seen in a video being paraded with pride by a leading German Salafist convert, Pierre Vogel, as a fine example of a young girl determined to wear the head scarf and live a devout life.

She was also seen at Quran distribution stands in Hanover. So were her brother, an Afghan who has since disappeared, and a young Muslim suspected of links to a thwarted terror attack that led the authorities a year ago to call off a national soccer match with the Netherlands, even as the stadium in Hanover was filling with fans.

More clues to Safia’s radicalization may emerge during her trial, which is closed to the public under youth protection laws. But already it seems clear that she had run off to Turkey in January, apparently intending to reach Syria. Her Moroccan mother, who is said to be extremely religious, traveled to Turkey to bring her back to Germany.

The police observed the return but later classified Safia as no risk to public security, said Stefan Birkner, an opposition lawmaker in Lower Saxony who sits on committees investigating and overseeing police and intelligence work in the state.