A laboratory simulation of foraging required rats to search for opportunities to obtain meals of pure-macronutrient foods (separate sources of carbohydrate, fat, and protein). Reductions in protein availability (increases in the cost of procuring protein meals) and reductions in protein abundance (decreases in the likelihood of encountering protein meal opportunities) were examined in separate phases. Rats foraged selectively, composing high-fat, adequate-protein diets; they tended to alternate between protein and nonprotein meals when protein was accessible. When protein became less available or relatively less abundant, meal patterns changed, and the proportional intake of protein fell. The tactic of shifting relative nutrient intake was used to a greater extent than the tactic of increasing foraging behavior. The foraging constraints revealed a flexible nutritional strategy that balanced responses to internal and external demands.