Identifying biological mechanisms through which the experience of adversity emerges as individual risk for mental illness is an important step toward developing strategies for personalized treatment and, ultimately, prevention. Preclinical studies have identified epigenetic modification of gene expression as one such mechanism. Recent clinical studies have suggested that epigenetic modification, particularly methylation of gene regulatory regions, also acts to shape human brain function associated with risk for mental illness. However, it is not yet clear whether differential gene methylation as a function of adversity contributes to the emergence of individual risk for mental illness. Using prospective longitudinal epigenetic, neuroimaging and behavioral data from 132 adolescents, we demonstrate that changes in gene methylation associated with lower socioeconomic status (SES) predict changes in risk-related brain function. Specifically, we find that lower SES during adolescence is associated with an increase in methylation of the proximal promoter of the serotonin transporter gene, which predicts greater increases in threat-related amygdala reactivity. We subsequently demonstrate that greater increases in amygdala reactivity moderate the association between a positive family history for depression and the later manifestation of depressive symptoms. These initial results suggest a specific biological mechanism through which adversity contributes to altered brain function, which in turn moderates the emergence of general liability as individual risk for mental illness. If replicated, this prospective pathway may represent a novel target biomarker for intervention and prevention among high-risk individuals.