She took on Mr. Trump’s and Mr. Cruz’s repugnant ideas. Referring to Mr. Trump, she said the United States should not “conduct or condone” torture under any circumstance and added, “America doesn’t cower in fear or hide behind walls.” She said it would be a “serious mistake” to respond to the threat of terrorist groups by carpet-bombing, as Mr. Cruz has proposed. “Loose cannons tend to misfire,” Mrs. Clinton said.

In addressing Mr. Trump’s comment that America’s involvement in the North Atlantic Treaty Organization should be diminished, she said such a move would be a boon to America’s adversaries: “If Mr. Trump gets his way, it will be like Christmas at the Kremlin.”

She offered specific short-term steps leaders in Europe could take as they confront overlapping crises, including an economic downturn, a surge of refugees and the threat posed by extremists who are European nationals. Currently, Mrs. Clinton said, several European governments don’t automatically alert their neighbors when authorities intercept a suspected militant at an entry point, and that needs to change.

Mrs. Clinton also said that the United States government needs to work more closely with technology companies to counter extremist propaganda and to enable law enforcement to intercept information about violent plots. But she did not state a clear commitment to privacy and civil liberties and has remained neutral in the fight between the government and Apple over forcing the company to help unlock an iPhone to obtain information.

Mrs. Clinton has acknowledged that the military campaign against the Islamic State needs a new legal framework, since it is currently based on a law Congress passed to authorize a response to the Sept. 11 attacks. But she has yet to specify what the new framework would be.