After Donald Trump’s election, California Gov. Jerry Brown pledged to lead the resistance to the president’s anti-immigrant policies. “You don’t want to mess with California,” he said in March, when Trump threatened to withhold federal funding if California became the first “sanctuary state.” “I’m not going to just turn over our police department to become agents of the federal government as they deport women and children and people who are contributing to the economic well-being of our state, which they are.”

Now, California is moving toward “sanctuary state” status. Senate Bill 54 — designed to bar local law enforcement from using resources to aid federal immigration agents — is moving through the legislature. But a draft of amendments to the bill authored by Brown’s office and obtained by The Intercept indicate that the hope of defending California’s immigrant population, the largest in the nation, from Trump’s long reach may be in danger.

Brown’s amendments in the draft step away from the guarantees that advocates had praised in SB 54. Instead, the governor’s version of the bill opens up new lines of communication between Immigration and Customs Enforcement officials and local jails — pathways toward deportations that aren’t in the tabled version of the bill and don’t exist in California today because of constitutional challenges to ICE policy. While claiming to uphold the vision of creating a so-called sanctuary state in California, Brown’s draft instead puts many immigrants in the criminal justice pipeline — those in the country without authorization, as well as green card holders, including minor offenders — at risk.

Lizbeth Mateo, who works with DreamActivist and has seen a copy of the amendments, said that if Brown’s changes were to be incorporated into SB 54, the legislation would not be seen as affording immigrants the necessary protections. “The bill will not be anything close to what can comfortably resemble a ‘sanctuary’ bill,” she said.

SB 54 was supposed to be about prohibiting local law enforcement from doing federal immigration agents’ jobs. The bill would limit the practice of disclosing when someone in a local jail or state prison is released; ban ICE agents from freely roaming those jails and prisons, questioning inmates without a judicial warrant; and adding legal restrictions on ICE detainers, also known as ICE holds, whereby federal authorities ask local jails to confine individuals until ICE can take the immigrants into custody.

The bill has been touted as a model for other states resisting Trump. In June, former Attorney General Eric Holder said the rest of the nation should follow SB 54’s footsteps.

As SB 54 has wended its way through California’s state legislature, it has already undergone changes. Trump threats to pull federal funding from the state if the law is passed have found an ally in California’s sheriffs. Despite federal funding’s questionable impact on public safety, legislators added a carve-out that allowed cooperation with ICE for immigrants in the country without authorization who were accused of violent or serious crimes. Brown’s amendments would go even further.

SB 54 only applies to state law enforcement agencies — a flexible enough term that wiggle room can be created for new means of cooperation. The document obtained by The Intercept, which sources close to ongoing SB 54 negotiations confirm was authored by Brown’s office, would amend California’s prisons out of the legislation.

“California law enforcement agency does not include the California Department of Corrections and Rehabilitation,” reads an underlined addition to the SB 54 draft.

That would mean, under Brown’s proposed amendment, limits placed on cooperating and providing resources to federal immigration agents wouldn’t benefit anyone doing prison time — including those who’ve never been convicted of a serious or violent felony.

While the carve-out in the current bill allows contact with ICE regarding violent and serious offenders, Brown’s amendments expand the category of those who would be referred to include people convicted of certain misdemeanors. The amendments add language that encompass more than 800 crimes, some which include minor drug violations and tax evasion. The expanded categories of crimes eligible for referral to ICE could even put some green card holders — legal permanent residents of the U.S. — at risk.

Another Brown amendment would allow a controversial ICE initiative called the Criminal Alien Program to continue unabated. The program essentially allows ICE agents access into local jails and prisons, where they can question and detain immigrants. According to the Immigrant Legal Resource Center, the Criminal Alien Program accounts for as much as 75 percent of deportations. SB 54 originally included language to prohibit ICE agents from roaming around jails and prisons unless they were sanctioned to do so by a judicial warrant, but Brown’s draft completely strikes this provision.

Mateo, of DreamActivist, is especially worried about another Brown amendment that would give ICE access to local jails to detain immigrants who have been deported and reentered the country in violation of federal law. Under Brown’s proposed language, if those immigrants are arrested and taken to a local jail for a nonviolent crime, such as food stamp fraud or cultivating marijuana, the retroactive deed of re-entry bars them from the proposed protections of SB 54.

“Some of them have been deported, that had lived in this state for many years and have family and children here, and they have no choice to come back,” said Mateo. “Those are the people that will be exposed the most under this bill.”

Some of the amendments in Brown’s draft would allow ICE to carry out immigration enforcement activities that the agency is effectively barred from conducting now — even without the passage of the original version of SB 54.

For a local law enforcement agency to honor an ICE hold, for instance, is unheard of in any California jurisdiction. Jailers shun the orders because federal courts have found them to be unconstitutional. The currently tabled version of SB 54 would codify the practice by banning local jails and California prisons from cooperating with ICE holds, unless a judge has issued a warrant for a specific violation of federal law.

California would go from no jurisdictions cooperating with ICE holds to creating a contract to do so.

Brown’s amendments, however, seek to create an agreement to use the state’s “law enforcement agency facilities to house individuals as federal detainees.” California would go from no jurisdictions cooperating with ICE holds to creating a contract to do so. The Trump administration is setting a test case for the practice in Florida and hopes to expand it nationwide. Brown’s amendment, if it becomes law, could dovetail into Trump’s anti-immigrant plan.

Dan Reeves, the chief of staff to state Sen. Kevin de León, who authored the original bill, flatly denied having ever seen Brown’s amendments. Reeves said Brown stopped him in the hall to discuss the bill after meeting with advocates last Wednesday. “He’s clearly focused on [the bill] and studying it carefully,” Reeves wrote in an email to The Intercept.

Eddie Carmona, who works with the PICO National Network, was in Sacramento last week to meet with Brown. “One of the things we shared with him is that this is no time to back down on this issue,” said Carmona, who expressed a cautious optimism about the SB 54. “He listened to what we have to say very intently and was asking follow-up questions.”

Brown’s amendments face an uncertain future, and could potentially hold up SB 54’s path to being a historic California law. If the amendments were made to the bill before the assembly votes on it, the state Senate, which already passed SB 54, would need to reconcile the new version. But it’s also not guaranteed that the bill will make it that far – it could stall in the assembly. Asked about the chance that the SB 54 effort might collapse, Reeves wrote: “In negotiation, no outcome is certain until the negotiation is complete.”

Top photo: A guard escorts an immigrant detainee from his “segregation cell” back into the general population at the Adelanto Detention Facility in Adelanto, Calif., on Nov. 15, 2013. The facility is the largest and newest Immigration and Customs Enforcement detention center in California.