Walking in daily life requires humans to adapt to environments that can influence one's fear of falling and anxiety about a potential fall. In such environments, individuals may adopt compensatory locomotor and balance changes to maintain a constant expected risk function equal to the product of the probability of some event (e.g., a fall) and the cost of that event (e.g., injury or death). Here, we tested whether locomotor behaviors broadly align with this risk model in two experiments with height-related threats in immersive virtual reality. In Experiment 1, we examined how individuals change their locomotor trajectory while walking along a straight high-elevation walkway. In Experiment 2, we examined how individuals change trajectory and balance control during curved walking where the location of high elevation threat varied. Participants adopted two behaviors that decreased their probability of falling off the edge and aligned with the risk-based model: participants altered their proximity to perceived threats that pose high costs (e.g., a high-elevation ledge), and decreased mediolateral center of mass velocity when that was not possible. Taken together, our results suggest that individuals alter locomotor behavior to change the probability of falling based on the perceived cost of that fall.