A player cannot lose his protection before the expiry time; the system will never allow that, and the reasons for losing protection when a player do one of these:
-Declaring war or giving a rally command
-Scouting another base.
-Seizing resources locations that are occupied by another commander.
-Attacking another player's unit which is holding and stationed an empty location
-Scouting or sending your troops to the battle lab when another player has pressed the location is considered an attack

* besides, all these actions in the events will result in losing your protection too :
-Attacking the Rebel warehouse (The Cross-server border war).
-Starting a rally attack against in (the converged rebels robot).
-Joining a rally against the Rebel bosses.
-Clicking on (Stationed troops) inside the (Unclaimed lands gate) will lose your protection, but attacking inside the event will not.