Law related to inmates while they served their prison time is known as Prisoner's Rights Law. Most basic rights and liberties are included in this legal system, including the right to a speedy trial, legal representation, and the right against cruel and unusual punishment.

The Eighth Amendment of the Constitution prohibits cruel and unusual punishments. The amendment did not explain what sentences would be considered "cruel and unusual," leaving the definition up to the courts. Courts have generally defined cruel and unusual punishments as inhumane unless they fall within the bounds of "the evolving standards of decency that mark the progress of a maturing society."
Inmates of a Correctional Facility, Jail or Penal Institution have a right to be safe from sexual harassment or sex crimes. This doesn't include prison personnel but from people outside of prison.

Right to complain about prison conditions and the court

Disabled Prisoners - Inmates with disabilities are entitled to the same access to prison facilities as those who are not disabled. It is the law under the Americans with Disabilities Act (ADA). The ADA applies to state governments, which applies to inmates.

Prisoners are entitled to medical and mental health care. Treatments received need not be the best or even necessarily adequate; they need to be at least reasonable.

First Amendment Rights: The Constitution grants (but does not guarantee) inmates the right to free speech and the practice of religion, and these rights cannot be interfered with unless there is a cause. For example, an inmate cannot yell "fire" in a crowded hallway when no such fire exists.

Imprisonment should not involve discrimination of any kind. Detainees who do not want to participate in a religious program or for personal reasons should not have to participate or be subject to punitive measures.