  Amongst the X(Sn,Pb)Y$_3$ perovskites currently under scrutiny for their
photovoltaic applications, the cubic B-$\alpha$ phase of CsSnI$_3$ is arguably
the best characterized experimentally. Yet, according to the standard harmonic
theory of phonons, this deceptively simple phase should not exist at all due to
rotational instabilities of the SnI$_6$ octahedra. Here, employing
self-consistent phonon theory we show that these soft modes are stabilized at
experimental conditions through anharmonic phonon-phonon interactions between
the Cs ions and their iodine cages. We further calculate the renormalization of
the electronic energies due to vibrations and find an unusual opening of the
band gap, estimated as 0.24 and 0.11 eV at 500 and 300 K, which we attribute to
the stretching of Sn-I bonds. Our work demonstrates the important role of
temperature in accurately describing these materials.
