The structure of weakly bound and unbound nuclei close to particle drip lines is one of the major science drivers of nuclear physics. A comprehensive understanding of these systems goes beyond the traditional configuration interactions approach formulated in the Hilbert space of localized states (nuclear shell model) and requires an open quantum system description. The complex-energy Gamow Shell Model (GSM) provides such a framework as it is capable of describing resonant and non-resonant many-body states on equal footing. To make reliable predictions, quality input is needed that allows for the full uncertainty quantification of theoretical results. In this study, we carry out the optimization of an effective GSM (one-body and two-body) interaction in the $psdf$ shell model space. The resulting interaction is expected to describe nuclei with $5 leqslant A leqslant 12$ at the $p-sd$-shell interface. The optimized one-body potential reproduces nucleon-$^4$He scattering phase shifts up to an excitation energy of 20 MeV. The two-body interaction built on top of the optimized one-body field is adjusted to the bound and unbound ground-state binding energies and selected excited states of the Helium, Lithium, and Beryllium isotopes up to $A=9$. A very good agreement with experiment was obtained for binding energies. First applications of the optimized interaction include predictions for two-nucleon correlation densities and excitation spectra of light nuclei with quantified uncertainties. The new interaction will enable comprehensive and fully quantified studies of structure and reactions aspects of nuclei from the $psd$ region of the nuclear chart.