Minecraft wiki entry for Guardian, associated text: Guardians attack players, axolotls, and squid. Otherwise, a guardian does not retaliate against mobs (such as iron golems) that attack it, other than damaging the attacking mob with its natural thorns defense.