Laboratory attempts to identify relationships between personality and cooperative behaviour in humans have generated inconsistent results. This may partially stem from different practices in psychology and economics laboratories, with both hypothetical players and incentives typical only in the former. Another possible cause is insufficient consideration of the contexts within which social dilemmas occur. Real social dilemmas are often governed by institutions that change the payoff structure via rewards and punishments. However, such ‘strong situations’ will not necessarily suppress the effects of personality. On the contrary, they may affect some personalities differentially. Extraversion and neuroticism, reflecting variation in reward and punishment sensitivity, should predict modification of cooperative behaviour following changes to the payoff structure. We investigate interactions between personality and a punishment situation via two versions of a public goods game. We find that, even in a strong situation, personality matters and, moreover, it is related to strategic shifts in cooperation. Extraversion is associated with a shift from free-riding to cooperation in the presence of punishment, agreeableness is associated with initially higher contributions regardless of game, and, contrary to our predictions, neuroticism is associated with lower contributions regardless of game. Results should lead to new hypotheses that relate variation in biological functioning to individual differences in cooperative behaviour and that consider three-way interactions among personality, institutional context and sociocultural background.