The COVID-19 pandemic and geopolitical conditions in 2022–2023 highlighted the vulnerabilities of food supply chains to trade disruptions in agricultural inputs and foods, with the ensuing economic effects on producers and consumers. This study calculated the impact of various disruptions in the trade of agricultural inputs and outputs for Swedish producers and consumers and for food security. To this end, a mathematical programming model of the food sector with a spatial dimension was applied, which accounts for adjustments and interactions between producers and consumers of food. Food security is measured in terms of the self-sufficiency ratio, the ability to produce minimum dietary needs, and economic access for low-income households. The trade scenarios included disruptions to imports of agricultural inputs (fertilisers, fuel, feed, pesticides and foreign labour) and foods. The results showed that the economic effects for producers can be considerable, with a reduction in producer surplus by up to 75%. The decrease in consumer surplus is smaller, amounting to a maximum decrease of 21%. The self-sufficiency ratio and the ability to produce minimum dietary needs can be reduced by 55% and 61%, respectively, but may rise if the disruption to feed imports increases. Economic access to foods is slightly decreased in all scenarios. These results showing different impacts of trade disruptions on producers and consumers and food security metrics highlight the need to undertake extensive assessments to determine whether and how to prevent and mitigate their effects. The economic effects on producers and consumers and the associated impacts on food security are likely to differ, which affects the selection and targeting of policies, such as compensation for economic losses and promotion of food security.