Two longitudinal field experiments in a middle school examined how a brief "values affirmation" affects students' psychological experience and the relationship between psychological experience and environmental threat over 2 years. Together these studies suggest that values affirmations insulate individuals' sense of belonging from environmental threat during a key developmental transition. Study 1 provided an analysis of new data from a previously reported study. African American students in the control condition felt a decreasing sense of belonging during middle school, with low-performing students dropping more in 7th grade and high-performing students dropping more in 8th grade. The affirmation reduced this decline for both groups. Consistent with the notion that affirmation insulates belonging from environmental threat, affirmed African American students' sense of belonging in Study 1 fluctuated less over 2 years and became less contingent on academic performance. Based on the idea that developmentally sensitive interventions can have long-lasting benefits, Study 2 showed that the affirmation intervention was more effective if delivered before any drop in performance and subsequent psychological toll could unfold. The role of identity threat and affirmation in affecting the encoding of social experience, and the corresponding importance of timing treatments to developmentally sensitive periods, are explored.