Preventing rogue AI agents from causing harm