and bypass the delegated randomization. This bypassing was identified by assessing whether the entire set of declarations registered by brokers was shared with the third party for inspector random assignment. We show that 7.2 percent of all import declarations were withheld from delegated randomization.<sup>2</sup> The circumvention of the delegated randomization not only attests to the difficulties inherent in the dislodging systemic corruption but also provides variation in exposure to the delegated randomization intervention.

The bypassing resulted in the resurgence of excess interaction between inspectors and brokers, driven exclusively by withheld declarations.<sup>3</sup> Interestingly, withheld declarations were disproportionately assigned to inspectors with whom brokers had interacted excessively frequently in the period before the delegated randomization intervention, suggesting persistence in the corruption scheme we unveil. These withheld declarations were on average more risky, subject to higher taxes, more undervalued, and embodied larger tax revenue losses, especially when their eventual (non-random) assignment resulted in excess interaction between inspectors and brokers. Inspectors only provided preferential treatment to withheld declarations if registered by brokers with whom they interact excessively frequently. These findings validate our methodology and are consistent with our interpretation that the documented patterns reflect corruption.

Our paper builds on, and aims to contribute to, several strands of literature. First, by presenting a methodology that can help detect tampering with random assignment, we aim to contribute to the literature on the detection and measurement of corruption and its development consequences (Bardhan 1997; Olken and Pande 2012; Shleifer and Vishny 1993; Shleifer and Vishny 2002; Zitzewitz 2012). Random assignment of declarations to inspectors is not only the norm in customs agencies across the globe, but is also used to prevent corruption in a plethora of other settings including the assignment of cases to judges and prosecutors.<sup>4</sup> We believe our approach can fruitfully be adapted to other contexts.

Second, we contribute to the nascent literature on the performance of bureaucrats as a determinant of state effectiveness and tax collection (Olken and Pande 2012; Dincecco and Ravanilla 2017; Pepinsky et al. 2017; Xu 2018; Xu et al. 2018), by highlighting the granularity of tax evasion and showing how the behavior of a select few actors has macro-fiscal ramifications. While corruption was systemic and enabled by most inspectors (10 out of 16 in a typical semester), IT staff, and the port manager, the tax revenue losses were very concentrated among a select few inspectors and brokers. In any given semester the top 2 most corrupt inspectors accounted for 55 percent of the tax revenue losses associated with the corruption scheme we document.

Third and related, we contribute to the literature on the determinants of tax enforcement (Kleven et

> 2In practice, such bypassing appears to have been operationalized through the temporary disabling of a randomization trigger, such that all declarations registered during specific time intervals when this trigger was deactivated were withheld from being sent to the third party to be randomized (including those that were the subject of a corruption agreement).

> 3Excess interaction was not observed for declarations handled by inspectors whose assignment was randomized.

> 4More than 100 customs agencies have adopted the customs clearance IT system used by Madagascar (Automated System for Customs Data (ASYCUDA)) for which the default option for assignment of declarations to inspectors is random assignment (according to workload). Customs agencies that do not use ASYCUDA also typically use random inspector assignment. Random assignment of cases to judges to deter judicial corruption has been adopted by 162 countries (Doing Business, 2020).

3