Not every inmate is eligible. To apply, inmates must have a high school diploma or its equivalent and be free of disciplinary reports for a year — a considerable challenge, Mr. Perry said.

“These aren’t heinous individuals,” he said. “They’re men who’ve made mistakes, serious ones, and they deserve to be forgiven. And the sooner they can forgive themselves, the sooner we can.”

Working with the dogs, he said, speeds that process. “A lot of these guys have never been given a lot of responsibility, and this is their chance not only to be a responsible adult but a responsible citizen,” he said.

That sense of duty is explained in a mantra displayed on a wall:

You Can Design It

You Can Make It

You Can Hide It

K9

We Will Find It

Striding past it, Warden Perry and Ms. Brock, the Auburn instructor, paused at the end of a row of bunks, an empty crate brushing their knees.

Until a few days before, the crate had housed a dog named Joel, who had graduated and gone back to Auburn. “I know you’re wondering,” Ms. Brock said to his trainer. “Joel is doing great.”

The inmate gestured at the metal grate, onto which he had taped a photograph of a Lab. It was not Joel but a look-alike from a magazine. Possessions are few here, some flimsy, all of them essential. As was this one, a reminder of a dog trained to protect, who may have already done some of his most wondrous work.