In a search and matching model with risk-averse workers, endogenous hiring and separation, and unobservable search effort they first show how to decentralize the constrained-efficient allocation. This can be achieved by a combination of a production tax and three labor-market policy instruments, namely, a vacancy subsidy, a layoff tax and unemployment benefits. The authors derive analytical expressions for the optimal setting of each of these for the steady state and for the business cycle. Their propositions suggest that hiring subsidies, layoff taxes and the replacement rate of unemployment insurance should all rise in recessions. The authors find this confirmed in a calibration targeted to the U.S. economy.