Agricultural import trade plays a substantial role in ensuring food security and Sustainable Development Goals; however, its effectiveness under the impact of international sanctions remains unclear, particularly regarding the inherent conflict between reducing import dependency and protecting domestic environmental sustainability. This study utilizes global agricultural trade and sanctions data from 2000 to 2019 to empirically investigate the impact of sanctions and uncover its specific internal mechanisms. The findings reveal that sanctions have reduced the import dependency of sanctioned countries by about 6% on average. Notably, improving domestic production in sanctioned countries is instrumental in mitigating the adverse effects of sanctions on food security, but it increases the emissions of CH4, N2O, biomass burned and the use of fertilizer and pesticide, which destroys the domestic environmental sustainability. These results imply that reducing import dependency on external markets improves the “availability” and “stability” of food security without sacrificing “agency,” but it exacerbates “access,” “utilization,” and “sustainability.” These findings are significant for proactively addressing and alleviating the impact of sanctions on agricultural sustainable development.