Neurodevelopment is characterized by rapid rates of neural cell proliferation and differentiation followed by massive cell death in which more than half of all recently generated brain cells are pruned back. Large amounts of DNA damage, cellular debris, and by-products of cellular stress are generated during these neurodevelopmental events, all of which can potentially activate immune signalling. How the immune response to this collateral damage influences brain maturation and function remains unknown. Here we show that the AIM2 inflammasome contributes to normal brain development and that disruption of this immune sensor of genotoxic stress leads to behavioural abnormalities. During infection, activation of the AIM2 inflammasome in response to double-stranded DNA damage triggers the production of cytokines as well as a gasdermin-D-mediated form of cell death known as pyroptosis1,2,3,4. We observe pronounced AIM2 inflammasome activation in neurodevelopment and find that defects in this sensor of DNA damage result in anxiety-related behaviours in mice. Furthermore, we show that the AIM2 inflammasome contributes to central nervous system (CNS) homeostasis specifically through its regulation of gasdermin-D, and not via its involvement in the production of the cytokines IL-1 and/or IL-18. Consistent with a role for this sensor of genomic stress in the purging of genetically compromised CNS cells, we find that defective AIM2 inflammasome signalling results in decreased neural cell death both in response to DNA damage-inducing agents and during neurodevelopment. Moreover, mutations in AIM2 lead to excessive accumulation of DNA damage in neurons as well as an increase in the number of neurons that incorporate into the adult brain. Our findings identify the inflammasome as a crucial player in establishing a properly formed CNS through its role in the removal of genetically compromised cells.