Social learning is often proposed as an important driver of the evolution of human cooperation. In this view, cooperation in other species might be restricted because it mostly relies on individually learned or innate behaviours. Here, we show that juvenile cleaner fish (Labroides dimidiatus) can learn socially about cheating consequences in an experimental paradigm that mimics cleaners’ cooperative interactions with client fish. Juvenile cleaners that had observed adults interacting with model clients learned to (1) behave more cooperatively after observing clients fleeing in response to cheating; (2) prefer clients that were tolerant to cheating; but (3) did not copy adults’ arbitrary feeding preferences. These results confirm that social learning can play an active role in the development of cooperative strategies in a non-human animal. They further show that negative responses to cheating can potentially shape the reputation of cheated individuals, influencing cooperation dynamics in interaction networks.