I can confirm that the possibility of the attack on friends is possible. However, this is limited to the attack option. In other words, you can attack planets of your friends, or fleets, which are on defense or mining missions. Fleets don't attack if none of the fleets go explicitly on attack. For example, both fleets go on defense. To what extent this affects the non-aggression pact, I cannot say.