Having gone offworld for only a few hours, Maj. John Sheppard, Dr. Rodney McKay, Lt. Aiden Ford and Teyla come through the stargate "hot," with Wraith on their tail. McKay is stunned by a Wraith weapon, but Dr. Carson Beckett says he'll be okay when the effects wear off in a few hours. Fortunately, Wraith weapons are designed only to incapacitate, because the Wraith can't suck the life out of anyone dead.
This makes the fifth mission out of nine that Sheppard's team has encountered the Wraith. Somehow, the Wraith know where and when the Atlantis team will appear. Security chief Sgt. Bates suspects there's a traitor in Atlantis, and suspicion immediately falls upon Teyla's people, the Athosians.
Dr. Elizabeth Weir holds a security meeting, at which Teyla is notably absent. Sheppard is appalled by Weir's distrust of Teyla, but Weir can't take chances. She is prepared to follow Bates' suggestion that certain areas of Atlantis be designated no-go zones: stargate operations, the labs, power generation and the puddle jumper bay. Weir suspends all stargate travel and will meet with each Athosian personally before making any further decisions. Sheppard gets Teyla to convince her people to cooperate. But when an interview with the Athosian elder, Halling, becomes an interrogation, he becomes furious at the Atlantis team's accusations and storms out.
Meanwhile, Sheppard, McKay and Dr. Zelenka have made a discovery in the puddle jumper bay. While futzing around in a jumper's wiring, McKay discovers a subroutine that he's never seen before. Suddenly, the roof opens, revealing blue sky above. Vertical liftoff from Atlantis is now possible - and Sheppard can't resist lifting off. As he and Ford depart on a little joyride, they make another discovery: land! A lot of land - approximately 15 million square miles.
When news of this reaches Atlantis, Halling - who, along with his fellow Athosians, now feels unwelcome at Atlantis - requests permission to farm the land and live there until Athosion travel through the stargate can resume and his people can go offworld to trade again. Weir grants the request and sets up communication between the Athosions' new "home" and Atlantis. Teyla decides to stay after Sheppard tells her that he needs her on his team.
But the next time the team goes offworld, accompanied by anthropologist Dr. Corrigan, they once again find the Wraith waiting for them. None of the Athosians, who were relocated from Atlantis to the land mass, could have tipped off the Wraith - except for Teyla, who had insisted on going off, alone, in search of this planet's indigenous people. In the frenzy of battle, Teyla and Ford are both left behind as Sheppard's team retreats through the stargate and Weir raises the 'gate shield.
It seems obvious that Teyla is the Athosian who's been informing the Wraith - but Sheppard can't believe it. He and McKay want to mount a rescue mission, but Bates and Sgt. Stackhouse advise against it. While the debate goes on, Teyla's ID code comes through. She pleads for Weir to activate the 'gate and says Ford is wounded. Bates warns Weir that dropping the shield could open up Atlantis to a Wraith attack. But Sheppard puts a security team in place and demands the 'gate be opened. Weir complies, and Teyla drags an unconscious Ford through. She is immediately interrogated by Bates - who has secretly asked McKay to go through Teyla's belongings to see if there's anything that could either prove her guilt or exonerate her. McKay, disgusted at the request, nonetheless complies - and discovers the truth. In a way, Bates was right.
McKay explains that Teyla's locket, which her father had found and given to her when she was a child, is a Wraith device created to detect Ancients. When Sheppard, who has the Ancient gene, touched it upon their first meeting, he activated it. It has broadcast a continuous signal ever since. And though the signal isn't strong enough to penetrate the distortion generated by a stargate, it's been giving away Teyla's offworld position. Teyla is innocent - and Sheppard has a plan to use this transmitter against the Wraith.
Sheppard and his team, including Teyla, 'gate to a planet and wait for the Wraith to home in on Teyla's locket. Four Wraith appear. Two are killed in the firefight. One has been tazered and is about to be captured alive when he activates a self-destruct device on his wrist and blows himself up. The last Wraith tangles with Teyla and is about to drain the life out of her when Sheppard stuns it with a blast from a Wraith weapon.
A Wraith has been captured alive.
Back at Atlantis, Weir and Teyla hope that the events of the past week will quickly be put behind them and that the Athosians and Team Atlantis will continue to live in peace. Meanwhile, Sheppard visits Atlantis' newest "guest" in the Wraith's force-shielded cell. The Wraith tells Sheppard it is only a matter of time before his kind come for him and lay waste to Atlantis. Sheppard reminds the Wraith it is only a matter of time before he starves to death - and that soon, he'll be willing to tell Sheppard anything.