“SOONER OR LATER, human intelligences are going to live inside machines. It’s just a matter of time,” writes Mark Alpert, introducing his first young adult novel, The Six — a thriller about terminally ill teenagers who agree to have the contents of their brains downloaded into robots. They have two motives: to live, and to save the world.

And I believed it. The Six is thrilling, packed with science and enough heart to touch this literary adult. When Alpert says today’s teens will live to see cyborgs, I’m also inclined to believe him — if only because he’s made other bizarre predictions that have come true. For example, in his 2008 novel, Final Theory, he wrote about self-driving cars. We’re now seeing self-driving features in new luxury models and burgeoning research with test cars from the likes of Google and Uber. In Extinction, he wrote about linking human brains electronically. A few weeks after the book came out in 2013, we heard news about a successful brain-to-brain experiment with a rat in North Carolina linked by wire to a rat in Brazil.

Alpert has the credentials to persuasively put gee-whiz science into his novels. A contributing editor at Scientific American who used to write its column about exotic gadgets, he studied astrophysics at Princeton University. In his thesis, he applied the theory of relativity to Flatland, a hypothetical universe with only two spatial dimensions. His conclusions were published in the Journal of General Relativity and Gravitation and have been cited in more than 100 scholarly articles.

This novel begins in a lab based on the IBM Thomas J. Watson Research Center in Yorktown Heights, New York, where Alpert met scientists developing Watson, the computer system that defeated two Jeopardy! champions. Watson, like the computer on Star Trek, can understand and answer questions posed in human language. During his visit to IBM, Alpert also heard about the progress in “neuromorphic electronics” — essentially circuits that imitate brain cells. We seem to be getting closer to making a robot as smart as we are, which, of course, is a scary proposition, both because we could use it to do bad stuff and because it could get out of our control and become our enemy. The young heroes of The Six are recruited precisely because the US Army believes it needs real human intelligences to fight a rogue artificial intelligence called Sigma.

But before they take on Sigma, they must answer a question haunting our hospitals and insurers: how much technology should we be willing to use to stay alive? Human-robot hybrids will seem more palatable as we replace more body parts, acquiring not just knees and hips, but patches of synthetic skin, prosthetic hands sensitive to touch, electronic fingers that store data, thought-controlled bionic legs, artificial pancreases that provide insulin for diabetics, and artificial eyes — all projects already in the works.

Could we really make the leap from replacing body parts to becoming humans inside a robotic body? We now implant electrodes in the brain to monitor the activity of specific brain cells. President Obama has backed long-term research to do a brain-cell signaling map akin to mapping the human genome. According to Alpert:

As neuromorphic circuits improve, scientists will eventually develop a computer that can hold all of the human mind’s data — memories, character traits, emotions and so on — which can be gleaned from the brain by analyzing the myriad connections among its cells. What’s more, the neuromorphic circuits will be able to process this information the same way the brain does, allowing the computer to generate new thoughts and emotions. If researchers copy a person’s brain data to these circuits, the “personality” inside the machine will be self-aware and indistinguishable from the original personality in the living brain.

The 17-year-old hero of The Six, amusingly named “Adam Armstrong,” becomes the world’s first human-machine hybrid. Like many teenagers, he’s a programming whiz and loves virtual reality fantasy games. We meet him as he’s sitting in his Dad’s lab — the one based on IBM’s — playing a virtual football game, his own invention, populated by animated characters representing the team at his high school, complete with cheerleaders including Adam’s crush, Brittany. Armstrong isn’t playing real football because he’s dying of muscular dystrophy.

When Brittany steps toward him with outstretched hands, saying, “I love you, Adam! I want to be with you forever!” he has an utterly believable Holden Caulfield mood swing. “She’s fake. The whole thing’s fake. […] The program is just stupid and fake and pathetic.”

It’s a typical moment in this book, which has plenty of emotion and insight as well as robotics. To beat Sigma, the six kids, called “Pioneers,” have to get along and not fall apart like a quarrelsome rock band. Adam has to find empathy and confidence to lead them.

As befits a committed thriller — the pace is as fast as you could want — the psychology involves action: chunks of The Six, like Eternal Sunshine of the Spotless Mind and the new Pixar movie Inside Out, take us into the psyche as a physical space. One of the teens is a girl with a troubled past and a crush on Adam; like any boy trying to comfort a girl, he has to dive into her weird psyche — only in Adam’s case, he must literally download himself into her robot body, find a buried bad memory, and take it into his robot body, all at considerable risk. Like a good therapist, rather than destroying it, he keeps it, because — as you’ll learn from Inside Out — we need our sadness to be ourselves. She might want it back. Adam also has to figure out that he’s better off connecting to another girl among the six who is more resilient. Love isn’t rescue.

Let me note that The Six’s girls are as feisty as the boys and, mostly, as clever. Adam does prove the smartest, but he isn’t obnoxious about it.

The Six begins with a quote from Marvin Minsky, an artificial intelligence pioneer based at the Massachusetts Institute of Technology: “Will robots inherit the earth? Yes, but they will be our children.” Most touching to me was the gap between Adam’s parents. Dad, the computer geek, works for the company behind the robots and secretly helped hatch the plan to save his son. His mother lives in a different world, where boys stay flesh. When Adam the robot addresses her as “Mom,” she says, “I had a son, but he died.” He’s devastated (yes, his neuromorphic circuits can generate new emotions). Adam is learning how profoundly adults may disagree, an important message for the brainy young people who will drink up this book.

A related question: would we still care about each other if we weren’t mortal? In theory, we could live forever jumping from human to robot and, if that runs into mechanical problems, to another robot. We might even keep backup copies of ourselves for safekeeping. In The Six, the band learns that because the neuromorphic chips are dynamic, any backup copy would immediately begin developing its own history and no longer be you. So when they go into combat with Sigma, these kids who came so close to death as humans risk death again.

The copying issue becomes crucial in the key fight scenes. The Pioneers each get their own tiny fighter drone, called “Ravens,” as their means of travel. When they go into the war zone, Adam as commander can temporarily copy his files in order to occupy the circuitry of other weapons. But Sigma has the same kind of power. It may be lurking inside any machine.

Here’s Adam leading an attack on a battleground in Russia littered with T-90s, a Russian tank. He’s already loaded a program that, when needed, will copy his files (and conveniently delete them in a pinch so they don’t get scattered around):

I’m going to dip my toe in one of the T-90s to see if it’s safe to occupy its control unit. If it is, I’ll put my Raven in a dive, which will be the signal to launch the attack. Until then, my team is under orders not to occupy the tanks. […]

I turn on my transmitter and focus the data stream on the tank’s antenna. My mind takes a mad leap through the darkness […]. Half of me lands with a jolt inside the tank and half is still circling in the air. I feel like a ballerina pirouetting on one foot.

Moving swiftly, I examine the tank’s neuromorphic circuits. There’s no sign of Sigma here. My presence in the control unit doesn’t set off any alarms or detonate any explosives hidden in the T-90. It looks like we’re good to go […].

Proceeding cautiously, Adam copies his files again and checks another tank:

Now I’m occupying three machines at once, and it’s making me dizzy. […] After a hundredth of a second I notice something odd. There’s some lingering voltage in the control unit, a faint trace of previous activity. These circuits were full of data a few seconds ago, but then the files were transferred or deleted. What’s going on? […]

Sigma was here, in this control unit. The AI knew I was coming, and it pulled out of the tank just before I arrived. […] The T-90s are a trap.

I immediately delete my copied files and withdraw from both tanks. I snap back to my Raven, which is still circling above […]. Then I get a radio message. It’s from Jenny.

I’m not waiting anymore! I’m going in!”

Her Raven is below me, gliding just a hundred feet above the ground and shooting a stream of data to one of the tanks. I can’t believe it. She’s disobeying my orders. […]

“Stop, Jenny! Stop!

It’s too late. […] The AI has sprung the trap, taking control of her files as they enter the tank’s control unit.

Sigma has her.

Jenny doesn’t have the necessary protective program to copy and delete herself, so she’s in trouble. To be sure, this may all sound contrived, but in the familiar way of the genre. As an adult who once considered herself economically secure because she could type 90 WPM (stands for “words per minute” for all of you born after 1970) on an IBM Selectric, I have no trouble believing that one person would live and the other would be screwed for lack of requisite software. Just look around. People are getting consumed by Sigmas this very second.

¤

Temma Ehrenfeld’s journalism and literary work have appeared in The New York Times, Newsweek, Reuters, and Fortune and her literary work in Michigan Quarterly Review, The Hudson Review, Chicago Literary Quarterly, Catamaran Literary Reader, and Prism International. She is shopping her first novel, The Wizard of Kew Gardens.