Answering a distress call, the away team finds a device embedded in a rock that proves to be a form of artificial intelligence. It has bio-neural circuitry and, with the help of the Doctor's translating, reveals it is suffering from a technical form of amnesia. The machine thinks it is an organic being, but once it is beamed to Voyager, the Doctor explains what has happened. Scanning the planet's surface, Janeway finds a crater filled with radiogenic decay and realizes they have beamed aboard a weapon of mass destruction.

In sickbay, Torres attempts to separate its bio-neural circuitry from the explosive, and download its synaptic patterns into a holographic matrix. Suddenly, the weapon arms itself, and Torres is forced to use an EM pulse to short it out. She and Kim soon discover the machine has commandeered the Doctor's program. It now recalls it is a long-range tactical armor unit, which was deployed at a target it never reached. The machine, speaking through the Doctor's body, tells Janeway that she will help him find his target, or her ship and crew will be destroyed.

After Janeway is given new coordinates to follow, Neelix locates a merchant who may be familiar with the weapon. He offers to disarm it with his transporter's dampening field in exchange for full access to salvaging its parts for sale. Wary of handing the weapon over to a stranger, Janeway refuses. When the merchant's ship tries to get a transporter lock on the machine, it sends an antimatter surge back through the beam and blows up the ship. Meanwhile, Seven realizes her nanoprobes can be adapted to disable the weapon's circuitry.

Paris plans to make the machine believe they are navigating a minefield. When Seven of Nine is brought into sickbay pretending to suffer from burns, Tuvok will disrupt the Doctor's program. This will give Seven enough time to inject her nanoprobes into the weapon and disable it. Meanwhile, Kim and Torres retrieve lost data from the weapon's memory files, which reveal its launch was a mistake. He thinks they are deceiving him and refuses to abort. The plan fails, and Voyager is suddenly surrounded by 32 self-guided weapons.

The machine is ordered to transport off Voyager to the target, but Kim persuades him to look for his people's confirmation code in the rest of his memory files. When he confirms the order to cease his mission was valid, he tells the other weapons to stand down. They cannot be diverted, so the weapon reconfigures his bio-neural matrix and joins the others. Once he leads them to a safe distance, he detonates and destroys them all.