Replace _agent by a method and get_auth_info from constructor