The fox's that imprint on you when they're a baby protect you, at least they're supposed to. I know their not meant to follow the player but they are suppose to attack mobs that attack them. However, fox's currently only protect you from projectile shooting mobs such as pillagers and skeletons.
Thank you for your report!
We're actually already tracking this issue in MC-157212, so I resolved and linked this ticket as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature in the future to see if the issue has already been reported.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki