It . It is important for psychologists and psychiatrists to be knowledgable about a patient's history whenever possible. Does the patient have a history of violent behavior? Does the patient suffer from a condition that is commonly associated with agitation or violence? Is the individual intoxicated on drugs or alcohol which may lower his or her inhibitions? The best predictor of future behavior is past behavior. If possible violence is anticipated, the psychologist or psychiatrist can make provisions before hand, such as ensuring that behavioral health staff or security are available to respond is necessary.
As dr bunt indicated, reading one's body language and tone provides very useful cues. Most training programs teach verbal de-escalation techniques. We are also trained to set up an office in a way that would allow a provider to escape if needed and that would prevent the provider's seating from obstructing the patient's path to the door in case they want to expeditiously exit the room.

Well, . Well, more often than not, it's simply a matter of recognizing when a patient is aggitated and aggressive and staying clear of it, or not provoking it. How does an animal handler avoid getting attacked? It's a matter of reading verbal and non-verbal cues, and always staying aware. Then there's the thing of not getting between the patient and the door if it's someone who may want out, and not letting the patient get between you and the door if it's someone who may want to hurt you. You usually know which kind of patient you are with. Danger can usually be anticipated, but sometimes they do get attacked... And unfortunately the sad truth is that occasionally psychologists and/or psychiatrists and other mental health treatment providers have even been killed by patients.