Food insecurity has been associated with poor diet, but few studies focused on the postpartum period – an important time for women’s health. We examined associations between food security and diet quality in postpartum women and assessed whether participation in federal food assistance programmes modified this potential relation. Using longitudinal data, we analysed the association between food security at 3 months postpartum and a modified Alternate Healthy Eating Index-2010 (AHEI) at 6 months postpartum (excluding alcohol). We conducted multivariable linear regressions examining associations between food security and AHEI. We assessed two food assistance programmes as potential effect modifiers. The sample included 363 postpartum women from the Nurture study, located in the Southeastern USA (2013–2017). Among women, 64·4 % were Black and 45·7 % had a high school diploma or less. We found no evidence of an interaction between food security and two federal food assistance programmes. In adjusted models, marginal, low and very low food security were not associated with AHEI. However, low (β: −0·64; 95 % CI −1·15, −0·13; P = 0·01) and very low (β: −0·57; 95 % CI −1·02, −0·13; P = 0·01) food security were associated with greater trans fat intake. Food security status was not associated with overall diet quality but was associated with higher trans fat (low and very low) and more moderate alcohol (marginal) intake. Future studies should assess the consistency and generalisability of these findings.