CONCORD, Mass., Oct. 27 — Rainbow looks like any other Labrador retriever, but she is not a pet. Trained by a prison inmate, her mission is to help Roland Paquette, an injured veteran of the conflict in Afghanistan, stay on his new feet, the ones he got after an explosion destroyed his legs.

While veterans who lose their sight or hearing or must use a wheelchair have long had “service” dogs as companions, Rainbow is one of the first dogs in the country trained to work with someone who uses both a wheelchair and prosthetics to get around.

Mr. Paquette’s hope is that eventually Rainbow will allow him to abandon his canes altogether and rely only on the metal handle attached to the harness she wears around her torso.

“I’d much rather be able to walk with her at my side than with the canes,” said Mr. Paquette, who is 28. “It makes me less obvious.”