No dog will bite or attack without warning, except those who have had bad experiences with humans.
You can understand that the dog is preparing to attack and is ready to bite using the aggression “ladder”.
With its help, it becomes clear that the animal is experiencing discomfort and wants to prevent negative consequences in advance - dog trainer Diana Belyaeva will tell you more about the method of recognizing aggression.

The first signal is the dog yawning or licking its nose. This signals discomfort in the animal.
Be sure to take into account the context of the situation - your pet may simply yawn after waking up.
The dog begins to turn its head to the side - this is a signal that the animal is no longer interested in interacting with you or another object.
The dog turns sideways, thus showing that it needs a little more space than usual. Take all these signals into account.
The next stage is escape. The dog may start running away or simply move away from you.
This is the body's reaction to a stressful situation. If your pet wants to leave now, do not prevent it.
The dog begins to hunch its back - this means: “I want to seem small, leave me alone!”
"Don't come near now!" If a dog lies down and exposes its belly, it means it wants to make peace with the object that threatens it.
Next, the dog may freeze and look into the eyes. At this point, the animal is already experiencing acute stress.
The pet freezes, looks at the object in anticipation, waits for it to leave the field of vision. If this does not happen, the dog may already attack, having skipped several steps of the "ladder" of aggression.
Then growling comes into play - this is a request to increase the distance or leave altogether. In this way, the animal asks the object to move away.
There is no need to scold for growling! Next time the dog can skip this stage and start acting right away.
Teeth chattering - this is where you need to stay away.
The animal can start acting at any moment. If all signals have been ignored, the dog starts acting and can bite.
Biting is a natural behavior for dogs and is sometimes used in self-defense.
Therefore, always ensure that no situation or circumstance causes discomfort to your pet.
Stop negative emotions at an early stage and do not allow other people to violate your dog's personal boundaries. Trust and mutual understanding are the basis for a prosperous life for a person and his pet!