Policy makers in the EU and elsewhere are concerned that unilateral pricing of the carbon externality induces carbon leakage through relocation of emission-intensive and trade-exposed production to other regions. A common measure to mitigate such leakage is to combine an emission trading system with output-based allocation (OBA) of allowances where the latter works as an implicit production subsidy to regulated industries. We show analytically that it is optimal to impose in addition a consumption tax on the OBA goods (i.e., goods that are entitled to OBA) at a rate which is equivalent in value to the OBA subsidy rate. The explanation is that the consumption tax alleviates excessive consumption of the OBA goods, which is a distortionary effect of introducing OBA. Using a multi-region multi-sector computable general equilibrium model calibrated to empirical data, we quantify the welfare gains for the EU of imposing such a consumption tax on top of its existing emission trading system with OBA. We run Monte Carlo simulations to account for uncertain leakage exposure of goods entitled to OBA. The consumption tax increases welfare whether the goods are highly exposed to leakage or not, and hence can be regarded as smart hedging against carbon leakage.