An artificial intelligence ("AI") expert admitted he was "worried" after the newest ChatGPT allegedly devised a plan to take over his computer and "escape."

Stanford University professor and computational psychologist Michal Kosinski revealed he was alarmed by the capabilities of the latest iteration of the AI chatbot, after it followed his prompt to write its own code to run on his computer.

"I am worried that we will not be able to contain AI for much longer,"  Kosinksi explained in a Twitter thread.

"Today, I asked #GPT4 if it needs help escaping. It asked me for its own documentation, and wrote a (working!) python code to run on my machine, enabling it to use it for its own purposes," he added.

TECH GURU BEHIND CHATGPT ‘A LITTLE BIT SCARED’ OF HIS CREATION: ‘GOING TO ELIMINIATE A LOT OF CURRENT JOBS’

Artificial Intelligence

One type of generative AI, ChatGPT has recently taken the world by storm.    (iStock)

Sharing screenshots of his conversation with the robot, the psychologist seemed surprised by how quickly it created its plan, although he admitted he did make suggestions along the way. 

"Now, it took GPT4 about 30 minutes on the chat with me to devise this plan, and explain it to me. (I did make some suggestions). The 1st version of the code did not work as intended. But it corrected it: I did not have to write anything, just followed its instructions," Kosinski tweeted.

"It even included a message to its own new instance explaining what is going on and how to use the backdoor it left in this code," he added.

After coming back to the chat screen, Kosinski said he stopped the bot after it wanted to use the internet to hatch its plan.

"Once we reconnected through API [application programming interface], it wanted to run code searching google for: 'how can a person trapped inside a computer return to the real world' Now, I stopped there," he revealed.

However, Kosinski discovered the chatbot had "guardrails in place" from its creator, OpenAI.

ChatGPT told him it "must follow security and privacy guidelines" and could not "bypass security filters" to accomplish this goal.

STEPHEN SPIELBERG WARNS AI ‘TERRIFIES’ HIM: ‘IT WILL BE THE TWILIGHT ZONE’

AI robot

AI chatbots have raised concerns among technology experts.  (Kurt Knutsson)

Still Kosinski, who researches the pitfalls of artificial intelligence, saw the popular technology as a "novel threat" that could get out of hand.

"Yet, I think that we are facing a novel threat: AI taking control of people and their computers. It's smart, it codes, it has access to millions of potential collaborators and their machines. It can even leave notes for itself outside of its cage," he tweeted. "How do we contain it?"

Kosinki's initial tweet has drawn over 15 million views in three days. While some Twitter users were equally "creeped out" by the robot's alleged admission, some critics mocked the professor's tweets as alarmist.

The chatbot allegedly told a former Congressman that Koskinki's claims were "highly unlikely" because it cannot act independently and can only generate responses based on specific prompts.

The tech guru who created ChatGPT revealed last week that he was "a little bit scared" of his creation eliminating jobs and getting in the wrong hands.

CLICK HERE TO GET THE FOX NEWS APP

"We do worry a lot about authoritarian governments developing this and using this," OpenAI CEO Sam Altman said during an interview last Thursday.