SHAFAQNA – After Tuesday’s terrorist attacks in Belgium , it took no time for Republican presidential candidates Sen. Ted Cruz (Tex.) and Donald Trump to compete over who could be tougher on Muslims. Aside from the usual rhetoric about locking down the borders and halting refugees, Mr. Cruz called for law enforcement to “patrol and secure” Muslim neighborhoods in the United States, which is similar to Mr. Trump’s earlier calls to surveil or even shut mosques.

Mr. Cruz’s campaign clarified that he wants authorities to “work with Muslim communities” to identify and root out extremism, much like the community-based tactics police use to combat gangs. His camp said authorities should “partner with non-radical Americans who want to protect their homes.” As an example, Mr. Cruz’s representatives pointed to New York Police Department efforts that they accused Mayor Bill de Blasio (D) of shutting down because of political correctness.

But the New York practices Mr. Cruz appears to be citing were not really about partnering with Muslim communities, which is an excellent idea. They were covert and, once they inevitably became public, deeply controversial. They ultimately strained the bonds between the police and Muslim neighborhoods, making them counterproductive at best.

In the years after Sept. 11, 2001, New York police collected and organized a lot of information on New York-area Muslims: mapping where they lived and worshipped, placing undercover officers in bakeries and having them eavesdrop on conversations and, in some cases, infiltrating Muslim student groups. Part of the goal was to have a sense of where to look and whom to ask if counterterrorism authorities got wind of an imminent threat or if police wanted to take the temperature of ethnic communities reacting to big events overseas. Yet New York Police Deputy Commissioner John J. Miller said that, after a while, one major piece of the city’s covert efforts became “a sort of top-secret Zagat’s guide,” because officers tended to frequent restaurants with the best food. Then there were examples of egregious overreaching, such as the monitoring of Muslim student groups at elite universities.

Once the Associated Press began reporting on various covert police efforts in 2012, many Muslim Americans were outraged; they saw the police singling out and spying on a largely peaceful community of Americans based on nothing more than their religious affiliation. New York City officials determined the police could do much of what they had aimed to do, such as getting to know neighborhoods and taking the community’s temperature “without all the cloak and dagger,” as Mr. Miller put it. This is the decision the police should have made in the first place.

The last thing the government should do is isolate and alienate peaceful U.S. Muslims. Making them feel as if they are a part of a distrusted, fringe population promotes the homegrown radicalization that now poses a threat to European nations, where integration has not occurred. Mr. Cruz’s campaign warned about “isolated Muslim neighborhoods” in Europe that have become recruiting grounds for terrorists. This is a significant problem that requires sophisticated responses there and here. Neither Mr. Cruz nor Mr. Trump has such a plan. Instead, both seem bent on making the problem worse.