Abstract This paper studies the interaction between index insurance market and the rural credit market by investigating how the availability of index insurance affects borrowers' moral hazard behavior. Among different types of moral hazard problem in the credit market, we focuses on credit diversion, which occurs when borrowers violate loan contracts and use some or all of production loans for consumption purpose. We build a theoretical model to show that credit non-diverters are likely to benefit from and purchase index insurance, while credit diverters are not. For credit non-diverters, index insurance provides consumption smoothing and increases future income by preventing loan default. For credit diverters who are already implicitly insured by diverting credit from risky investments to consumption, index insurance increases their consumption risks and can even lower expected consumption level. The fundamental reason for the difference of the impact between credit diverters and non-diverters is that index insurance pays indemnities based on external indices rather than farmers' realized outcome. Therefore, the availability of index insurance encourages farmers to choose full investment of loans instead of credit diversion. To test these theoretical predictions empirically, we conducted a framed field experiment with 450 rural households in the north region of China. Coinciding with theoretical predictions, experimental results show that index insurance reduces the number of credit diverters by 75.8%. The treatment effect on credit diversion is heterogeneous across farmers depending on their risk preferences and ethical costs associated with violating loan contracts. The theoretical and empirical results have important policy implications for stimulating credit supply to agriculture and reducing credit rationing. They suggest that lenders can use index insurance as a signaling instrument to overcome information asymmetry in the credit market. Index insurance can be substituted for collateral requirements and lessen both quantity and risk rationing caused by collateral requirement.