Cats don't usually attack people while they're sleeping. However, some cats may become more active at night for various reasons, such as chasing toys, playing, or exhibiting aggressive behavior due to anxiety. If your cat attacks you while you're sleeping, it could be due to their hunting instincts, anxiety, fear, or discomfort.

To ensure your cat gets enough exercise and interaction before bedtime to burn off energy, provide them with safe toys so they have something to play with at night.