Demonstrators protest the anticipated immigration policies of President-elect Donald Trump. (Mark Lennihan/Associated Press)

PRESIDENT-ELECT Donald Trump’s threat to deport 2 million to 3 million illegal immigrants with criminal records — a flimsy number that crumbles upon scrutiny — has caused tremors in some of the nation’s biggest metropolitan areas, especially those considered “sanctuary cities.” In fact, while some localities impose limits on working with federal immigration authorities, a large majority — including most regarded as sanctuary cities — do cooperate when it comes to helping to transfer and deport dangerous and violent felons scheduled to be released from jail or prison.

The question is, what happens if Mr. Trump wants to go further by enlisting local law enforcement agencies to hand over or help sweep up undocumented immigrants convicted for small-time shoplifting, driving without a license and other minor offenses? The issue — part of a “negotiation,” in the words of Reince Priebus, Mr. Trump’s pick for White House chief of staff — is which crimes are sufficiently serious that they should trigger deportation, and reasonably require cooperation in that regard from local officials.

A common-sense test should apply to federal policies and local ones. A fair-minded federal standard would not require local law enforcement agencies to be pressed into service as deportation agencies chasing or handing over undocumented immigrants who have committed minor offenses. To do so would subvert relations between law enforcement and local immigrant communities, in which trust and cooperation are critical.

A fair-minded local standard would ensure that police, sheriffs and corrections officials see to it that dangerous criminals — violent felons and those convicted of multiple serious offenses, drunk drivers, sex abusers, drug dealers — do not slip through the cracks.

That has happened in some isolated instances, which provided Mr. Trump with fodder for his campaign pledge to “end” sanctuary cities. The most notorious case involved San Francisco, where the sheriff’s office last year ignored a detainer — an official request from federal immigration officials seeking custody of an undocumented immigrant with a long record of drug offenses. Rather than being transferred to the feds, the man was released; soon after, he killed a tourist who was strolling on the city’s waterfront.

San Francisco’s policy is irresponsible. The city has gone out of its way to defy federal officials, as have some other localities in California, which outstrips other states in thumbing its nose at federal detainers. But those jurisdictions are outliers.

The tricky part is that there is no single accepted definition of a sanctuary city. Some, including New York, cooperate in handing over some felons, but not others, to federal authorities at their release date, depending on the severity of the crime. Others, such as Cook County in Illinois, which includes Chicago, refuse to turn over undocumented immigrants unless federal agents obtain a court warrant.

It’s possible that New York considers too few crimes as sufficently serious to warrant transfer for deportation. Perhaps Cook County should honor detainers without insisting on a warrant. The Trump administration is entitled to seek fair and consistent standards that protect communities from dangerous criminals without poisoning relations between local law enforcement and immigrant communities. Better to negotiate terms than punish millions of Americans by suspending billions in federal funding to localities.