We propose an extended PAYG social security system that conditions pension benefits on the aggregate wage sum and on the wage of one’s children. The latter increases parents’ incentives to provide their children with good within-familyneducation. However, since wages depend stochastically on parents’ unobservable investment in their children’s human capital, some insurance against the productivity risk of one’s children is provided because retirement income still depends on aggregate wages. We analyze the effects of such a social security system on the endogenousndistribution of human capital and compare it to real world systems which typically do not condition benefits on the wages of one’s children. Our approach suggests a novel role for a well-designed social security system: it can foster human capital accumulation and act as an intra-generational insurance against productivitynrisk.