In 2011, John Morton, then the top official at Immigration and Customs and Enforcement, an arm of Homeland Security commonly known as ICE, issued a memorandum that reaffirmed the agency’s list of “sensitive locations” where enforcement actions were discouraged except under extraordinary circumstances, such as cases involving dangerous felons.

In March, top officials at the agency updated their guidance for field agents conducting enforcement actions at or near courthouses, Virginia Kice, an agency spokeswoman, said. Agency officials declined to publicly discuss the contents of the new courthouse guidance, saying it was confidential. But officials did not modify the 2011 memo to extend its protections to courthouses.

Ms. Lin said that in a private meeting in March with several top officials from the agency, they told her that under the new guidelines agents would conduct enforcement actions at courthouses only against undocumented immigrants considered top priorities, including those convicted of serious crimes and people deemed a threat to public safety.

All actions would occur in nonpublic areas of the courthouse, the officials said, according to Ms. Lin. The officials also told her that courthouses were “well suited” for detentions because they were safer for the agents than confronting someone in their home where encounters were more likely to escalate into violence.

But advocates contend that despite the new guidance, immigration agents continue to use courthouses to go after immigrants who do not appear to be the agency’s utmost priority.

Ms. Socope, 30, first entered the United States in 2008 but was picked up at the border and immediately deported, Ms. Hickey said. She returned the same year and moved to New York City, where she was living with her husband in Brooklyn and worked as a house cleaner.

Last year, after an altercation with a landlord, Ms. Socope — who has never been convicted of a crime, her lawyers said — was arrested and charged with assault and criminal possession of a weapon. Her lawyers and social worker were negotiating for a plea that would include a mandate to enter an alternative-to-incarceration program where she would receive help for mental health issues and substance abuse, Ms. Hickey said.