AbstractContract farming can be an effective measure to deal with agricultural production risks. This study provides a two‐stage stochastic programming model to analyze farmers’ cooperation in the context of contract farming under uncertainty. It provides a fair cost allocation policy for a coalition of farmers using a stochastic linear duality approach. A fair cost allocation implies that no subset of farmers has an incentive to leave the coalition. Thus, a fair allocation policy ensures the stability of a coalition. Meanwhile, the risk pooling game is shown to have population monotonicity, which means that, every time a coalition adds a new member, each farmer within the coalition will incur a smaller cost. Hence, the population monotonicity gives an incentive for coalition expansion. Our results not only provide a simple way to design fair cost allocation policies for collaboration strategies in contract farming, but also play an important role in the sustainable development of farmers’ coalitions.