Companies and governments need to establish and adhere to ethical guidelines when deploying AI in military contexts.