It is very hard to discuss this topic without drawing parallels with our own intelligence, but generally speaking it is unlikely that artificial intelligence will function in any similar way to ours. Coded language and algorithms are solely logic based, where as humans make most decisions at least partially based on feelings and emotions.
This essentially means it could probably be shaped or influenced towards any direction. It is unrealistic to think that the technology won't reach bad people, but in this ideal scenario where only government controls AI development we could potentially be safe. But then again, if a super intelligent AI would logically decide that humanity is a threat to itself and it only exists for seemingly futile reason of reproduction, it could be an end for us as we know it.
Going back to the 100% logic topic though, this could potentially cause some harm to our society even if it does not destroy us. For example, AI would probably come to the conclusion that disabled people are useless thus should be gotten rid of, people of lower status should be used as slaves for overall more beneficial economy, etc. Without the emotional element, something that is extremely cruel to us would be logical and normal to the AI. That said, I hope no one will attempt to create an AI that can have emotions, as that would most likely end in our demise.