Biotic factors such as pests create biodiversity effects that increase production risks and decrease land productivity when agriculture becomes more specialized. We show in a Ricardian two-country trade setup that production specialization is incomplete under free trade because of the decrease in land productivity. Pesticides allow farmers to reduce these biodiversity effects, but they are damaging for the environment and for human health. When regulating farming practices under free trade, governments face a trade-off: they are tempted to restrict pesticide use compared to under autarky because domestic consumption partly relies on imports and thus depends less on them, but they also want to preserve the competitiveness of their agricultural sector on international markets. We show that at the symmetric equilibrium under free trade, restrictions on pesticides are generally more stringent than under autarky. As a result, trade increases the price volatility of crops produced by both countries, and of some or all of the crops that are country-specific, depending on the intensity of the biodiversity effects.