Some pumps have a GFCI (Ground fault current interrupter). You can also buy a GFCI separate and some pump instructions will require one although nobody adhere to that requirement including me. It will trip as soon as there are any ground fault or earth leakage.
However, your normal modern earth leakage circuit breakers (the green breaker on your board) that you should have on your normal supply anyway, should also do that and trip within milli seconds after a leakage.