Clinical criteria for substance-use disorder collectively specify a loss of instrumental control over consumption, yet little empirical work has addressed how substance use shapes the utility of agency in motivated behavior. We combined a hierarchical gambling task with cross-sectional substance-use surveys and computational cognitive modeling, to assess the preference for controllable environments in adult humans with self-reported abstinence, across psychostimulant, opioid, alcohol, and sedative use. For psychostimulants, the duration of abstinence strongly modulated the preference for control, without affecting the ability to maximize monetary payoffs. In contrast, for alcohol, the recency of use was more predictive of a preference for environments with divergent outcome distributions, regardless of whether those outcomes were controllable. No effects of abstinence were seen for sedatives. The selective effects of psychostimulant use on the value of control implicate the dopaminergic system in agency coding.