Friendly Fire
Events
Unit - A unit Is attacked
Conditions
((Attacking unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True
Actions
Unit - Order (Attacking unit) to Stop
The logical thing would be to detect when A unit is ordered to attack an ally and stop it.
This however is not so simple as the order is issued after the even fires.
The above is prety effective though however may have problems with units with 0 attack backswing.