Perovskites have attracted extensive attention in the field of nanophotonics with a plethora of applications owing to their high optical constants, tunable band gap, solution processability, and large optical tunability. In this work, we demonstrate perovskite-based dynamic photonic devices for applications of optical encryption and holographic inference by femtosecond laser patterning all-inorganic mixed halide perovskite CsPbIBr 2 with thermochromic features. During one cycle of moisture and evaporation treatment, the CsPbIBr 2 perovskite pattern undergoes a reversible conversion between a bright red (high-T) phase and a colorless transparent (low-T) phase, accompanied by significant optical state changes, resulting in on/ off functionality switch. At a low-T state, the encoded fluorescent or holographic information is hidden, and the function of optical inference is invalid. Conversely, at a high-T state, the encrypted information is reconstructed, and the ability of holographic inference is reactivated. Moreover, the perovskite photonic devices exhibit outstanding operating stability after 10 repeated conversion cycles without prominent performance degradation. Such perovskite photonic devices not only provide a novel approach to realize dynamic control of the desired optical functions but also have huge applicable potential for diverse optical applications, such as optical encryption, optical anticounterfeiting, and optical artificial intelligence.