The USS Voyager is passing through Devore space, where telepathy is illegal and telepaths are sent to relocation centers. Devore warships are far larger and more powerful than Voyager, so the ship is subject to frequent inspections to check for telepaths. As the episode opens, one of these inspections, complete with rough treatment of the crew and their equipment, is underway.
The lead Devore inspector, Kashyk, takes up residence in Janeway's ready room. He plays Mahler's first symphony throughout the ship to "relax" the crew. However, Kashyk expresses an interest in human culture, allows Voyager to get away with a course deviation that his assistant, Prax, says would normally result in it being impounded, and suggests that Janeway could use a friend like him.
The Devore ships then leave Voyager, after which Captain Janeway orders that twelve Brenari refugees, along with several members of the Voyager crew, all of whom are telepathic, be brought out of transporter suspension in cargo bay one, which contains contaminated antimatter to block Devore sensors.
Soon after, Kashyk returns to the ship, this time alone. He tells Janeway that he knows all about the telepathic refugees and that the nebula containing a wormhole that she plans to transport them to for their escape is a Devore trap. He says that he is defecting and requests asylum on the ship in return for his assistance in avoiding Devore ships. She agrees to grant him safe passage out of Devore space if the Brenari are amenable.
The Brenari leader, Kir, agrees to cooperate. Kir points Janeway to a scientist, Torat, who can help them predict the next appearance of the wormhole. At this point, Janeway begins to cooperate with Kashyk. Torat is reluctant to help Voyager, so she introduces Kashyk as a fellow professor who doubts his work. To prove himself, and in exchange for mercurium isochromate, Torat provides the two with some data on the wormhole. Later, the two work to pinpoint the next appearance of the wormhole. After standard algorithms fail, Janeway, considering the music that is playing in the background, suggests that the pattern may be found in a subspace counterpoint. This time, the computer analysis works, allowing the next occurrence of the wormhole to be predicted.
Unfortunately, Voyager is soon detected by a Devore scanning array. Janeway plans to fight the ships with the new information about them she has obtained from Kashyk. But he tells her she will never survive against two of them and offers to take command of the impending inspection to ensure the refugees escape. She agrees, and the two kiss before Kashyk leaves in his ship.
The Devore inspectors soon board the ship. Janeway meets Kashyk in her ready room, who plays Tchaikovsky's fourth symphony, second movement and demands that she cease altering her course and leave Devore space. After sending Prax away, he asks about the wormhole. She tells him it is off the port bow and a photon torpedo will open it. He then congratulates her, ordering Prax to Cargo Bay one to capture the refugees and ordering two photon torpedoes to be fired to destroy the wormhole.
However, he soon realizes that it is he who has been double crossed. The neutrino emissions indicating a wormhole off the port bow are actually antimatter residue signatures, and it is not refugees, but cargo containers filled with vegetables, that are suspended in the transporters in Cargo Bay one. Janeway changes the music to Mahler's first symphony, while the refugees escape through the wormhole via shuttlecraft. Prax suggests that Voyager be impounded and the crew sent to relocation centers, but Kashyk, noting the effect the loss of the telepaths would have on both of their careers, leaves the ship and allows Janeway on her way.