It is hard to miss the warnings. In the race to make computers more intelligent than us, humanity will summon a demon, bring forth the end of days, and code itself into oblivion. Instead of silicon assistants we’ll build silicon assassins.

The doomsday story of an evil AI has been told a thousand times. But our fate at the hand of clever cloggs robots may in fact be worse - to summon a class of eternally useless human beings.

At least that is the future predicted by Yuval Noah Harari, a lecturer at the Hebrew University in Jerusalem, whose new book says more of us will be pushed out of employment by intelligent robots and on to the economic scrap heap.

Harari rose to prominence when his 2014 book, Sapiens: A Brief History of Humankind, became an international bestseller. Two years on, the book is still being talked about. Bill Gates asked Melinda to read it on holiday. It would spark great conversations around the dinner table, he told her. We know because he said so on his blog this week.

Sapiens: A Brief History of Humankind by Yuval Noah Harari – review Read more

When a book is a hit, the publisher wants more. And so Harari has been busy. His next title, Homo Deus: A Brief History of Tomorrow, is not out until September but early copies have begun to circulate. Its cover states simply: “What made us sapiens will make us gods”. It follows on from where Sapiens ends, in a provocative, and certainly speculative, gallop through the hopes and dreams that will shape the future of the species.

And the nightmares. Because even as the book has humans gaining godlike powers, that is only one eventuality Harari explores. It might all go pear-shaped, of course: we sapiens have a knack for hashing things up. Instead of morphing into omnipotent, all-knowing masters of the universe, the human mob might end up jobless and aimless, whiling away our days off our nuts on drugs, with VR headsets strapped to our faces. Welcome to the next revolution.

Harari calls it “the rise of the useless class” and ranks it as one of the most dire threats of the 21st century. In a nutshell, as artificial intelligence gets smarter, more humans are pushed out of the job market. No one knows what to study at college, because no one knows what skills learned at 20 will be relevant at 40. Before you know it, billions of people are useless, not through chance but by definition.

Facebook Twitter Pinterest ‘Most of what people learn in school ... will be irrelevant by the time they are 40 or 50,’ says

Yuval Noah Harari. Photograph: Antonio Olmos

“I’m aware that these kinds of forecasts have been around for at least 200 years, from the beginning of the Industrial Revolution, and they never came true so far. It’s basically the boy who cried wolf,” says Harari. “But in the original story of the boy who cried wolf, in the end, the wolf actually comes, and I think that is true this time.”

The way Harari sees it, humans have two kinds of ability that make us useful: physical ones and cognitive ones. The Industrial Revolution may have led to machines that did away with humans in jobs needing strength and repetitive actions. But the takeover was not overwhelming. With cognitive powers that machines could not touch, humans were largely safe in their work. For how much longer, though? AIs are now beginning to outperform humans in the cognitive field. And while new types of jobs will certainly emerge, we cannot be sure, says Harari, that humans will do them better than AIs, computers and robots.

AIs do not need more intelligence than humans to transform the job market. They need only enough to do the task well. And that is not far off, Harari says. “Children alive today will face the consequences. Most of what people learn in school or in college will probably be irrelevant by the time they are 40 or 50. If they want to continue to have a job, and to understand the world, and be relevant to what is happening, people will have to reinvent themselves again and again, and faster and faster.”

Yuval Noah Harari: The age of the cyborg has begun – and the consequences cannot be known Read more

Even so, jobless humans are not useless humans. In the US alone, 93 million people do not have jobs, but they are still valued. Harari, it turns out, has a specific definition of useless. “I choose this very upsetting term, useless, to highlight the fact that we are talking about useless from the viewpoint of the economic and political system, not from a moral viewpoint,” he says. Modern political and economic structures were built on humans being useful to the state: most notably as workers and soldiers, Harari argues. With those roles taken on by machines, our political and economic systems will simply stop attaching much value to humans, he argues.

None of this puts us in the realm of the gods. In fact, it leads Harari to even more bleak predictions. Though the people may no longer provide for the state, the state may still provide for them. “What might be far more difficult is to provide people with meaning, a reason to get up in the morning,” Harari says. For those who don’t cheer at the prospect of a post-work world, satisfaction will be a commodity to pay for: our moods and happiness controlled by drugs; our excitement and emotional attachments found not in the world outside, but in immersive VR.

All of which leads to the question: what should we do? “First of all, take it very seriously,” Harari says. “And make it a part of the political agenda, not only the scientific agenda. This is something that shouldn’t be left to scientists and private corporations. They know a lot about the technical stuff, the engineering, but they don’t necessarily have the vision and the legitimacy to decide the future course of humankind.”

• Homo Deus is published by Harvill Secker in September.