Group living promotes opportunities for both cooperation and competition. Selection on the ability to cope with such opposing social opportunities has been proposed as a driving force in the evolution of large brains in primates and other social species. However, we still know little about the degree of complexity involved in such social strategies. Here, we report advanced social strategies in wild vervet monkeys. Building on recent experimental evidence that subordinate females trade grooming for tolerance from higher-ranking individuals during foraging activities, we show that the audience composition strongly affects this trade. First, tolerance was lower if the audience contained individuals that outranked the subordinate partner, independently of audience size and kinship relationships. Second, we found a significant interaction between previous grooming and relative rank of bystanders: dominant subjects valued recent grooming by subordinates while intermediate ranked subjects valued the option to aggress subordinate partners in the presence of a dominant audience. Aggressors were also more likely to emit coalition recruitment calls if the audience contained individuals that outranked the subordinate partner. In conclusion, vervet monkeys include both recent grooming and knowledge about third-party relationships to make complex decisions when trading grooming for tolerance, leading to a finely balanced trade-off between reciprocation and opportunities to reinforce rank relationships.