How strong is selection for cheating in mutualisms? The answer depends on the type and magnitude of the costs of the mutualism. Here we investigated the direct and ecological costs of plant defense by ants in the association between Cordia nodosa, a myrmecophytic plant, and Allomerus octoarticulatus, a phytoecious ant. Cordia nodosa trees produce food and housing to reward ants that protect them against herbivores. For nearly 1 year, we manipulated the presence of A. octoarticulatus ants and most insect herbivores on C. nodosa in a full-factorial experiment. Ants increased plant growth when herbivores were present but decreased plant growth when herbivores were absent, indicating that hosting ants can be costly to plants. However, we did not detect a cost to ant colonies of defending host plants against herbivores. Although this asymmetry in costs suggests that the plants may be under stronger selection than the ants to cheat by withholding investment in their partner, the costs to C. nodosa are probably at least partly ecological, arising because ants tend scale insects on their host plants. We argue that ecological costs should favor resistance or traits other than cheating and thus that neither partner may face much temptation to cheat.