With the next generation of cosmological surveys about to commence, it is important to understand how one can use the information obtained from such surveys to constrain the space of dark energy and modified gravity theories. The effective field theory (EFT) of dark energy has proven to be a useful approach in this regard, allowing an efficient exploration of the parameter space. However, in order to gain a deeper understanding of the mechanism underlying cosmic acceleration one would like to interpret constraints on the EFT parameters in terms of fundamental covariant theories. In this talk I will discuss a method to reconstruct the class of covariant Horndeski theories that reproduce the same background dynamics and linear perturbations as a given EFT action. I will then present a number of examples and applications. The work was done in collaboration with Lucas Lombriser and Andy Taylor.