The two barrier rule is a policy of safety for work on piping carrying high pressure and/or high temperature fluids. It is commonly used by oil companies. The rule simply states that for any work that must be done on a section of piping, which involves breaking containment, there must be at least two barriers separating the fluids from the broken area. The purpose behind specifying two barriers is to ensure redundancy. The risk of a total loss of containment is reduced if there are two independent isolations as it is highly improbable they would both fail at the same time.
For example, if a section of pipe from a production line leading from a Christmas tree to the process plant, were to need replacement, this area of the piping would need isolation before the offending section was removed or oil would be able to flow freely out of the piping into the environment, causing environmental damage, a health and safety hazard and waste of a precious resource. Under the two barrier rule, there must be two separate isolations between the oil flowing from the well to this area of the piping. The logical barriers in this case would be the production wing valve and the upper master valve.
Uncontrolled release of pressure has been the cause of many accidents in the oilfield and so the two barrier rule is considered very important for increasing safety.