Hindsight bias is a cognitive deficiency that leads people to overestimate ex post how predictable an event was. In this paper we develop a political-agency model in which voters are hindsight-biased and politicians differ in ability, defined as information concerning the optimal policy. When public information is not too accurate, low-ability politicians sometimes gamble on suboptimal policies: in an attempt to mimic the high-ability type, who has superior private information, they go against public information and choose a policy whose expected payoff to society is negative. We model hindsight bias as a memory imperfection that prevents voters from accessing their ex ante information about the state of the world. We show that the bias can act as a discipline device that reduces policy gambles and can therefore be welfare enhancing. Although it is well known that restrictions on information acquisition can be beneficial for a principal, our contribution is to show that a psychological bias can have such an effect.