When Kira brings a terminally ill Odo back to the station for medical treatment, he orders her to leave him and return to help the Cardassian Resistance. Later, O'Brien and Bashir inform Sisko of their plan to lure a Section 31operative, who may hold the cure to Odo's disease, to the station. The scheme works when Sloan, the director of the unsanctioned Starfleet extremist organization that infected Odo — as part of a genocidal plot against his people — arrives. But when Bashir places a Romulan mind probe on the agent, who refuses to give information regarding a cure, Sloan attempts suicide in the science lab by activating a neuro-depolarizing device in his brain.
Although Bashir manages to stabilize Sloan, he has suffered severe brain damage and the doctor expects him to die within an hour. Refusing to give up, Bashir masterminds a device that will allow him to link his mind to Sloan's and discern the cure. O'Brien, worried that Bashir will be incapable of returning from the mind-link, insists on joining him.
Inside Sloan's brain, O'Brien and Bashir meet Sloan's wife, who hands Sloan a recorded file which supposedly contains the cure. But when Sloan offers it to Bashir, a phaser bolt hits him in the back; the shot has been fired by a second Sloan, who vanishes with the file, leaving O'Brien and Bashir alone in Sloan's mind.
In the science lab, Sisko and Ezri discover the unconscious bodies of O'Brien, Bashir and Sloan, while, inside Sloan's brain, O'Brien and Bashir seek a way out — but before they can escape, the two men are confronted by another Section 31 operative, who injures them with phaser fire. Intent on escaping death, the two men appear to regain consciousness. Back at the science lab, Bashir insists they must reenter Sloan's brain — but the agent dies.
Soon, Bashir and O'Brien realize that Sloan's mind is playing tricks on them: they're not in the science lab after all; they're still inside his brain. Knowing the clock is running out, they search Sloan's mind for clues and, finally, find the information they desperately want. The two escape just before Sloan really dies — and deliver to a grateful Odo the hypospray which saves his life.