The United States and Europe are drawing up a voluntary code of conduct for artificial intelligence, a top European Union official said Wednesday, as the developing technology triggers warnings about the risks it poses to humanity and growing calls for regulation.