Résumé : Confinement of discrete coordination cages within nanoporous lattices is an intriguing strategy to gain unusual properties and functions. We demonstrate here that the confinement of coordination cages within metal–organic frameworks (MOFs) allows the spin state of the cages to be regulated through multilevel host–guest interactions. In particular, the confined in situ self-assembly of an anionic FeII4L6 nanocage within the mesoporous cationic framework of MIL-101 leads to the ionic MOF with an unusual hierarchical host–guest structure. While the nanocage in solution and in the solid state has been known to be invariantly diamagnetic with low-spin FeII, FeII4L6@MIL-101 exhibits spin-crossover (SCO) behavior in response to temperature and release/uptake of water guest within the MOF. The distinct color change concomitant with water-induced SCO enables the use of the material for highly selective colorimetric sensing of humidity. Moreover, the spin state and the SCO behavior can be modulated also by inclusion of a guest into the hydrophobic cavity of the confined cage. This is an essential demonstration of the phenomenon that the confinement within porous solids enables an SCO-inactive cage to show modulable SCO behaviors, opening perspectives for developing functional supramolecular materials through hierarchical host–guest structures.