This paper studies the optimal design of second-best corrective regulation, when some agents or activities cannot be perfectly regulated. We show that policy elasticities and Pigouvian wedges are sufficient statistics to characterize the marginal welfare impact of regulatory policies in a large class of environments. We show that the optimal second-best policy is determined by a subset of policy elasticities: leakage elasticities, and characterize the marginal value of relaxing regulatory constraints. We apply our results to scenarios with unregulated agents/activities and with uniform regulation across agents/activities. We illustrate our results in applications to shadow banking, scale-invariant regulation, asset substitution, and fire sales.