Plants are widely used to filter environmental toxins.
For example, certain bog plants are planted in stormwater settling basins to treat runoff.
Commercial fertilizers are different from what you're thinking of, although plants ARE used to filter out fertilizer and manure runoff from agricultural land before it gets to a water supply so there is no algae bloom, and the need for flitration is reduced.
If you are still worried, the 2 big things to do are:
Go organic
FLUSH before harvest.