ABSTRACT Most research on illicit financial flows (IFFs) has focused on illicit outflows from low-income countries and the role of non-state actors in generating IFFs. Less attention has been paid to processes through which IFFs enter formal value chains – in effect being legalised before leaving the country – or the crucial role of state institutions as gatekeepers. We develop a novel explanatory approach to account for the enabling role of state institutions in the legalisation of IFFs. Building on political settlement theory, we explain the performance of institutions in regulating IFFs as a function to maintain political power. Taking the case of Bolivia, we examine how legalising illicit value flows works in practice and analyse the motives and underlying conditions that lead state institutions to permit the formal export of gold shipments that have been illicitly sourced or transferred. We find that the legalisation of IFFs accommodates the interests of powerful cooperatives dominating the gold-mining sector, which are critical to maintaining the political settlement on which the incumbent government’s power is based. By maintaining a status quo of non-enforcement, legal ambiguity, and informality, gold-mining cooperatives reap higher benefits from resource extraction at the expense of domestic revenue mobilisation.