Identifying the Risks of LM Agents with an LM-Emulated Sandbox