Most likely you already figured it out but just in case:
I had the same issue.
The shield that your red dragon pet casts will 'attack' hurt mobs that he flies past. So if a yellow mob is in range of his fire armor then it will set the mob on fire and therefor you suddenly are under attack.