This story was published in partnership with The Marshall Project, a nonprofit news organization focused on the criminal justice system. Follow them on Facebook and Twitter, or sign up for their newsletter.

When a man named J.J. was arrested in the Bronx in 2016, the public defenders assigned to represent him assumed he’d get a good plea deal.

After all, it appeared to be a low-level case. J.J. had been a passenger in his friend’s car when police had pulled them over for allegedly failing to signal a turn; the officers then searched the vehicle and found an unlicensed gun inside.

J.J.*, now 31, was not the owner or driver of the car, yet he was charged with gun possession, according to his attorneys. Still, he had no criminal record, which usually meant that prosecutors would offer him leniency.

Instead, the Bronx District Attorney’s office insisted on prison time for J.J., which confused his lawyers until, just weeks before trial, they were handed the rest of the New York Police Department’s file on him. In it were printouts of a handful of minor nonviolent arrests he’d sustained back in the stop-and-frisk era, when police had been authorized to stop, search, and sometimes baselessly arrest people who look like J.J., who is black.

But J.J. had never been convicted of any crime; his past arrests had all been dismissed or dropped. And under two New York state laws from 1976 and 1980, police are supposed to seal or destroy such records.

Yet here they were—the old arrest reports, details about J.J.’s appearance, addresses where he’d lived, and mugshots of him that should have been deleted—inside the government’s files, contributing to the case against him and to his eventually spending a year in jail on Rikers Island.

“They stopped stop-and-frisk on paper,” J.J. said in an interview with The Marshall Project. “But they’re still keeping these tabs on my people.”

Rap Sheets on Smartphones

J.J. is one of the lead plaintiffs in an ongoing lawsuit against the City of New York and the NYPD brought by the Bronx Defenders, a group that provides free legal services to people who can’t afford a lawyer, and a private law firm.

The suit alleges that the police department has for years illegally used databases of arrests that were supposed to have been dropped, declined by prosecutors, downgraded to citations or infractions, or otherwise thrown out in court.

According to the claim, cops around the city have access — on their smartphones — to reservoirs of records they shouldn’t be able to see, allowing them to continue to stop, search, and arrest people in neighborhoods like J.J.’s based on “criminal histories” that shouldn’t even exist.

The lawsuit, which in the coming weeks may be ruled a class-action on behalf of potentially tens of thousands of New Yorkers, comes just as a nonprofit research organization releases a 50-state report revealing that in 25 states, police are allowed to access sealed or expunged arrests—and then profile you based on these past allegations that no judge or jury ever found you guilty of.

“It’s not just Facebook and Google that have big data, it’s also police departments around the country using it to train the spotlight of their suspicion,” said Jenn Rolnick Borchetta, the lead attorney on the Bronx lawsuit. “But they’re running their algorithms and their facial-recognition software on arrest records and mugshots that were supposed to have been destroyed.”

Borchetta said the lawsuit is the first of its kind nationally and that she hopes it will inspire copycat suits in other states.

Sergeant Mary Frances O’Donnell, an NYPD spokesperson, said in an emailed statement that despite the Bronx Defenders’ claims, the department is in compliance with New York’s sealed-records statutes because it does not disclose sealed data to any third parties and only uses the records for investigative purposes, consistent with its public-safety mission.

The NYPD did not respond to further questions about J.J.’s case or the specifics of its officers’ practices, and the Bronx District Attorney’s office declined to comment.

Narrow Exceptions

As part of the suit, the Police Department will be required in the coming months to make public more of the specifics of how and to what extent it deploys its databases.

The Bronx Defenders has countered that the NYPD does in fact routinely disseminate sealed data to third parties, including prosecutors, the news media, and housing, immigration, and family-court officials. This has left some New Yorkers at risk of losing their homes, getting deported, or having their children taken from them due to long-ago, dismissed arrests not being properly erased, the group says.

And when lawyers for the NYPD tried to get the suit dismissed earlier this year, a judge denied them, saying the department’s reading of state law was “without merit” and “strained.”

Under the statutes, law enforcement is only supposed to be able to access sealed records with a court order, or when conducting a background check on someone applying to become a police officer, among other narrow exceptions.

According to the Collateral Consequences Resource Center’s new 50-state survey, the country is evenly split on this issue: In half the states, as well as the federal system and the District of Columbia, there is no such law blocking police from accessing dismissed or otherwise sealed arrests.

Meanwhile, 13 of the other 25 states, including New York, have laws preventing law-enforcement officers from immediately or directly viewing these arrest records. To gain access, they must formally request court permission or a waiver from a state records official, articulating a specific reason why they need the documents.

And in the remaining dozen states, law enforcement is fully barred from accessing past arrests that were dropped or dismissed.

“This really is the next big issue, yet the states are all flailing around not following any national model,” said Margaret Love, who runs the center and co-authored the new report with David Schlussel. “Legislators may not have focused on it because they assume police need the records to do actual investigations, without realizing that cops can access this stuff just out on the beat.”

“That’s what’s most scary about it,” Love said.

More Than 400,000 Arrests

Even in states that do have statutes protecting sealed arrest records, the burden is often on individuals themselves to hire a lawyer, go to court, pay a fee, and prove they should have their criminal history — which, again, never resulted in any conviction — expunged. This can be additionally difficult because, for the very reason that such arrests often did not result in charges being filed, there may not be any court records to get expunged, even if the police still have the information on their own computers.

Without expungement, though, the data can be used to classify people as gang-affiliated or a “recidivist,” or to deny them mental-health or drug treatment alternatives to jail if they are arrested again in the future.

According to the Bronx Defenders lawsuit, more than 400,000 cases in the city should have been sealed from 2014 to 2016 alone, as stop-and-frisk waned. More than 80 percent involved black or Latino people, and most were for low-level offenses such as subway fare evasion.

For J.J., it’s just a matter of being treated as a citizen again.

In his year on Rikers Island, J.J. missed out on time spent with his four children, while witnessing violence every day. He and his family also fell into debt, in part due to the fees for his kids’ charter school, he said.

And his fingerprints were never found on the gun in his friend’s car.

“It just became this beast with its own momentum,” said Borchetta, his lawyer. “They tried and they tried to get him—until he was got.”

*Editor’s note: J.J.’s name is being kept confidential as part of the lawsuit against the city, based on his lawyers’ fear of retaliation by police.