Temporal variation in predation risk may fundamentally influence antipredator responses of prey animals. To maximize lifetime fitness, prey must be able to optimize energy gain and minimize predation risk, and responses to current levels of risk may be influenced by background levels of risk. A ‘risk allocation’ model has recently been proposed to predict the intensity of antipredator responses that should occur as predation risk varies over time. Prey animals from high-risk environments should respond to predators with relatively low intensities of antipredator behaviour because long periods of antipredator behaviour may result in unacceptable decreases in levels of foraging activity. Moreover, animals that are under frequent risk should devote more energy to foraging during brief pulses of safety compared with animals under infrequent attack. In this study, we experimentally tested the risk allocation hypothesis. We exposed juvenile rainbow trout, Oncorhynchus mykiss, to three levels of risk (high, moderate and low) crossed with two levels of temporal variation (exposed to risk three times a day and once a day). In accordance with the model, we found that trout exposed to risky situations more frequently responded with significantly less intense antipredator behaviour than trout exposed to risk infrequently. The intensity of response of trout exposed to moderate risk three times a day decreased to levels similar to situations of no risk. However, in contrast to the second prediction of the model, animals under frequent risk were not more active during periods of safety compared with animals under infrequent risk. Although behaviour in the face of predation risk was dependent on the broader temporal context in which risk varied, the specific predictions of the risk allocation model were only partly supported.