The FoxO family of Forkhead transcription factors plays an important role in longevity and tumor suppression by upregulating target genes involved in stress resistance, metabolism, cell cycle arrest and apoptosis. FoxO transcription factors translate a variety of environmental stimuli, including insulin, growth factors, nutrients and oxidative stress, into specific gene-expression programs. These environmental stimuli control FoxO activity primarily by regulating their subcellular localization, but also by affecting their protein levels, DNA-binding properties and transcriptional activity. The precise regulation of FoxO transcription factors is enacted by an intricate combination of post-translational modifications (PTMs), including phosphorylation, acetylation and ubiquitination, and binding protein partners. An intriguing possibility is that FoxO PTMs may act as a 'molecular FoxO code' read by selective protein partners to rapidly regulate gene-expression programs. The effective control of FoxO activity in response to environmental stimuli is likely to be critical to prevent aging and age-dependent diseases, including cancer, neurodegenerative diseases and diabetes.