When armed goons kidnap Jeanie Miller, Rodney McKay's sister, from her home in Vancouver, McKay, Sheppard and Ronon race to Earth to search for her. McKay quickly discovers that Jeanie's computer has been hacked. He traces the source of the intrusion to an office building and hurries there without waiting for Sheppard and Ronon to back him up. But the clue is a trap. Armed men ambush and abduct him, too.
McKay is transported to a mysterious laboratory where Jeanie is waiting. Their captor, Henry Wallace, is the president of Devlin Medical Technologies, a government contractor for the Stargate program that has been building prototype medical nanites based on Replicator technology. Sadly, Wallace's daughter, Sharon, is dying of cancer. He has foolishly risked injecting her with nanites, but the incomplete, untested micro-machines have only made her worse. Wallace knows that Jeanie and McKay have been collaborating via e-mail to write code for Replicator nanites, and he demands that they find a way to save his daughter.
McKay doesn't trust Wallace and persuades Jeanie to escape, but the two are recaptured. To force them to help, Wallace injects Jeanie with nanites, meaning that she will weaken like Sharon unless she and McKay find a cure. Under this coercion, McKay and Jeanie take bold steps to unleash the full power of the nanites.
Sharon briefly improves, then dies - and then comes back to life in a strange, mindless state. Her father is horrified. McKay and Jeanie realize that the nanites possess too much initiative: after curing the cancer, the machines shut down her body to repair other defects they discovered. In the process, they erased her personality. The same thing will soon happen to Jeanie, who has epilepsy. After the nanites shut down her brain for repairs, she'll never be the same again.
Having been searching for McKay and Jeanie all this time, Sheppard finally identifies Wallace as the culprit. He and Ronon assault the building and free the siblings. Back at Stargate Command, McKay puts Jeanie into an induced coma and breaks her legs to distract the nanites for a few hours. He must write a code to shut the nanites down, but the task is too great for him to accomplish on his own.
At his request, the Wraith prisoner from Atlantis - an expert on Replicator code - is transported to Earth to help him. The Wraith agrees to assist because this project might someday lead to the Replicators' destruction, but he is weak. He hasn't fed on a human in days. Soon, he collapses. Unless someone is sacrificed to his terrible hunger, Jeanie will die.