The next-generation semiconductors and devices, such as halide perovskites and flexible electronics, are extremely sensitive to water, thus demanding highly effective protection that not only seals out water in all forms (vapor, droplet, and ice), but simultaneously provides mechanical flexibility, durability, transparency, and self-cleaning. Although various solid-state encapsulation methods have been developed, no strategy is available that can fully meet all the above requirements. Here, we report a bioinspired liquid-based encapsulation strategy that offers protection from water without sacrificing the operational properties of the encapsulated materials. Using halide perovskite as a model system, we show that damage to the perovskite from exposure to water is drastically reduced when it is coated by a polymer matrix with infused hydrophobic oil. With a combination of experimental and simulation studies, we elucidated the fundamental transport mechanisms of ultralow water transmission rate that stem from the ability of the infused liquid to fill-in and reduce defects in the coating layer, thus eliminating the low-energy diffusion pathways, and to cause water molecules to diffuse as clusters, which act together as an excellent water permeation barrier. Importantly, the presence of the liquid, as the central component in this encapsulation method provides a unique possibility of reversing the water transport direction; therefore, the lifetime of enclosed water-sensitive materials could be significantly extended via replenishing the hydrophobic oils regularly. We show that the liquid encapsulation platform presented here has high potential in providing not only water protection of the functional device but also flexibility, optical transparency, and self-healing of the coating layer, which are critical for a variety of applications, such as in perovskite solar cells and bioelectronics.