MacGyver accompanies Pete Thornton, new operations director of the Phoenix Foundation, out into the desert to run a security check on the government Strategic Research Development Administration (SRDA) foundation. If MacGyver can't break in, then Phoenix will be convinced it's thief-proof and give it their seal of approval. Upon arrival they meet with Colonel Scott Woodward, who served with Pete in Vietnam. Woodward isn't thrilled with Phoenix's civilian involvement, and doesn't think MacGyver is up for the challenge.
Woodward escorts them in to the underground facility and shows them the security arrangements. First is a pressure-sensitive platform that sets off a laser barrier in front of the elevator. A key card is needed to bypass the barrier and a security code to open the elevator. They descend down to the second of the five levels of the facility and the computer system, nicknamed Sandy, monitors their descent. Next is a handprint scanner and Woodward puts his hand on the sensor and MacGyver goes on ahead while Woodward and Pete argue. MacGyver enters a lab and four mobile drones home in on him. He tests their sensors and they move as he moves. The system designer, Dr. Jill Ludlum, arrives and calls them off, explaining the drones are heat-seekers. She knows all about MacGyver and he knows all about her. MacGyver isn't impressed with the automated systems but Ludlum boasts that Sandy is just shy of a fully-functional artificial intelligence.
As they inspect the facility, Woodward wonders about why Pete left the military. Pet asks about Woodward's wife and the colonel admits that she divorced him because of his dedication to his work. They go to the control room and meet Ludlum and MacGyver. Ludlum is convinced that she's eliminated the human factor from the equation but MacGyver believe no machine is invincible. He bets her a quarter that he can get to her laboratory, and she promises it'll be waiting for him. As they leave, Ludlum explains that all staff leave the facility at midnight, and she's already changed the entry code.
That night, Woodward and Pete monitor the exercise with Ludlum's assistant, Steven Lee. MacGyver slips in holding on to the underside of a delivery truck. Once inside, he watches as the guards take the elevator down. He uses the magnifying lens from a map light and a watch crystal, rolling them up in a newspaper. MacGyver uses the crude telescope to watch them enter the new entry code. Once they leave, he uses a length of rope to lasso the key pad and then walks on the rope over the weight-sensitive floor.
MacGyver descends in the elevator and examines the handprint. He scrapes some plaster off the wall and spreads it evenly on the handprint scanner, picking up Woodward's handprint. He then presses down with his jacket, convincing the system Woodward is requesting access. MacGyver goes to the laboratory only to discover Ludlum knows he's there. She figures he used the truck and staged the entire thing to convince Woodward to eliminate that human weakness in the security system. MacGyver asks for a rematch but Sandy detects his voice and logs him as an intruder. The computer initiates a stage 1 security shutdown and starts extracting the air. Ludlum discovers Sandy is ignoring voice commands and explains they have 30 minutes until the air is gone.
On the surface, Lee realizes what's going on and warns that they're unable to override Sandy. Inside, Ludlum tries to access Sandy via a terminal but Sandy overloads it and MacGyver pulls her to safety just in time. Ludlum checks the systems and realizes that Sandy has achieved true artificial intelligence. They need to get to the main control room to access a mainframe terminal and shut down Sandy.
On the surface, Woodward takes a team to the elevator. He shuts down the laser barrier but when a technician tries to bypass they keypad, Sandy sends an electrical arc through a camera. Lee warns that the shock is a non-lethal warning and Sandy will go to lethal defense measures. He says they can shut down the nearby power station and put Sandy out of business, as the reserve generators haven't been activated yet. Woodward is worried that the power station provides power to a nearby hospital and they could endanger the patients there.
Ludlum and MacGyver try to get to the control room and discover another laser barrier. MacGyver puts a broken piece of washroom mirror on a chair and uses a mop bucket cart to wheel the mirror into the laser barrier, reflecting the lasers back and burning out the mechanism. However, two mobile drones close in on them. MacGyver shoves Ludlum down a garbage disposal hatch and they find themselves in an empty chamber. Ludlum warns that if the total weight exceeds 280 pounds, the floor opens and everything is dumped into an acid bath. The floor starts to open and MacGyver uses his pants and uses them to suspend them from the overhead pipes. They then swing over to the access hatch and get out.
Lee contacts the power station but Woodward refuses to authorize a power shutdown. Pete calls the station on his own and gets them to cut off the electricity. However, Sandy accesses the backup generator codes and restores the power.
Below, Ludlum explains that Sandy is programmed with her own thought processes, but without the emotion. MacGyver suggests they go with their instincts. The drones close in on their position and they take refuge in a nearby laboratory. MacGyver comes up with a plan and removes the magnets from the phone receivers. He then wraps them in paper and set them on fire, and he and Ludlum throw them onto the drones. The drones fire on each other, and three of them end up destroying each other. The last one retreats to the control room and Ludlum realizes they can't get to a mainframe terminal in time.
They discover they're unable to get to the control room and they have only 12 minute of oxygen left. Ludlum thinks it's hopeless and MacGyver figures Sandy will reach the same conclusion. He goes up into the ventilator shaft and takes Ludlum with him.
Outside, Pete figures that MacGyver will bypass the elevator shaft and look for another way out. There are only two other exits: the exhaust outlet and the maintenance shaft. However, Lee warns that both exits are mined, and they only have time to disarm the mines at one exit.
MacGyver and Ludlum go to the exhaust outlet and MacGyver cuts the power cable powering the exhaust fan. However, Sandy seals the outlet with airtight doors. With time running out, Pete tries to convince Woodward to make a decision. In Vietnam, they lost three men when Woodward refuses to go outside procedure and make a call in the field. Woodward agrees to let Pete make the call and defuse one of the exits.
MacGyver finds a wheel for the door and prepares to open it, but Ludlum warns that the exit is mined. MacGyver grabs an emergency light and cuts off the light, then plugs in the cable and extends it toward a nearby control box to short out Sandy. It just reaches, but Sandy feeds power back into the cable MacGyver cut. It sprays sparks and MacGyver grabs it and shoves it into the control box. Sandy shuts down and MacGyver opens the door, trusting in Pete. The door opens… and nothing happens.
As the military dismantle Sandy and remove the drones, Ludlum is sorry they had to shut down Sandy and promises to get her back online… safely. She notes that humans are emotional and irrational, but she won't factor them out of the equation in the future. She kisses MacGyver, while Pete and Woodward part as friends. As they leave, Pete explains to Ludlum that he knew MacGyver would take the exhaust vent because he used the same escape route to escape a fire at a chemical plant. However, MacGyver notes that he didn't use an exhaust outlet, and Pete has the good grace to look sheepish.