After Riker welcomes on board Ensign Mendon, a slightly arrogant Benzite on board as part of Starfleet's new exchange program, he discusses the program with Picard, who thinks an Enterprise officer should participate. When Riker hears there's a Klingon vessel in the area, he volunteers eagerly.

As the Enterprise heads to rendezvous with that vessel, the Pagh, Worf discusses Klingon policy with Riker, particularly the idea that the first officer's duty is to assassinate the captain should he become weak. Riker later samples Klingon food in preparation for his new assignment. Just before he leaves, Worf gives him an emergency transponder to ensure his safe return.

When they arrive and rendezvous with the Pagh, the captain, Kargon, immediately orders Picard to beam Riker over. On the bridge, Mendon notices a strange form of bacteria on the Pagh, but says nothing. Riker is wished well and beamed over.

One of the first things he does is answer a challenge to his authority as first officer from his second officer, Lt. Klag. Meanwhile, Enterprise sensors detect the same substance on its hull. When Mendon mentions that he saw it earlier, he is chastised for not reporting it then (though Benzite procedure required that he not mention the problem until he had a working solution). He is put to work, with Data, to analyze the bacteria and find out everything he can about them.

Riker, in the mess hall of the Pagh, deals with such novelties as live serpent worms ("Gagh is always best when served live," says one Klingon), and two Klingon women expressing curiosity about how he would endure "them". Meanwhile, Mendon and Data find out that the Pagh contains more of the compounds the bacteria feed on, and thus are more vulnerable, and the Enterprise begins searching for the Pagh.

Kargon, however, has already found the damage, and is convinced this is Federation treachery. He begins planning to attack the Enterprise, and doubles his efforts when they discover the Enterprise is on an intercept course. When he orders Riker to give him the secrets of the Enterprise, however, Riker refuses, saying it is possible for him to follow his oath to the Pagh without breaking his oath to Starfleet. Mendon figures out how to remove the bacteria, and Picard puts that in the hailing message, but Kargon still insists on attacking.

Riker then takes out his transponder and tricks Kargon into taking it. When the Enterprise accidentally beams Kargon onto the bridge, Riker becomes captain of the Pagh, and orders the Enterprise to surrender. Picard agrees, and commences repairs on the Pagh. Kargon is returned to his ship, and throws Riker off it. Riker returns to the Enterprise and commends Worf on his noble race.