...According to this quote:
Texas Administrative Code
Whenever hydrocarbon or geothermal resource fluids are encountered in any well drilled for oil, gas, or geothermal resources in this state, such fluid shall be confined in its original stratum until it can be produced and utilized without waste. Each such stratum shall be adequately protected from infiltrating waters. Wells may be drilled deeper after encountering a stratum bearing such fluids if such drilling shall be prosecuted with diligence and any such fluids be confined in its stratum and protected as aforesaid upon completion of the well. The commission will require each such stratum to be cased off and protected, if in its discretion it shall be reasonably necessary and proper to do so.
(2) Prohibited pits. No person may maintain or use any pit for storage of oil or oil products. Except as authorized by paragraph (4) or (7)(C) or (8) of this subsection, no person may maintain or use any pit for storage of oil field fluids, or for storage or disposal of oil and gas wastes, without obtaining a permit to maintain or use the pit. A person is not required to have a permit to use a pit if a receiver has such a permit, if the person complies with the terms of such permit while using the pit, and if the person has permission of the receiver to use the pit. The pits required by this paragraph to be permitted include, but are not limited to, the following types of pits: saltwater disposal pits; emergency saltwater storage pits; collecting pits; skimming pits; brine pits; brine mining pits; drilling fluid storage pits (other than mud circulation pits); drilling fluid disposal pits (other than reserve pits or slush pits); washout pits; and gas plant evaporation/retention pits. If a person maintains or uses a pit for storage of oil field fluids, or for storage or disposal of oil and gas wastes, and the use or maintenance of the pit is neither authorized by paragraph (4) or (7)(C) or (8) of this subsection nor permitted, then the person maintaining or using the pit shall backfill and compact the pit in the time and manner required by the director. Prior to backfilling the pit, the person maintaining or using the pit shall, in a permitted manner or in a manner authorized by paragraph (3) of this subsection, dispose of all oil and gas wastes which are in the pit.
... at least some references exist to consult a kind of retained fluid like reserve pit, mud circulation pit, fresh makeup water pit, fresh mining water pit, ompletion/workover pit, basic sediment pit, flare pit, or water condensate pit shall dewater;...
...I guess that part of this info was obtained of some international code, but I don't get it.