Just like medicines, pesticides are subject to regulations. Farmers must comply with Good Agricultural Practice (GAP), following the basic principle of using pesticides as little as possible and only when necessary.
The use of pesticides is authorised only after an independent expert risk assessment has checked that any residues remaining after correct use of the product will not lead to any consumer concern nor harm the environment.
The potential residues on a harvested crop are regulated by a Maximum Residue Level (MRL) which is set based on data and As Low As Reasonably Achievable; the ALARA principle.