Protecting Society from AI Misuse: When are Restrictions on Capabilities Warranted?