The rule is that attacking a faction member will turn the entire faction hostile, regardless of all factors.
The exception is when a quest is involved, usually when one of the quest's solutions is for you to attack a member of the faction that gave you the quest itself.