Former US Secretary of State Hillary Clinton has voiced concern about the dangers linked to artificial intelligence, including the US government's use of programs designed for espionage for recording “everything we know and everything we say and everything we write."

In a report published by The Verge on Thursday, Clinton said America is "totally unprepared" for the economic and societal effects of artificial intelligence.

Clinton said the world was “racing headfirst into a new era of artificial intelligence” that would affect “how we live, how we think, [and] how we relate to each other.”

“A lot of really smart people, you know, Bill Gates, Elon Musk, Stephen Hawking, a lot of really smart people are sounding an alarm that we’re not hearing. And their alarm is artificial intelligence is not our friend,” she stated.

She said the greatest danger loomed in two specific areas: spying and automation.

First, artificial intelligence will be spying on everybody, recording “everything we know and everything we say and everything we write," she said.

Secondly, artificial intelligence will lead to job automation and that will replace humans.

“What are we going to do when we get driverless cars?” she asked. “It sounds like a great idea. And how many millions of people, truck drivers and parcel delivery people and cab drivers and even Uber drivers, what do we do with the millions of people who will no longer have a job? We are totally unprepared for that.”

Clinton didn’t discuss any details of specific policies she would like to see enacted, but said the government needed to act quickly to address the issue. “We can’t put the genie back in the bottle.”