Halide perovskites make efficient solar cells but suffer from several stability issues. The characterization of these degradation processes is challenging because of the limited spatiotemporal resolution in experiments and the absence of efficient computational methods to study these reactive processes. Here, we present the first reactive force field for molecular dynamics simulations of the phase instability and the defect-induced degradation in CsPbI3. We find that the phase transitions are driven by the anharmonic fluctuations of the atoms in the perovskite lattice. At low temperatures, the Cs cations tend to move away from their preferential positions, resulting in worse contacts with the surrounding metal halide framework which initiates the conversion to a nonperovskite phase. Moreover, our simulations of defective structures reveal that, although both iodine vacancies and interstitials are mobile in the perovskite lattice, the vacancies have a detrimental effect on the stability, leading to the decomposition of perovskites to PbI2.