We present a general framework for cavity quantum electrodynamics with strongly frequencydependent mirrors. The method is applicable to a variety of reflectors exhibiting sharp internal resonances as can be realized, for example, with photonic-crystal mirrors or with two-dimensional atomic arrays around subradiant points. Our approach is based on a modification of the standard input-output formalism to explicitly include the dynamics of the mirror's internal resonance. We show how to directly extract the interaction tuning parameters from the comparison with classical transfer matrix theory and how to treat the non-Markovian dynamics of the cavity field mode introduced by the mirror's internal resonance. As an application within optomechanics, we illustrate how a non-Markovian Fano cavity possessing a flexible photonic-crystal mirror can provide both sideband resolution as well as strong heating suppression in optomechanical cooling. This approach, amenable to a wide range of systems, opens up possibilities for using hybrid frequency-dependent reflectors in cavity quantum electrodynamics for engineering novel forms of light-matter interactions.A standard platform for cavity quantum electrodynamics (CQED) [1-3] is the linear Fabry-Pérot resonator; one generally assumes two macroscopic, highly reflecting mirrors that define spatially-localized frequency-resolved resonances inside the cavity. A full quantum description of the cavity mode dynamics can be derived in the form of a Langevin equationȧ(where a is the annihilation operator of the field mode with frequency ω a and decay rate κ and a in (t) describes delta-correlated input noise encompassing the effect of the coupling to the continuum of outside modes [4]. The solution, combined with the input-output relation a out (t) = a in (t) − √ 2κa(t), describes the quantum properties of the continuous outgoing light field a out (t). In such a case, the quantum dynamics of the cavity field are Markovian, the coupling to the continuum of outside modes giving rise to an exponential time decay of the intracavity field. A critical step in this derivation lies in assuming that the reflectivity of the mirrors is essentially flat around the resonance frequency of interest.Many scenarios, however, strongly depart from this situation as end-mirrors can be made of reflective materials exhibiting enhanced linear or nonlinear response around frequencies corresponding to sharp internal modes (Fig. 1). In two-dimensional systems, these effects can be achieved by patterning a subwavelength grating or a photonic-crystal structure onto a dielectric membrane [5][6][7][8]; other systems can be formed by semiconducting monolayers [9][10][11] or two-dimensional arrays of atoms trapped in optical lattices [12][13][14]. Using such metamaterials with a strongly frequency-dependent response as end-mirrors in Fabry-Pérot resonators has been shown to result in asymmetric transmission profiles potentially much narrower than those obtained with frequency-independent mirrors of comparable reflectiv...