At the age of 13, she came to England from Nigeria with her relatives for what she thought was a summer vacation.

It was only after they arrived in Bedfordshire, in the east of England, that she discovered there were no plans to go back.

Because of what she describes as the “irresponsibility” of her guardians, the teenager — now a 26-year-old woman — had no visa or asylum status, and neither did her siblings.

“I had no knowledge, no understanding, I just knew that I couldn’t do what people my age were doing,” she said, asking to remain anonymous because of her relatives’ undocumented status.

For more than a decade, she was among the hundreds of thousands of people in Britain estimated to be living outside the immigration system. Although she attended school and later college, once she turned 18, she could not legally work, get a driver’s license or vote. She came to realize, with growing dread, that she could face detention or deportation at any time.

The question of what should happen to undocumented migrants is the subject of bitter political debate in Britain, as successive Conservative governments have pursued increasingly hostile policies on immigration, including a contentious plan to deport asylum seekers to Rwanda. The legality of that policy is being considered by the Supreme Court.

On Thursday, the government returned a number of asylum seekers to the Bibby Stockholm barge, a highly publicized emblem of the government’s hard-line approach, which it says will cut costs. The first 39 men on board were evacuated in August after Legionella bacteria was found in the barge’s water system. The Home Office, the department responsible for immigration, said “all necessary tests including health, fire and water checks have been completed, and are all satisfactory.”

The barge is not a detention center — those on board can come and go, though they are expected to return at night, and specially arranged buses will take them to “destinations agreed with local agencies,” the Home Office said. But it is part of a broader plan to deter would-be migrants from traveling to Britain in the first place.

And after years in which the government deliberately reduced the number of people in immigration detention — in response to evidence showing it was inhumane and expensive — the past two home secretaries have reversed that policy, announcing the construction of new “removal centers” and pledging to detain all arrivals.

The 26-year old in Bedfordshire was lucky. In 2020, before the latest policy shifts, she took part in a small pilot project to help undocumented migrants resolve their immigration status in the community, funded by the government in partnership with a local charity and the United Nations refugee agency. Thanks to the legal advice she received, she was granted permission to remain in Britain at the start of this year.

“It’s a huge relief,” she said. “I’ve been here over 13 years — 13 years of waiting and having my hands tied and being quiet.”

Experts say that her experience — and the broader outcomes of the program — raise questions about the costs of the approach being pursued by Prime Minister Rishi Sunak’s government.

Britain has one of the largest immigration detention programs in Europe, and unlike countries in the European Union, has no time limit on detention. After repeated scandals over suicide, self-harm and abuse inside detention centers, a 2016 independent review ordered by Theresa May, the home secretary at the time, recommended the government explore alternatives to detention, “both for reasons of welfare and to deliver better use of public money,” in the words of the report’s author Stephen Shaw, a former prisons regulator. In response, the government committed to reducing immigration detention, closed three centers, and in 2019, the Home Office and U.N. refugee agency began a series of programs to test alternative approaches.

One was the King’s Arms Project in Bedford, in which undocumented migrants referred by the government received three consultations with a legal adviser and support from a dedicated caseworker. Eighty-four people took part in total. Of those, six were granted leave to remain during the scheme — exactly the same number as in a comparison group of 84 people in detention for the same period. More than 60 people in the King’s Arms project were told they had viable options to regularize their immigration status before the program ended in June 2022.

An independent assessment of the program commissioned by the U.N. refugee agency found it was two-thirds cheaper to provide this support than if the participants had been detained. The pilot programs showed that “alternatives to detention are cheaper and offer better value for money compared with the costs of detaining asylum seekers,” the agency said in August, addiing that they had also contributed to the mental health and well-being of participants.

But the Home Office, in an official response to the report’s recommendations, said there was “no definitive evidence that the pilot provided more effective case resolution in the community than detention.” They pointed to the fact that seven people in detention had their cases resolved during the comparison period while just six in the pilot did. This reflected the fact that one person in detention chose to leave Britain.

“We continue to explore ways to bring the cost of detention down, but there is currently no evidence of providing better value for money than the current system,” the Home Office said in a statement when asked about the decision to end the pilot.

Kirstie Cook, the chief executive of the King’s Arms Project, said that given the current political climate, she was not surprised the initiative had not been continued, but said it was “a tragedy.”

The rhetoric from the Home Office often stood in stark contrast to the positive work being done by civil servants to prevent costly and often inhumane detention, she said. “It used to confound me,” she added.

While there is no clear data on how many people are living outside the official system in Britain, experts estimate the population at between 800,000 and 1.2 million.

“The Home Office has been clear that it views detention as a key aspect of deterring irregular migration to the U.K.,” said Sachin Savur, a researcher at the Institute for Government, a British think tank.

There are immediate costs to building and staffing more detention facilities, Mr. Savur said, and he pointed to the U.N. agency’s evaluations of the pilot projects as evidence that community-based schemes could help ease those financial burdens.

“Given the ambiguity around how long people may be detained for following the Illegal Migration Act,” he said, referring to legislation passed this year that extended the government’s detention powers, “the government may find that it is cost-effective to explore alternatives.”