Just imagine if the logic was hostile = shoot and somehow the all friendlies get dec’d hostile in a shooting platform. Interpretation of sensors is not always right, be it eye balls or electronic means.
From what I've seen, and what I believe, we're a long way off on the ROE front from allowing AI to actually engage targets without realtime human approval.
We're closer on the technology front, and doctrine always follows technology. But I'm reasonably confident that automated weapons engagement systems will have a human in the loop for generations to come. There is an ethical and moral argument there as well.
Everything needs an abort code/plan.