Whether you must clear security during a layover depends entirely on your arrival and departure terminals and the specific laws of the country you are transiting through. For domestic-to-domestic layovers in the United States, you typically stay "airside" and do not need to pass through security again. However, if you are arriving on an international flight to the U.S., you are legally required to clear Customs and Border Protection (CBP) and then re-pass through TSA security to reach your connecting gate, even if your bags were checked through to the final destination. In many international hubs like London Heathrow or Dubai, passengers transferring between certain terminals may also be required to go through a secondary security screening. If you decide to leave the airport during a long layover to see the city, you will absolutely have to clear security upon your return. The general rule is: if your transit requires you to exit the "secure" zone or enter a different country's jurisdiction, a security re-screening is almost always mandatory to ensure the safety of the next flight segment.