Sent back in time to find out how Earth managed to survive without destroying itself, the U.S.S. Enterprise inadvertently beams aboard a space traveler, Gary Seven, along with his black cat, Isis. Seven claims to be a 20th-century human raised and trained by unknown and unnamed aliens to prevent Earth from destroying itself. Before Kirk can determine whether or not the man is telling the truth, Seven escapes to the planet below. Kirk and Spock follow him to Earth. Meanwhile, Seven has tried to contact two fellow agents, who are discovered to have recently died in an auto accident. Instead, he contacts Roberta Lincoln, who becomes his reluctant cohort.
An orbital bomb is about to be launched by the United States and it is Seven's mission to make sure the rocket explodes somewhere over Asia, thereby frightening the governments into not launching future bombs into space.
When the rocket goes out of control, Seven barely succeeds in stopping it, despite Kirk and Spock's well-meaning interference. Before Kirk and Spock leave Earth, Kirk consults the Enterprise's computer records and informs Seven and Roberta that they have a very interesting future in the offing.