In utero brain development underpins brain health across the lifespan but is vulnerable to physiological and pharmacological perturbation. Here, we show that antiepileptic medication during pregnancy impacts on cortical activity during neonatal sleep, a potent indicator of newborn brain health. These effects are evident in frequency-specific functional brain networks and carry prognostic information for later neurodevelopment. Notably, such effects differ between different antiepileptic drugs that suggest neurodevelopmental adversity from exposure to antiepileptic drugs and not maternal epilepsy per se. This work provides translatable bedside metrics of brain health that are sensitive to the effects of antiepileptic drugs on postnatal neurodevelopment and carry direct prognostic value.