While working in the station's ore processing unit, O'Brien and Jake accidentally activate an automated Cardassian security program, which traps the pair and Sisko in the room. Throughout the station, monitors display an old message from Gul Dukat warning of a Bajoran "worker revolt" in the unit. Dax tries to beam out the three, but the computer requests an access code, which the Cardassians never revealed when they abandoned the station years ago. Jake crawls through a pipe and opens the hatch to the ore chute, allowing Sisko and O'Brien to get out just as lethal neurocine gas is released. Dukat's image reappears, announcing that the "workers" have escaped, after which the doors to Ops all slam shut.
Sisko, O'Brien, and Jake are now trapped in an ore processing bay. A force field keeps Dax, Bashir, and Kira stuck in Ops, while another one holds Odo and Quark in the Security Office. Dax inadvertently activates the security program's second level, a program designed to release neurocine gas through most of the station in five minutes. Garak suddenly arrives at Ops, using his Cardassian access code — which only works for him — to enter through the force field. At his suggestion, Kira destroys the life support system, which stops the gas and gives them twelve hours to regain control before the oxygen is depleted. Unfortunately, Kira's phaser blast has activated the third phase of the program. Dukat's recorded message now declares that the station is programmed to self-destruct in two hours.
Garak tries to make the computer think he is Dukat, but ends up initiating level four of the program — a series of phaser blasts which forces everyone to take cover. Then, to everyone's surprise, Gul Dukat transports into Ops to taunt the officers. But he can't leave the station when he tries, then a recorded message from his old superior, Legate Kell, appears. Dukat won't be allowed to flee his post during the "revolt," states the message — and his code won't stop the self-destruct.
They determine that the only option would be to reach a control junction and disengage the laser fusion initiator, but can't do anything while trapped in Ops. Meanwhile, Sisko, O'Brien, and Jake blast open the bay doors by detonating the unstable ore left inside, but are stopped from going far by more force fields. Back in Ops, Dax suggests creating a power surge to short out the force fields all over the station. The plan works, and Kira informs Sisko they have ten minutes before self-destruction. Sisko, O'Brien, and Jake have the only chance of reaching the control junction. Realizing they may not have time to disable the fusion initiator, Sisko decides instead to direct the explosion into the deflector shields. He crawls through a burning conduit, makes the adjustments, and as the destruct command is initiated, the shields absorb the blast and the station is saved.