A method of using a virtual assistant, comprising: at an electronic device configured to transmit and receive data, receiving a user request for a service from a virtual assistant; determining at least one task to perform in response to the user request; estimating at least one performance characteristic for completing the at least one task with the electronic device based on at least one heuristic of a plurality of heuristics, the at least one performance characteristic corresponding to an estimated speed at which the at least one task is performable at the electronic device; based on the estimating, determining whether to execute the at least one task at the electronic device, wherein the determining comprises determining whether performing the at least one task requires using personal data stored on the electronic device; in response to the determining that performing the at least one task requires using personal data stored on the electronic device, determining whether data transmission restrictions associated with the required personal data allow for transmission of the required personal data; in accordance with a determination that transmission of the required personal data is not allowable, causing execution of the at least one task at the electronic device; and in accordance with a determination that transmission of the required personal data is allowable and in accordance with a determination to execute the at least one task outside the electronic device: generating executable code for carrying out the at least one task; and transmitting the executable code from the electronic device. at an electronic device configured to transmit and receive data, receiving a user request for a service from a virtual assistant; determining at least one task to perform in response to the user request; estimating at least one performance characteristic for completing the at least one task with the electronic device based on at least one heuristic of a plurality of heuristics, the at least one performance characteristic corresponding to an estimated speed at which the at least one task is performable at the electronic device; based on the estimating, determining whether to execute the at least one task at the electronic device, wherein the determining comprises determining whether performing the at least one task requires using personal data stored on the electronic device; in response to the determining that performing the at least one task requires using personal data stored on the electronic device, determining whether data transmission restrictions associated with the required personal data allow for transmission of the required personal data; in accordance with a determination that transmission of the required personal data is not allowable, causing execution of the at least one task at the electronic device; and in accordance with a determination that transmission of the required personal data is allowable and in accordance with a determination to execute the at least one task outside the electronic device: generating executable code for carrying out the at least one task; and transmitting the executable code from the electronic device. generating executable code for carrying out the at least one task; and transmitting the executable code from the electronic device.