The AI should take possible failure to track due to beam turn rate reduction while firing, as well as what is behind its target, into account when evaluating friendly fire risk.
The AI will use beam weapons that cannot retain its turning speed while firing, such as Phase Lance, to attack fighters when no other target is available.
Which is not a problem EXCEPT when there is a friendly ship present in that general direction and within range, which causes any missed shot or shot that obliterated its target to end up inside a friendly tailpipe.
With the Phase Lance, between significantly reduced turn speed while firing, 600 range of the weapon meaning the fighter is pretty close when it is fired(requiring faster turn rate), and damage output enough to vaporize most fighters on a full hit, the miss and subsequent friendly fire is bound to happen. Not a neglible one either - in one incident it went straight through my Medusas' armor and 20% of the hull.
Currently running a fleet with heavy presence of Phase Lances and beams in general, so I have noticed the issue. In one battle the only significant damage I suffered was a friendly Lancing on my Eagles' rear.