This article explores optimal public policy, in terms of the level of tax enforcement and the supply of public goods, in an economy characterized by a huge informal sector. We define informality as the set of productive activities that do not comply (totally or partially) with government regulations. The government intervenes as a Stackelberg leader and has to decide how to allocate public expenditures, using funds collected through the tax system, between the provision of a public good, which can only be used for formal activities, and enforcement effort, aimed at detecting informal firms that evade taxes. Taking the public policy as given, a representative household, owner of a representative firm, decides how to divide a fixed supply of labor between formal and informal activities. Our results show that the greater the distortions in the tax collection process, the larger is the informal sector. Finally, we derive the properties of the optimal public policy. In particular, we show that the shadow cost of public funds represents the rationale of enforcement spending.