California’s prisons have a sordid history of placing inmates in solitary confinement in small cells for months where they receive only an hour or two of limited exercise and human contact a day. In 2015, the state settled a federal class-action suit claiming that the practice violated the Eighth Amendment’s ban on “cruel and unusual” punishment, but the practice continues.

As an Assembly analysis explained, the California Department of Rehabilitation and Corrections continues “to place individuals in solitary confinement, using dubious gang affiliations to deny them a fair opportunity for parole, and holding them in a restricted unit in the general population without adequate procedural safeguards.”

Given bureaucratic resistance, the Legislature is considering Assembly Bill 2632, by Assemblyman Chris Holden, D-Pasadena. It limits the use of “segregated confinement” to no more than 15 days in a row and no more than 45 days in a six-month period. It also bans solitary confinement for certain categories of prisoner — pregnant women, people with disabilities and very young and old inmates.

These are reasonable restrictions, including for private immigration detention centers. Critics argue the measure will increase costs and endanger inmates and staff. The bill’s supporters dispute that, but financial issues should always yield to human-rights concerns.

We disagree that placing some limits on punishment decreases safety. Officials often relegate inmates to solitary based not on dangers they pose, but on their alleged gang affiliations. Officials can place inmates who pose a threat in higher-security housing where they receive some human interaction.

At the time of the settlement, more than 500 inmates had been in solitary at Pelican Bay for over 10 years. We suspect officials find it easier to warehouse inmates than come up with more humane solutions. Fourteen other states have such laws. California should, too. Many inmates have committed terrible crimes, but the justice system is designed to confine them, not subject them to cruel and unusual conditions.