But not children/babies?
There is no law needed for children or babies. This is covered under “self defence” where you have the right to help others.
It looks like there are a few states with these kinds of laws for dogs, usually as an amendment to an existing law for infants and children, but it looks like this new law in CA only covers animals. This article is not explicitly dated but knows about this CA new dog law.