A crucial factor governing the habitability of exoplanets is the availability of bioessential elements such as nitrogen (N) and phosphorous (P), which foster prebiotic chemistry and sustain life after its emergence. However, concentrations of P and N in planetary mantles vary, owing to initial availability and oxidation conditions during planet formation, and thus their characterization and availability in planetary environments are challenging. Here we use a core-formation model to show that moderate oxygen fugacity during core formation is the key parameter to the availability of these two elements, with the existence of a narrow ‘chemical Goldilocks zone’ that allows both P and N to be present with the right abundances in the mantle. Earth falls within this zone, whereas planets with more reducing/oxidizing conditions will sequester P/N into the core, hindering their availability for life. Future observations refining estimates of the oxygen fugacity prevalent during exoplanet core formation will be crucial to properly evaluate exoplanetary habitability and correctly interpret possible biosignatures.
