Tay did not come to logical (or racist) conclusions. It was taught to be anti-social. Humans had to make it that way.
Much like weaponized diseases, AI will just be a very powerful tool that humans can misuse. Hopefully, like nuclear weapons (incredible power, but highly exclusive), AI will be incredibly difficult for the average person to use in a malicious way.