Although limiting energy availability extends lifespan in many organisms, it is not understood how lifespan is coupled to energy levels. We find that the AMP:ATP ratio, a measure of energy levels, increases with age in Caenorhabditis elegans and can be used to predict life expectancy. The C. elegans AMP-activated protein kinase alpha subunit AAK-2 is activated by AMP and functions to extend lifespan. In addition, either an environmental stressor that increases the AMP:ATP ratio or mutations that lower insulin-like signaling extend lifespan in an aak-2-dependent manner. Thus, AAK-2 is a sensor that couples lifespan to information about energy levels and insulin-like signals.