memory alpha

A sentient cave was an intelligent lifeform that had the outward appearance of a cave.

Ensign Beckett Mariner claimed to have once been trapped in such a cave for weeks, and described it as "a dark place that knows things." Sometime after she was promoted to lieutenant junior grade, Mariner mentioned this lifeform in passing when she and her fellow lieutenants were trapped in a cave with carnivorous moss. (LD: "Second Contact", "Caves")

This lifeform was only mentioned in dialogue.
In Star Trek: The Next Generation - Warped by Lower Decks creator Mike McMahan, Beverly Crusher managed to escape one circa stardate 48156.3, using "highly experimental anti-cave pants." The sentient cave was described as "a menacing antagonistic creature."

See also