The primary safety issue aimed at with a nuclear reactor is to prevent radioactivity escaping from the plant, and all safety design effort is essentially aimed at this. The most active part of the reactor is the fuel. All reactors have the fuel encased in leaktight sheaths, in the PWR and BWR these are made from Zirconium, but in some reactors they may be stainless steel, and in the obsolete gas cooled reactors were a magnesium alloy. Whatever the material, all possible reactor faults and accidents must be assessed thoroughly to ensure no combination of faults could cause the fuel sheath to be damaged and for there to be a loss of coolant, which would spread activity outside the reactor.
The reactor itself can be shutdown very quickly, in seconds, by inserting the control rods, and this is made automatic on detecting certain faults, and the desk operator can also scram the reactor directly. Should the fault originate with a disconnection from the output power lines, the main reactor water circulating pumps will lose their supply, because the turbine/generator will also shutdown. Therefore smaller emergency pumps are provided, with backup diesel generators, so that reactor circulation can continue. This is important as the fuel continues to emit decay heat after the reactor is shutdown.
Secondary containment is provided for PWR's and BWR's so that a leak of water/steam from the primary circuit cannot escape to the outside world. In the Three Mile Island incident a leaking valve did cause an escape and the loss of water did cause fuel damage, though the actual escape of radioactivity was fairly small. This shows how important it is for the operators to have adequate information about the state of plant, and to be well trained in dealing with faults. This is another aspect of safety, and new designs have been improved. It's very important for the operating manuals to be drawn up correctly and for the operators to know them well.