Upending two decades of precedent surrounding child detention, Trump’s new proposal to deal with undocumented immigration could see children apprehended by immigration authorities facing jail time for months, perhaps indefinitely, as their immigration proceedings are pending.

Until now, under a 1997 legal settlement known as the Flores Agreement, federal authorities had been barred from detaining children in “jail-like” settings. If the Trump administration prevails in overturning the precedent, children could be imprisoned, with or without their parents—even when they are pursuing a valid asylum claim, and even when their parents are being prosecuted separately for illegal border crossing. While the administration is pressing its new plans for indefinite detention, new internal auditing reports have emerged detailing egregious failures of the government to protect the health, welfare, and safety of migrant children in detention, or even to track family members who had been separated by authorities. A DHS watchdog report noted that children were kept in chaotic and inhumane conditions for prolonged periods as they underwent processing at the border.

The Flores settlement that Trump wants to scrap was designed to prevent children from being subjected to abusive conditions in detention. The original purpose of Flores, according to a legal analysis by the Tahirih Justice Center, was to “minimize the use of immigration detention for children and to maximize children’s well-being if and when detained.” The underlying principle is that civil immigration detention should not be imposed as “deterrence” for unauthorized migration. Now, in a perverse attempt to circumvent Flores, the Justice Department has proposed tweaking the regulations to allow immigrant prisons to be considered suitable facilities for housing kids. The new scheme, Tahirih argues, could “all but eliminat[e] such protections in practice, giving the [Department of Homeland Security] the authority to incarcerate children for longer periods of time and in facilities licensed by DHS itself.”

But human-rights advocates argue that, rather than creating new ways to imprison kids, the government has a humanitarian and constitutional obligation to make every effort to keep children free, safe, and with their families whenever possible. While the Obama administration also presided over years of brutal detention practices and record deportation rates, Trump’s zero tolerance policy marks an unprecedented escalation in the systematic cruelty of the detention system. Unraveling Flores would empower Trump not only to cage migrant families but to tear them apart, possibly forever.

Like the border-security panic, the dilemma over Flores is also a crisis of the administration’s own making. The Flores Agreement essentially mandated that the government release children from detention after about 20 days. But since Trump launched a “zero-tolerance” program of mass detention of adult migrants at the border, thousands of children have been torn from their families when their parents got locked up. In response, the administration haphazardly attempted to “resolve” the crisis—not by freeing the parents but by jailing the kids.

Historically, the Flores settlement has been one of the few legal shields for migrant children seeking asylum. For the Central American migrants driving the current influx of asylum seekers at the border, the Flores Agreement intersects with another federal law, the Trafficking Victims Protection Reauthorization Act, which automatically entitles unaccompanied children to a full legal review of their cases, and has also ensured at least some modicum of due process for child asylum seekers. But after nearly two years of terrifying immigration raids and massive expansion of private detention centers, gutting Flores would pave the way for ICE and the border patrol to slice even deeper into heart of their communities, by attacking whole families.

While all forms of detention are harmful, the imprisonment of children in particular is seen as a red line because of the huge risk of trauma and abuse. According an analysis by the American Association of Pediatricians, the border processing centers where both children and adults have been warehoused are known for squalid conditions with “insufficient food and water, and lack of access to legal counsel and…extremely cold temperatures.” Imprisoning children, alone or with their caregivers, exposes families to major risks of depression, anxiety, and suicide.

The Obama administration also tried to rollback the Flores Agreement’s protections, but was ultimately blocked by a legal challenge. Toward the end of Obama’s tenure, rights groups and officials ramped up public pressure to end family detention. The district judge in that case, Dolly Gee, is now thwarting the Trump administration’s attempt to push a refurbished family-detention scheme.

Irena Sullivan, senior immigration counsel with Tahirih, points out that so far “Judge Gee has rejected both the previous and current administrations’ attempts to use long-term family incarceration to deter migration.” But Flores is just a settlement, not a permanent law. So even if Flores survives Trump’s current attacks, it will remain vulnerable to being weakened at the discretion of future administrations. According to Sullivan, “An administration cannot unilaterally repeal it.” But in the long-term, “as with any settlement, it could be subject to renegotiation or modification, with approval by the federal judge presiding over the case at any given time.” Given the risk that it may be challenged again by Trump or his successors, she adds, lawmakers could “enshrine Flores’s terms in legislation” to preempt future efforts to undermine the regulations.

The heightening barriers to entry are all part of Trump’s effort to tighten immigration enforcement, both at the border, on the streets, and through the criminal-justice system. Already, the administration has instituted rule changes aimed at making the asylum process less accessible, such as increasing the caseload burdens for immigration judges, which has swelled the already-massive court backlog, and intensifying scrutiny of migrants in “credible fear” interviews at the border, which serve as an initial test to initiate an asylum claim.

Even more tragic is the fact that no immigration detention is ever truly necessary. The need to track the families and children as their cases are pending could be done by releasing them on bond and allowing them to live in the community, typically with family members or their social networks, which would also dramatically expand access to social and legal services. Just last year, in fact, Trump ended a flagship program for community-based monitoring coupled with comprehensive social services. In other words, the administration knows well that there are alternatives, but instead of supporting more humane policies for migrant children, it has worked to ensure that imprisonment is their only option.