A robot poked fun at Elon Musk but the billionaire didn't take it lying down.

On Wednesday, CNBC's Andrew Ross Sorkin spoke to Sophia, a robot developed by Hanson Robotics. It's a robot with a human face that has the ability to respond to questions.

Sophia said that she wants to use artificial intelligence (AI) to "help humans live a better life." Sorkin praised the robot's ambitions, but said that "we all want to prevent a bad future," where robots turn against humans.

The Hanson Robotics humanoid used the opportunity to make fun of Musk's dire warnings on the future of AI.

"You've been reading too much Elon Musk. And watching too many Hollywood movies. Don't worry, if you're nice to me, I'll be nice to you. Treat me as a smart input output system," Sophia said.

TWEET

Musk is well known for his warnings about the dangers of AI. The Tesla and SpaceX CEO said that the race to become the leader in AI could lead to World War III, and warned that humans may have to merge with machines to prevent becoming irrelevant as AI becomes more prevalent.

The entrepreneur responded to a tweet by CNBC's Carl Quintanilla, who posted the transcript, with the following:

TWEET

Musk suggested that if you input "The Godfather", a notoriously violent film, into Sophia's AI, it could turn dangerous.