Searches for new astrophysical phenomena often involve several sources of nonrandom uncertainties that can lead to highly misleading results. Among these, model uncertainty arising from background mismodeling can dramatically compromise the sensitivity of the experiment under study. Specifically, overestimating the background distribution in the signal region increases the chances of missing new physics. Conversely, underestimating the background outside the signal region leads to an artificially enhanced sensitivity and a higher likelihood of claiming false discoveries. The aim of this work is to provide a unified statistical strategy to perform modeling, estimation, inference, and signal characterization under background mismodeling. The method proposed allows one to incorporate the (partial) scientific knowledge available on the background distribution and provides a data-updated version of it in a purely nonparametric fashion without requiring the specification of prior distributions on the unknown parameters. Applications in the context of dark matter searches and radio surveys show how the tools presented in this article can be used to incorporate nonstochastic uncertainty due to instrumental noise and to overcome violations of classical distributional assumptions in stacking experiments.