What keeps the derailleur battery from falling off?

The batteries are attached to the derailleurs by a tool-free latching mechanism.