It’s rare for someone to be violent during sleepwalking or similar arousal disorders such as confused arousals (which “occur when a person is in a mixed state of being both asleep and awake, generally coming from the deepest stage of nondreaming sleep”) or night terrors.
According to a recent study by Mark R Pressman in the American Academy of Sleep Medicine journal SLEEP (press release, 1 Aug), such violence doesn’t happen randomly, but seems to be in response to provocation:
According to the review, violent behavior occurs in slightly different ways in sleepwalking, confusional arousals and sleep terrors. In the case of sleepwalking, the violence occurs only after the sleepwalking episode has been triggered and is underway. During the sleepwalking episode, while moving about the environment, the sleepwalking individual encounters someone else – most likely a family member. This person may approach or make physical contact with the sleepwalker, triggering a violent reaction.
With confusional arousals, violence may be precipitated in one of two ways. An individual may have a confusional arousal associated with complex behaviors but never leave the bed. The bed partner or parent may try to calm or restrain the individual by grabbing or holding them. More often, a confusional arousal occurs when someone attempts to awaken a sleeping individual in bed.
Sleep terrors differ from sleepwalking and confusional arousals in that the individual appears to react to some type of frightening image. The individual may act in an improper or agitated manner without regard to reality. If another individual is encountered or is in close proximity, violent behavior may occur.
Mark R. Pressman (2007). Disorders of Arousal From Sleep and Violent Behavior: The Role of Physical Contact and Proximity. SLEEP 30(8):1039-1047