The effectiveness of a mass vaccination program can engender its own undoing if individuals choose to not get vaccinated believing that they are already protected by herd immunity. This would appear to be the optimal decision for an individual, based on a strategic appraisal of her costs and benefits, even though she would be vulnerable during subsequent outbreaks if the majority of the population argues in this manner. We investigate how voluntary vaccination can nevertheless emerge in a social network of rational agents, who make informed decisions whether to be vaccinated, integrated with a model of epidemic dynamics. The information available to each agent includes the prevalence of the disease in their local network neighborhood and/or globally in the population, as well as the fraction of their neighbors that are protected against the disease. Crucially, the payoffs governing the decision of agents vary with disease prevalence, resulting in the vaccine uptake behavior changing in response to contagion spreading. The collective behavior of the agents responding to local prevalence can lead to a significant reduction in the final epidemic size, particularly for less contagious diseases having low basic reproduction number [Formula: see text]. Near the epidemic threshold ([Formula: see text]) the use of local prevalence information can result in divergent responses in the final vaccine coverage. Our results suggest that heterogeneity in the risk perception resulting from the spatio-temporal evolution of an epidemic differentially affects agents payoffs, which is a critical determinant of the success of voluntary vaccination schemes.