Because it kills without consulting the people who put it there.
AI is also programmed; it attacks when the score returned by the threat function exceeds a threshold.
Unless we're talking about AGI, in which case I misunderstood and assumed we were talking about AI that we can currently make.
You've literally just said it is programmed. If it is programmed, how can it be autonomous?