Psilocybin has been shown to improve symptoms of depression and anxiety when combined with psychotherapy or other clinician-guided interventions. To understand the neural basis for this pattern of clinical efficacy, experimental and conceptual approaches that are different than traditional laboratory models of anxiety and depression are needed. A potential novel mechanism is that acute psilocybin improves cognitive flexibility, which then enhances the impact of clinician-assisted interventions. Consistent with this idea, we find that acute psilocybin robustly improves cognitive flexibility in male and female rats using a task where animals switched between previously learned strategies in response to uncued changes in the environment. Psilocybin did not influence Pavlovian reversal learning, suggesting that its cognitive effects are selective to enhanced switching between previously learned behavioral strategies. The serotonin (5HT) 2 A receptor antagonist ketanserin blocked psilocybin’s effect on set-shifting, while a 5HT2C-selective antagonist did not. Ketanserin alone also improved set-shifting performance, suggesting a complex relationship between psilocybin’s pharmacology and its impact on flexibility. Further, the psychedelic drug 2,5-Dimethoxy-4-iodoamphetamine (DOI) impaired cognitive flexibility in the same task, suggesting that this effect of psilocybin does not generalize to all other serotonergic psychedelics. We conclude that the acute impact of psilocybin on cognitive flexibility provides a useful behavioral model to investigate its neuronal effects relevant to its positive clinical outcome.