Auto-DestructAuto-Destruct: General Rules
Every Starfleet vessel can destroy itself to avoid capture. The sequence needs command authorisation codes and puts the ship on red alert, and the countdown may be audible or silent. On older ships it cannot be stopped in the last five seconds.
Canon · TOS: Let That Be Your Last Battlefield; Star Trek III: The Search for Spock; TNG: 11001001; TNG: Where Silence Has Lease; Star Trek: First Contact · Codes, Alerts and Command Procedures