When I grew in dirt, fungus gnat larvae came in the soil bags sometimes so I had to use preventative sprays. I used gnatrol and alternated with azamax. Gnatrol works great on gnats and supposed to be harmless to humans. I believe azamax is neem oil based and it covers more pests like mites, thrips and aphids. Azamax is also more $$ but the combination did a good job. I still had a few gnats last grow but I just drenched the soil with gnatrol a couple of times and they were gone.