© John Moore / Getty Thousands of asylum seekers live in a makeshift camp in Matamoros, Mexico, across the border from Brownsville, Texas.

Until this week, a 7-year-old Honduran girl had been living at a makeshift refugee camp in Matamoros, Mexico, with an infected opening in her groin known as a fistula—an aperture through which excrement seeped from her colon to the surface of her skin. She was withdrawn, small for her age, and clinging to her mother, Greg Shays, a volunteer pediatrician from California who evaluated her in the camp’s mobile medical clinic last week, told me. Her mother did her best to keep the fistula clean with baby wipes and donated diapers, but the girl’s health continued to deteriorate. In the squalid camp, potable water is in short supply and a handful of porta-potties serves up to 2,000 people. Asylum seekers wash clothes in a river teeming with E.coli.

Shays included his evaluation in a letter that lawyers presented to American border agents to urge them to admit the girl into the United States so she could get care. He worried she could soon become fatally septic. Customs and Border Protection rebuffed the girl three times, allowing her to enter the U.S. on Tuesday only after lawyers and medical professionals mounted a pressure campaign on her behalf. Other seriously ill asylum seekers remained in the camp—highlighting, advocates told me, the shifting standards and opaque rationales with which border officials grant medical exemptions to the Trump administration’s sweeping new policy forcing asylum seekers to “remain in Mexico” while pursuing their claims in U.S. court.

Known officially as Migrant Protection Protocols, the policy prevents asylum seekers from awaiting court dates inside the U.S., a practice that President Donald Trump has long derided as “catch and release.” Since MPP was announced in January, federal officials have sent some 55,000 asylum seekers to wait in Mexico, leading to the creation of unsafe, unsanitary camps like the one in Matamoros.

Under MPP, the grant rate for asylum has plummeted to 0.1 percent, down from about 11 percent in the 2018 fiscal year. Federal officials at ports of entry can use discretion, however, to grant exceptions for medical emergencies, effectively allowing vulnerable children and families to sidestep the policy and enter the United States. But advocates say the rules are vague and seem to change every day, making it almost impossible to predict who will be allowed across to seek care. “It is arbitrary and capricious,” said Charlene D’Cruz, a lawyer representing the girl, whose name she asked The Atlantic to withhold because she is a minor.

Helen Perry, a nurse practitioner from Florida who set up the mobile clinic at the Matamoros camp, told me she has facilitated emergency medical exemptions from MPP for about 25 asylum seekers since October. She said she presses CBP to grant exceptions for only the most severe illnesses. “We tried to be respectful of CBP’s time,” she said. Sick people whom she persuaded CBP to “parole” into the U.S. include a boy whose appendix had burst, a man who’d had a heart attack, and a baby with third-degree burns from a campfire, Perry said. Open flames are the camp’s only heat source, and as nighttime temperatures have begun to drop below freezing in recent weeks, Perry expects to see more burns.

[Read: What a pediatrician saw inside a border patrol warehouse ]

Last Thursday, however, officials appeared to change their pattern for granting exceptions, Perry said. Perry accompanied the 7-year-old girl with the fistula and her mother to the middle of an international bridge, where a CBP official was posted directly over the invisible border line. The girl’s condition seemed to place her squarely among the other patients who had been exempted and allowed to seek care on their own. But now agents declined to grant her a medical exemption, and instead took her to a local hospital in Brownsville, Texas, to be evaluated in their custody. Perry received a call from an advocate later that night: The hospital had not admitted the girl; the emergency department couldn’t treat her fistula, because it required a complicated surgery, as Shays had written. She was going back to Matamoros. Perry rushed over to the CBP office at the port of entry to intervene. Why hadn’t the girl been allowed into the U.S. like the other very sick kids? Perry told me the official dismissed her concern, saying, “You may be their doctor in Matamoros, but you’re not their doctor here.”

The next day, Shays saw the girl back at the camp. His reaction, he said, was, “Why are you here? You went over there, and they said they would take care of you.”

Perry feared that with the girl’s infection worsening, another fistula could open up and drain excrement directly into her abdomen, triggering sepsis. Rushing her to a hospital in the U.S. was not an option, and doctors in Matamoros had told her they did not have specialists who could do the operation. “If she were to fistulize into her abdomen, we would not be able to save her life,” Perry said.

The two-page MPP guidelines give wide latitude to the judgment of CBP officials when it comes to granting exceptions. Those eligible to bypass the policy include people with “known physical/mental health issues,” and even “other aliens at the discretion of the Port Director.”

“What does that mean?” Perry wondered aloud. “Does that mean the 2-and-a-half-year-old boy who has uncontrolled seizures living in the camp? Should he get admitted? What about the pregnant women?” Perry told me CBP had not communicated any clear standards. As far as she could tell, exemptions were subject to the whim of the supervisor on duty.

I emailed Customs and Border Protection to ask which factors the agency considers when granting exceptions to MPP. How sick is sick enough? A CBP official responded that “all claims are handled on a case-by-case basis” and declined to discuss the girl.

The Matamoros encampment is volunteer-run—neither the American nor Mexican governments, nor the United Nations, is involved in providing food, housing, or sanitation. Brownsville residents cart over hot meals, and charity groups help out with water and toilets. The mobile medical clinic is an RV that Perry drove down from Florida with her dad. Humanitarian workers coordinate shifts through Facebook. On Monday, they decided to draft a petition on the 7-year-old girl’s behalf and post it online. The agency, Perry said, tries to “avoid bad press,” and advocates thought the media attention would change officials’ minds.

The following afternoon, as news outlets made inquiries about the girl to CBP, lawyers again presented her at the bridge. CBP did not respond to a question about what changed its calculus, but that afternoon the girl and her mother were admitted to the U.S. D’Cruz, the lawyer, took them to a hotel that night before helping them fly to Louisiana yesterday, where they are staying with relatives and pursuing both medical care and their asylum case. Two newborn babies and a woman with cervical cancer remained in the camp, Perry told me, and though their health was just as precarious, she didn’t know whether she would be able to get them to safety. “In an arbitrary system,” D’Cruz said, “the only way to work is with pressure.”