My favorite “Twilight Zone” episode is the one where aliens land and, in a sign of their peaceful intentions, give world leaders a book. Government cryptographers work to translate the alien language. They decipher the title — “To Serve Man” — and that’s reassuring, so interplanetary shuttles are set up.

But as the cryptographers proceed, they realize — too late — that it’s a cookbook.

That, dear reader, is the story of OpenAI.

It was founded in 2015 as a nonprofit to serve man, to keep an eye on galloping A.I. technology and ensure there were guardrails and kill switches — because when A.I. hits puberty, it will be like aliens landing.

When I interviewed them at their makeshift San Francisco headquarters back in 2016, the OpenAI founders — Sam Altman, Elon Musk, Ilya Sutskever and Greg Brockman — presented themselves as our Praetorian guard against the future threat of runaway, evil A.I., against bad actors and bad bots and all the lords of the cloud who had Mary Shelley dreams of creating a new species, humanity be damned.

“We are explicitly not trying to enrich ourselves,” Sutskever told me.

Brockman was equally high-minded: “It’s not enough just to produce this technology and toss it over the fence and say, ‘OK, our job is done. Just let the world figure it out.’”

But OpenAI is tossing a lot of alarming stuff over the fence. Musk is gone, and Altman is no longer casting himself as humanity’s watchdog. He’s running a for-profit outfit, creating an A.I. cookbook. He’s less interested in peril than investors, less concerned about existential danger than finding A.I.’s capabilities. “When you see something that is technically sweet,” Robert Oppenheimer said, “you go ahead and do it.”

The government has nibbled the edges of regulation, but the quicksilver A.I. has already leaped ahead of the snaillike lawmakers and bureaucrats. Nobody, even in Silicon Valley, has any clue how to control it.

OpenAI’s wild ride two weeks ago was farcical — a coup against Altman that collapsed and turned into a restoration. But it was also terrifying because it showed that we are totally at the mercy of Silicon Valley boys with their toys, egos crashing, temperaments colliding, ambition and greed soaring.

Whatever you want to say about Musk’s recent unraveling — his manic edge, his offensive tweets, his strange, angular cybertruck — he has been passionate in working against rogue A.I. The perhaps quixotic quest of aligning A.I. progress to protect human values has caused Musk many a sleepless night and many a fractured friendship.

He lured Sutskever, a dazzling Russian engineer, from Google to OpenAI. Larry Page, a co-founder of Google and an A.I. accelerationist, was furious at his good friend Musk for poaching Sutskever and broke with him. Page dismissively told Musk he was “a specist” for siding with the human species in the A.I. argument.

Musk also scrapped with Altman. As Walter Isaacson wrote in “Elon Musk,” the mercurial mogul summoned Altman in February, asking him to bring OpenAI’s founding documents. Not too long after, Musk tweeted: “I’m still confused as to how a nonprofit to which I donated $100M somehow became a $30B market cap for-profit. If this is legal, why doesn’t everyone do it?”

Speaking to Kara Swisher, Altman called Musk a “jerk.”

As with Shakespeare, personality clashes are shaping life-or-death decisions in the battle over A.I. One thing that may have touched off the rebellion against Altman was that he diminished Sutskever’s role at the company.

We still don’t know exactly what happened. Did the board see some progress in the A.I. algorithm that jolted them enough to fire Altman for fear he was pushing products without enough regard for safeguards?

Certainly, the A.I. is getting better at reasoning, making fewer mistakes, hallucinating less — the term for making up stuff — and doing complicated math puzzles.

Musk recently praised Sutskever for having “a good moral compass.” Was the young engineer, who joined the doomers on the board and delivered the bad news to Altman before recanting, influenced by his mentor at Google, Geoffrey Hinton?

Hinton, the so-called godfather of artificial intelligence, was stunned by OpenAI’s miracle baby, ChatGPT, realizing we may be only a few years from A.I. being smarter than we are. Hinton gloomily told “60 Minutes” in October that A.I. could malevolently turn on us, manipulating us with what it has learned from being fed all the books ever written, including works of Machiavelli.

Unlike Musk, who can be awkward and go into “demon mode,” according to Isaacson, Altman is smooth in his dealings with investors, techies and lawmakers, comfy in T-shirt and jeans. One top Silicon Valley scientist described the 38-year-old Altman as “weirdly adorable.” Friendly with many reporters, he has assumed the role of the upbeat face of A.I.’s future.

But do we want someone with a sunny disposition about A.I.? No. Not when, as Musk warned last Thursday, “The apocalypse could come along at any moment.”