Mr. Harari, who has a Ph.D. from Oxford, is a 42-year-old Israeli philosopher and a history professor at Hebrew University of Jerusalem. The story of his current fame begins in 2011, when he published a book of notable ambition: to survey the whole of human existence. “Sapiens: A Brief History of Humankind,” first released in Hebrew, did not break new ground in terms of historical research. Nor did its premise — that humans are animals and our dominance is an accident — seem a likely commercial hit. But the casual tone and smooth way Mr. Harari tied together existing knowledge across fields made it a deeply pleasing read, even as the tome ended on the notion that the process of human evolution might be over. Translated into English in 2014, the book went on to sell more than eight million copies and made Mr. Harari a celebrity intellectual.

He followed up with “Homo Deus: A Brief History of Tomorrow,” which outlined his vision of what comes after human evolution. In it, he describes Dataism, a new faith based around the power of algorithms. Mr. Harari’s future is one in which big data is worshiped, artificial intelligence surpasses human intelligence, and some humans develop Godlike abilities.

Now, he has written a book about the present and how it could lead to that future: “21 Lessons for the 21st Century.” It is meant to be read as a series of warnings. His recent TED Talk was called “Why fascism is so tempting — and how your data could power it.”

His prophecies might have made him a Cassandra in Silicon Valley, or at the very least an unwelcome presence. Instead, he has had to reconcile himself to the locals’ strange delight. “If you make people start thinking far more deeply and seriously about these issues,” he told me, sounding weary, “some of the things they will think about might not be what you want them to think about.”

‘Brave New World’ as Aspirational Reading

Mr. Harari agreed to let me tag along for a few days on his travels through the Valley, and one afternoon in September, I waited for him outside X’s offices, in Mountain View, while he spoke to the Alphabet employees inside. After a while, he emerged: a shy, thin, bespectacled man with a dusting of dark hair. Mr. Harari has a sort of owlish demeanor, in that he looks wise and also does not move his body very much, even while glancing to the side. His face is not particularly expressive, with the exception of one rogue eyebrow. When you catch his eye, there is a wary look — like he wants to know if you, too, understand exactly how bad the world is about to get.

At the Alphabet talk, Mr. Harari had been accompanied by his publisher. They said that the younger employees had expressed concern about whether their work was contributing to a less free society, while the executives generally thought their impact was positive.

Some workers had tried to predict how well humans would adapt to large technological change based on how they have responded to small shifts, like a new version of Gmail. Mr. Harari told them to think more starkly: If there isn’t a major policy intervention, most humans probably will not adapt at all.