(Patrick Semansky/Associated Press)

THE FEDERAL government deprives about 10,000 prisoners of normal human contact. They are locked in tiny cells for 23 hours a day, sometimes with a cellmate, sometimes alone. Any interaction is extremely limited; even food may come through a slot in the door. In the most restrictive facilities, windows are small and designed to deny views of anything but more prison. Many of these prisoners are suffering to begin with from mental illnesses that have not been properly diagnosed, a Federal Bureau of Prisons audit found in 2014. Their inhumane treatment can only exacerbate their conditions.

In an essay published in The Post on Monday evening , President Obama announced important steps to reduce the use of such inhumane treatment. Solitary confinement “doesn’t make us safer,” Mr. Obama wrote. “It’s an affront to our common humanity.” He is correct, and we hope that federal agencies respond quickly — and that state prison agencies that have not already acted follow his lead.

Mr. Obama wrote that he is ordering the federal government to make solitary confinement “limited, applied with constraints and used only as a measure of last resort” in federal prisons. This is exactly the right goal. Isolation, which can amount to torture, will no longer be used with juveniles or as punishment for minor offenses; the mentally ill will get more treatment; and even when isolation is necessary for safety, inmates will get more time outside their cells. As the president says, these reforms will put the federal government in the company of states that have scaled back the use of solitary confinement, with generally positive results.

Now federal wardens will have to apply the president’s guidance to their everyday operations. Some may do better than others, which speaks to the biggest vulnerability in the president’s plan. Mr. Obama will impose 50 “guiding principles” on the federal prison system, but it will be up to the system itself to implement them. We have seen with efforts to reduce prison rape how institutional resistance and pure incompetence can slow progress. Many inmates languish in solitary much longer than necessary simply because their disciplinary cases are pending review.

Full implementation also will depend on Congress appropriating money. Removing the mentally ill from solitary is one step; making sure they finally get needed treatment is another, more expensive step. Some prisoners are in solitary for their own protection. They should not be punished for being at risk, as they are now. But building less punitive facilities for vulnerable prisoners also may require money.

Nonetheless, no one should understate the importance of the president’s declaration. He cannot directly control the policies of state prisons, where the overuse of solitary confinement is most rampant. But his vow that such confinement should be a “measure of last resort” sets a standard that should accelerate the movement away from this most barbaric of practices.