This story was co-published with The Philadelphia Inquirer.

Last year, ProPublica and The Philadelphia Inquirer reported that the Pennsylvania State Police had no guidelines preventing troopers from engaging in behavior that raised questions of racial profiling and unlawful arrests:

U.S.-born Latinos said they were pulled over and asked whether they were in the country legally.

Two men sharing a smoke break in a parking lot were questioned about their immigration status by a trooper, then arrested for being undocumented.

A trooper stopped a U.S. citizen for a traffic violation, but then zeroed in on the passengers, who did not have documentation; the trooper held the group for hours until immigration officials showed up.

That behavior is now forbidden in Pennsylvania, according to new state police regulations that went into effect last week, aimed at halting unlawful searches and detentions.

The Daily Digest Get the latest news from ProPublica every afternoon.

If a car is stopped for a traffic violation, for example, passengers won’t be questioned or asked for identification solely to verify whether they are in the country legally. The policy says that troopers may not detain or arrest foreign nationals simply for being in the country illegally.

Gov. Tom Wolf called for stronger guidelines after the investigation by ProPublica and the Inquirer found that state police were acting as an informal arm of immigration enforcement. On Friday, Wolf commended the new policy because it “provides clear direction for state troopers.”

The Supreme Court has ruled that it is unconstitutional to prolong traffic stops beyond the time it takes to address the traffic violation. In addition, the court has written that “detaining individuals solely to verify their immigration status would raise constitutional concerns.”

The policy clarifies that administrative warrants for immigration violations — a civil matter — are not grounds for stops or detentions because they do not constitute reasonable suspicion of criminal activity. Troopers can still contact Immigration and Customs Enforcement about a foreign national, but only after an interaction is completed. For a basic traffic citation, that would be after the person has been allowed to go.

The policy clears up the most pressing constitutional concerns over unlawful searches and seizures and racial profiling raised by the series. Yet the new guidelines still affirm the state police’s ability to use all available tools to verify the identity of an immigrant during a traffic stop, arrest or lawful detention. Troopers will continue communication with ICE through databases and direct contact.

If an undocumented immigrant is arrested for a criminal or traffic violation, ICE will still be notified. In cases in which an undocumented immigrant is pulled over for a minor traffic violation, they could still receive a visit from ICE soon after.

The policy also requires troopers to inform immigrants who are detained of their right to contact the consulate of their home government and to allow consular officials access to the detainee.

Randy Capps, director of research at the Migration Policy Institute, called it a “sensible middle-ground policy” that avoids antagonizing the federal government by not sharing information, but at the same time protects people’s constitutional rights.

The policy will require troopers to file a detailed report about any contact with an immigrant, including the reason for the stop or detention and its outcome. This could provide some oversight — reporters and other policy groups could learn about these interactions and monitor them for patterns of racial profiling through public records requests.

Read More Even in Philadelphia, One of the Most Determined Sanctuary Cities, Refuge Is Elusive The city has wielded policy to fight back against Trump and ICE, but in the background, some public employees have quietly cooperated with immigration enforcement agents.

Capps said the recording mechanism could “deter the officer from engaging in racial profiling,” he said.

Some immigration lawyers in Pennsylvania said the new policy was welcome news after a rise in immigration arrests after President Donald Trump took office. “This was a huge step forward,” said Ricky Palladino, an immigration lawyer in Philadelphia. Previously, he said, about 30 percent of his clients’ arrests originated with a state or local law enforcement stop, usually state troopers. But since the fall, “I can’t think of any.”

Andy Mahon, an immigration lawyer in Lancaster, said he thought the policy would be useful for his clients. He often argues that judges should toss the immigration arrests of people detained by police and then turned over to ICE because the circumstances amounted to racial profiling. Now he can include a copy of the new policy in his motions. “That will definitely make it easier to argue egregiousness,” he said.

In developing its policy, the Pennsylvania State Police consulted with several advocacy groups, including the ACLU of Pennsylvania and the Pennsylvania Immigration and Citizenship Coalition. Some of the groups said they were disappointed the final policy did not go further in limiting the state police's contact with ICE.

“That is the exact loophole we want closed,” said Sundrop Carter, the executive director of the Pennsylvania Immigration and Citizenship Coalition. “The policy is better than nothing, which is what they had before. But it falls very short of what we were thinking.”

ACLU’s Pennsylvania chapter released a statement calling the new policy a “baby step.”

“It it is unlikely to be enough to stop troopers’ widespread and unconstitutional practice of pulling over people of color,” said legal director Witold Walczak.

They also expressed concerns about training, oversight and enforcement of the policy.

Ryan Tarkowski, communications director for the Pennsylvania State Police, said troopers will be required to take an online training course about the new policy, and the training will be reinforced each year.

He said members of the public can submit complaints if they suspect biased policing, which will be reviewed by the department’s Bureau of Integrity and Professional Standards. He said troopers who violate the policy would face “internal discipline,” though he did not specify what kind.