Attapulgite and bentonite are used in the drilling of oil and water wells. When exposed to water, these clays swell considerably, making them ideal for protecting subterranean formations from invasion by the other drilling fluids making up the mud by providing a thixotropic effect. However, it is mainly used as circulation mud in rotary drilling systems. The chief purpose as a drilling mud is to lubricate and to cool the cutting bits, to carry away cut rock fragments, and to act as a seal against the escape of gas from the bore hole. Another related function of such clay-based fluids is to prevent the hole from blowing out and to condition the wall of the drill hole to prevent caving-in.