We present a mathematical study of two-dimensional electrostatic and electromagnetic shielding by a cage of conducting wires (the so-called ‘Faraday cage effect’). Taking the limit as the number of wires in the cage tends to infinity, we use the asymptotic method of multiple scales to derive continuum models for the shielding, involving homogenized boundary conditions on an effective cage boundary. We show how the resulting models depend on key cage parameters such as the size and shape of the wires, and, in the electromagnetic case, on the frequency and polarization of the incident field. In the electromagnetic case, there are resonance effects, whereby at frequencies close to the natural frequencies of the equivalent solid shell, the presence of the cage actually amplifies the incident field, rather than shielding it. By appropriately modifying the continuum model, we calculate the modified resonant frequencies, and their associated peak amplitudes. We discuss applications to radiation containment in microwave ovens and acoustic scattering by perforated shells.