One problem is that we usually take the easy approach to designing pesticides. They tend to be poisonous to a wide variety of animals, instead of just to the specific pests we are actually trying to kill.

Then we have to come up with some way to try to keep things other than the pests from getting exposed. Maybe we try to make it break down into something safe before it gets farther up the food chain. Maybe we make it so it washes off easily so cleaning the food is good enough (and hopefully we do something sensible with the runoff from that washing...).

There's another way, but it takes a lot more work and so it isn't done much. This is to study each specific insect you want to control, to develop a deep understanding of its life cycle. You identify the hormones that are involved in regulating and timing the life cycle.

You then make your pesticide based on those hormones, so that when exposed to it the insect's life cycle gets messed up. For example, suppose you've got an insect that mates and lays eggs during the warmer part of summer, and you find that the eggs need that heat to develop and hatch. Identify the hormones that regulate that, and you might be able to make a pesticide that causes that insect to lay its eggs too early, and the next generation dies out.

The beauty of this approach is that since the hormone your pesticide is based on already occurs naturally in your target insects, whatever is above them in the food chain has already evolved to not be bothered by it. All you are doing is messing with the timing of it in the insect, not its existence. So that hormone based pesticides are inherently much much safer than the general poison based pesticides.

But as I said, this is more expensive. Each species is probably going to require a pesticide specifically for it. This would probably take several PhD entomologists per species working for years.

If you do study a given insect and its life cycle to that extent, you also might be able to learn to control it without pesticides, especially in the case of invasive insects.

For example, lets say you've got an invasive moth that is attacking your crops and devastating them. In its native habitat, that moth's population is kept in check by parasitic wasps that lay their eggs in the moth's larvae. You might be able to deal with the invasive moths by importing those wasps. But you only would want to try that if you knew enough about the wasps to know that they would not become a problem too. If you know that the wasps only lay eggs on the larvae of that one moth species, great...bring a ton of the wasps, they'll wipe out the moths, and then the wasps won't have any place for their eggs and they die too.

Something like this was actually tried once, with an invasion of some Florida pest attacking California citrus groves. They brought in the wasps (or whatever--I don't actually remember if it was wasps, or something else)...and the wasps all died without harming the moths.

Later, they figured out that what they had thought was one species of parasitic wasps was really two very similar species, and only one of those two would control the particular pest they were trying to eliminate. There were only something like two parasitic wasp experts in the whole US at the time, and there are an unbelievable number of different parasitic wasp species so most of them have never been studied extensively.