My opinion: if we ever get remotely close to AI, there should be a base code, unable to be alterd by anyone not even the best hacker with the utmost protection that is possible so nobody, realy nobody could change it not even the computers themself that contains a simple rule for the AI, " NEVER, NEVER EVER do something that could hurt mankind in ANY way even if we wanted to destroy tehm"
thats the thing, ever seen IRobot? the mother AI was trying to save mankind from itself.