Ensure agent is valid