The black perovskite phase of CsPbI3 is promising for optoelectronic applications; however, it is unstable under ambient conditions, transforming within minutes into an optically inactive yellow phase, a fact that has so far prevented its widespread adoption. Here we use coarse photolithography to embed a PbI2-based interfacial microstructure into otherwise-unstable CsPbI3 perovskite thin films and devices. Films fitted with a tessellating microgrid are rendered resistant to moisture-triggered decay and exhibit enhanced long-term stability of the black phase (beyond 2.5 years in a dry environment), due to increasing the phase transition energy barrier and limiting the spread of potential yellow phase formation to structurally isolated domains of the grid. This stabilizing effect is readily achieved at the device level, where unencapsulated CsPbI3 perovskite photodetectors display ambient-stable operation. These findings provide insights into the nature of phase destabilization in emerging CsPbI3 perovskite devices and demonstrate an effective stabilization procedure which is entirely orthogonal to existing approaches.