While i was managing my inventory in a city, another's player attack on civilian with unstable familiar caused my familiar to attack the civilian as well, which led to me having bounty on my head.
If your pet gets caught in an AOE or multi-target attack, they can attack. This is why you never go AFK with a pet out anywhere that combat can happen.
I think it’s the same mechanic that caused Bastian to involve himself in one of those random encounters between NPCs the other day. I was watching them fight when Bastian decided to step about ten or fifteen feet forward, right into one of their AoEs. Once it damaged him, he attacked them. Cue them scolding *me* for interfering.