In this paper we examine the role of social security in an economy populated by overlapping generations of individuals with time-inconsistent preferences who face mortality risk, individual income risk, and borrowing constraints. Agents in this economy are heterogeneous with respect to age, employment status, retirement status, hours worked, and asset holdings. We consider two cases of time-inconsistent preferences. First, we model agents as quasi-hyperbolic discounters. They can be sophisticated and play a symmetric Nash game against their future selves; or they can be naive and believe that their future selves will exponentially discount. Second, we consider retrospective time inconsistency. We find that (1) there are substantial welfare costs to quasi-hyperbolic discounters of their time-inconsistent behavior, (2) social security is a poor substitute for a perfect commitment technology in maintaining old-age consumption, (3) there is little scope for social security in a world of quasi-hyperbolic discounters (with a short-term discount rate up to 15%), and, (4) the ex ante annual discount rate must be at least 10% greater than seems warranted ex post in order for a majority of individuals with retrospective time inconsistency to prefer a social security tax rate of 10% to no social security. Our findings question the effectiveness of unfunded social security in correcting for the undersaving resulting from time-inconsistent preferences.