How should the government respond to automation? We study this question in a heterogeneous agent model that takes worker displacement seriously. We recognize that displaced workers face two frictions in practice: reallocation is slow and borrowing is limited. We first show that these frictions result in inefficient automation. Firms fail to internalize that displaced workers have a limited ability to smooth consumption while they reallocate. We then analyze a second best problem where the government can tax automation but lacks redistributive tools to fully overcome borrowing frictions. The equilibrium is (constrained) inefficient. The government finds it optimal to slow down automation on efficiency grounds, even when it has no preference for redistribution. Using a quantitative version of our model, we find that the optimal speed of automation is considerably lower than at the laissez-faire. The optimal policy improves aggregate efficiency and achieves welfare gains of 4%. Slowing down automation achieves important gains even when the government implements generous social insurance policies.