Weather extremes and high population growth are challenging the achievement of SDG 2 Zero Hunger in West Africa. However, future food security scenarios are often based on models that ignore annual weather variability and weather extremes. As a result, this approach also disregards the risk of having lower than expected yields, with adverse consequences for food security and farmer livelihoods. Here we present a stochastic food production model to show how optimal crop allocations change depending on food security risk targets. To guarantee stable livelihoods for farmers, we examine the viability of a contingency fund that supports farmers in the event of low crop yields. Applied to the West African context, accounting for weather variability can substantially improve the reliability of the food supply and boost the fiscal sustainability of a contingency fund. Yet, setting reliability targets for food security is costly and leaves high residual risk in certain regions. Spatial risk-sharing through regional cooperation at the West African scale can eliminate the risk of insufficient food supply and further enhance the fund solvency without additional cost.