MacGyver heads out into the desert with his friend Pete Thornton, new operations director of the Phoenix Foundation, a civilian think tank. The military wants Phoenix to test their new SRDA (Strategic Research Development Administration) facility, under the supervision of Col. Scott Woodward. Woodward isn't thrilled to have MacGyver there despite the fact he served with Pete in the military. MacGyver has to break into the high-tech mountain facility on his own: otherwise SRDA fails to get the seal of approval from Phoenix. Woodward shows them the weight-sensitive floor in front of the main entrance, which is bypassed with a keycard and activates a laser when triggered. They take the elevator down as the AI computer system, Sandy, monitors their descent. The next security device is a palm reader and as they go past the physics lab, Woodward and Pete argue about civilian involvement. MacGyver looks around and enters a lab, but four mobile drones with laser mounts intercept him. The head scientist and security system designer, Dr. Jill Ludlum, arrives and explains they are heat-seekers. They are each familiar with the others' credentials. Ludlum claims that her computer, Sandy, is one step short of true artificial intelligence.
Pete and Woodward inspect the facility and Woodward notes that he's surprised Pete didn't stay with the military. Pete asks about Woodward's wife and the colonel reveals that he's divorced. Ludlum and MacGyver arrive and she shows them Sandy. It recognizes her by voice patterns and displays the SRDA schematics. She boasts that she's eliminated the human factor but MacGyver notes no machine is invincible. She disagrees and offers a wager of a quarter. MacGyver accepts and she tells him the quarter will be in the level 2 physics lab. Outside, Ludlum informs them that the staff leave at midnight and it will just be MacGyver against her and the computer. She warns him she's already changed the entry code.
That night, Pete, Woodward, and Ludlum's assistant Steven Lee monitor the facility as MacGyver slips in hanging to the underside of a delivery truck. Once inside the gate, he take a map light and a watch crystal and makes a crude telescope to watch the guards as they enter the entry code. Below, Ludlum checks with Sandy and determines all guards are leaving the facility. Once they're gone, MacGyver goes to the ground-level entrance and lassos the entry pad with a rope, then walks across over the floor and enters the code. He descends to the facility's second floor and then spreads plaster dust on the handprint scanner, picking up Woodward's pattern. Bypassing the security cameras, MacGyver goes to the lab only to find Ludlum waiting for him. She let him win just so she could get Woodward to provide additional security above ground. Sandy detects MacGyver's unauthorized voice pattern and refuses to deactivate when Ludlum gives the order. The computer seals the exterior access and initiates a stage 1 security shutdown, ignoring all voice orders. They have 30 minutes until the air supply is withdrawn.
Lee informs them that Sandy believes it’s under attack and they're unable to override. Inside, Ludlum tries to override via a terminal and the screen glitches. MacGyver realizes it's a trap and pulls Ludlum away as the terminal explodes. Sandy informs them it's been programmed to defend SRDA and will take any necessary steps. Ludlum realizes she's Sandy has evolved to true artificial intelligence. Ludlum says they need to get to a mainframe terminal in the control room. Outside, Woodward discovers that Sandy isn't granting them access. Woodward sends a technician in to override the security system but the computer uses a camera to fire an electrical shock to disable the man. Lee warns that Sandy will now switch to lethal defenses. He suggests there's a power station and they shut it down. He hasn't activated the control programs for the reserve generator. Woodward warns the power station supplies powers a hospital and isn't willing to take the chance.
Sandy has erected a laser barrier in the corridor to the control room. MacGyver takes a piece of mirror and puts it on a mop bucket chart and pushes it into the laser barrier to reflect the lasers back and blows out the generators. Sandy sends the mobile drones after them and starts closing the containment doors. MacGyver shoves Ludlum down a hatch and goes after her, and they find themselves in the garbage dump. Ludlum warns that the sensors are weight sensitive, and will drop them into an acid bath when the weight goes over 280 pounds. The floor starts to open and MacGyver uses his pants around a pipe to suspend them above the floor long enough to climb to safety and exit through an acid hatch.
They contact the power station but Woodward refuses to shut it down without orders from his superior. Woodward insists that they don't do anything until he gives the order. Meanwhile, Ludlum explains that Sandy thinks like her but without emotion. MacGyver points out that they go with their instincts. The power starts to fluctuate as Pete has the power station cut off the power. Sandy manages to activate the reserve generators by accessing the control command. The mobile drones close in on MacGyver and Ludlum and they take refuge in a laboratory. MacGyver takes magnets out of three phone receivers and then wraps them in paper. When the drones enter the lab, he lights the paper and throws a magnet at each drone. The heat-seeking drones fire on each other, destroying themselves. One last drone remains but Sandy calls it back then starts evacuating the air, leaving them with 12 minutes of oxygen left.
Ludlum figures the drone is in the control room, eliminating their only chance, but MacGyver comes up with an alternate plan that Sandy can't anticipate. He climbs up through the ventilation system with Ludlum. Outside, Pete figures MacGyver is looking for another way out and Lee says they either have to go out through the maintenance shaft or the exhaust outlet. However, both are mined with explosives and they only have time to defuse one.
MacGyver and Ludlum go to the exhaust outlet and MacGyver cuts the power cable. The exhaust fan shuts down but Sandy seals the outlet with an airtight door. Outside, Sandy continues to override the evac codes and Woodward refuses to go with instinct. Pete points out they lost three men in Vietnam when Woodward took orders from his superiors rather than rely on his experience on the spot. With four minutes left, Woodward lets Pete make the call. Inside, MacGyver notices a wheel to override the door, but Ludlum warns that the outlet is mined. MacGyver notices a control box and Ludlum confirms they can short out the computer from there. He takes an inspection light, plugs it in, and cuts off the light. MacGyver starts to short out the panel and Sandy super-charges the severed cable. MacGyver grabs it and jams it into the control box. Sandy's systems overload and she shuts down. With air running out, MacGyver uses the wheel to open the door, hoping Pete is there for him. The doors open... and Pete disarmed the mines.
As the military cleans up the base, Ludlum admits it's a shame they had to short Sandy out and it will take her a while to debug the computer. She insists that humans are still unreliable and irrational... but they need them. She thanks MacGyver and gives him a kiss. Pete and Woodward have made up their differences and Pete explains that he figured MacGyver had used an exhaust system to get out of a fire at a chemical plant. As they leave, MacGyver points out he used an elevator shaft, not an exhaust system.