Zuckerberg, whose project last year was building a Jarvis-style A.I. butler for his home, likes to paint himself as an optimist and Musk as a doomsday prophet. But Sandberg’s comment shows that Musk is right: The digerati at Facebook and Google are either being naïve or cynical and greedy in thinking that it’s enough just to have a vague code of conduct that says “Don’t be evil,” as Google does.

As Musk told me when he sat for a Vanity Fair piece: “It’s great when the emperor is Marcus Aurelius. It’s not so great when the emperor is Caligula.”

In July, the chief of Tesla and SpaceX told a meeting of governors that they should adopt A.I. legislation before robots start “going down the street killing people.” In August, he tweeted that A.I. going rogue represents “vastly more risk than North Korea.” And in September, he tweeted out a Gizmodo story headlined “Hackers Have Already Started to Weaponize Artificial Intelligence,” reporting that researchers proved that A.I. hackers were better than humans at getting Twitter users to click on malicious links.