When confronted with sectoral shocks, policymakers often resort to targeted, sector-specific taxes in an ad hoc fashion. Based on the New Keynesian Network model, we characterize the optimal tax response to sectoral shocks: it features twice as many tax instruments as there are sectors, is budget-neutral, and not confined to the sector where the shock originates. We show that the optimal policy can be approximated by a simple rule that responds to inflation in the shocked sector and adjusts tax instruments in other sectors according to input–output linkages. We study its quantitative performance in a calibrated version of the model. • The paper analyzes the optimal tax response to sectoral shocks. • The policy is budget-neutral and requires twice as many instruments as sectors. • A simple, implementable rule provides a close approximation to the optimal policy.