The results of an experiment involving artificial-intelligence agents have heightened public anxiety about increasingly autonomous systems.