I could have sworn there was a mod that took care of this, but searching and inquiring in a couple Mod Detectives thread produced no fruit.
So, is it possible to do this? My inital thoughts are not in a general way. such as a one-esp-do-all. You'd have to script something to each individual companion/pet with something that would make them break off their attack after reaching a certain range from the player and come back.
Your thoughts?