Every studied animal engages in sleep, and many animals spend much of their lives in this vulnerable behavioural state. We believe that an explicit description of this vulnerability will provide many insights into both the function and architecture (or organization) of sleep. Early studies of sleep recognized this idea, but it has been largely overlooked during the last 20 years. We critically evaluate early models that suggested that the function of sleep is antipredator in nature, and outline a new model in which we argue that whole-brain or 'blackout' sleep may be the safest way to sleep given a functionally interconnected brain. Early comparative work also suggested that the predatory environment is an important determinant of sleep architecture. For example, species that sleep in risky environments spend less time in the relatively vulnerable states of sleep. Recent experimental work suggests that mammals and birds shift to relatively vigilant (lighter) states of sleep in response to an increase in perceived risk; these results mirror the influence of stress on sleep in humans and rats. We also outline a conceptual model of sleep architecture in which dynamic changes in sleep states reflect a trade-off between the benefits of reducing a sleep debt and the cost of predation. Overall, many aspects of plasticity in sleep related to predation risk require further study, as do the ways in which sleeping animals monitor predatory threats. More work outside of the dominant mammalian paradigm in sleep is also needed. An ecologically based view of sleeping under the risk of predation will provide an important complement to the traditional physiological and neurological approaches to studying sleep and its functions.