Dopamine (DA) has been implicated in modulating multiple cognitive control processes, including the robust maintenance of task sets and memoranda in the face of distractors (cognitive stability) and, conversely, the ability to switch task sets or update the contents of working memory when it is advantageous to do so (cognitive flexibility). In humans, the limited specificity of available pharmacological probes has posed a challenge for understanding the mechanisms by which DA, acting on multiple receptor families across the PFC and striatum, differentially influences these cognitive processes. Using a within-subject, placebo-controlled design, we contrasted the impact of two mechanistically distinct DA drugs, tolcapone (an inhibitor of catechol-O-methyltransferase [COMT], a catecholamine inactivator) and bromocriptine (a DA agonist with preferential affinity for the D2 receptor), on the maintenance and switching of task rules. Given previous work demonstrating that drug effects on behavior are dependent on baseline DA tone, participants were stratified according to genetic polymorphisms associated with cortical (COMT Val158Met) and striatal (Taq1A) DA system function. Our results were partially consistent with an inverted-U-shaped relationship between tolcapone and robust rule maintenance (interaction with COMT genotype) and between bromocriptine and cued rule switching (interaction with Taq1A genotype). However, when task instructions were ambiguous, a third relationship emerged to explain drug effects on spontaneous task switching (interaction of COMT genotype and bromocriptine). Together, this pattern of results suggests that the effects of DA drugs vary not only as a function of the DA system component upon which they act but also on subtle differences in task demands and context.