We evaluate the behavior of a device designed to automatically divert and store the first flush of harvested rainwater in cisterns. The first phase (PI) was conducted with artificial precipitation in an experimental installation seeking to identify how many millimeters of rainwater should be diverted to preserve the rainwater quality. In the second phase (PII), we designed a PVC-pipe device to store the first millimeter of rainwater, and tested it in field (a rural area in Brazil) during two real rainfall events. In the third phase (PIII), the device and a hand pump were assayed for two years using eight cisterns in a rural area where people drink the rainwater. PI results indicated that the most significant pollution of the rainwater is flushed with the first millimeter of rain, and diversion promoted the removal of 98% and 100% of the total coliforms and Escherichia coli, respectively. The bacteriological behavior was maintained in the subsequent phases. The device was able to preserve the quality of the rainwater most of the time, satisfying drinking requirements for the parameters of turbidity and color. The satisfactory performance of the device was confirmed in the field, behaving as a sanitary barrier for rainwater quality protection.