For officer safety purposes. The same rationale that allows officers to handcuff occupants of a premises being searched also applies to other situations in which an officer feels he or she may be at risk. As a training bulletin used by the Los Angeles Police Department states, "The handcuffing of an arrestee is not based on rigid criteria. It is determined by the nature of each situation as perceived by the officer." If an officer feels that placing a person in handcuffs is the best way to ensure his or her own safety, then a court would not likely find that the officer had violated the rights of the person being detained.
While a person is in custody. A person who has already been arrested and taken into custody may be handcuffed while in custody, even while appearing in court. However, if wearing restraints in court would be unduly prejudicial to a jury, your attorney may be able to challenge it.