The aphid Pseudoregma sundanica (Van der Goot) (Homoptera: Aphididae) has two defence strategies. It is obligatorily tended by various species of ant and also produces sterile soldiers. We investigated how they allocate their investment in these two strategies. We measured the size, number of soldiers, number and species of tending ant, and number and species of predators in P.sundanica populations. We found that the level of ant tending correlated negatively with soldier investment in P.sundanica. The species of tending ant also influenced soldier investment. We excluded ants from aphid populations and recorded changes in population size and structure over four weeks. Ant exclusion led to population decline and extinction. At the same time, surviving populations showed a significant increase in soldier investment. The data demonstrate that social aphids can adjust their investment in soldiers in direct response to environmental change.