Wyllie followed in his father's footsteps, joining the Bombay Presidency, and a 'competition-wallah', moving to India in November 1856. He then became, in January 1858, a third assistant political agent in Kathiawar, before in June, nearly dying of Gujarat fever, which permanently impaired his health. During this period, Wyllie translated Colonel Lang's Mulk Sherista into English and also served as an assistant commissioner in Barabanki district and Lucknow. He then became an assistant secretary to Sir George Yule in 1862, also acting as chief commissioner of the province, and in May 1862 became Calcutta Secretariat upon the recommendation of Sir Henry Marion Durand. In 1866, he was made an under-secretary to the foreign department, becoming an exponent of foreign policy in an article, The foreign policy of Lord Lawrence, which extolled the governor-general's policy. When published in the Edinburgh Review in January 1867, he influenced public opinion, bringing the phrase 'masterly inactivity' into the common lexicon. In his final days in India, Wyllie arranged the grand durbar at Agra in November 1866.
Return to Britain
A deterioration in health, caused by his earlier Gujarat fever, forced Wyllie to return home in 1867 and, upon persuasion by his uncle, Sir William Hutt, he gave up his Indian career to enter home politics. He was elected MP for Hereford in 1868, standing on a platform of Irish disestablishment and secular education. During the election, he resigned from the Indian service, worrying he would be disqualified for holding an office of profit under the crown. However, Wyllie was shortly after unseated in March 1869, after the Conservative rivals had alleged bribery and treating. Indeed, the election was declared void on petition, after the Liberal agent was found to have "given breakfast to Liberal electors", and therefore was guilty of treating. Wyllie did no re-stand in the resulting by-election, lamenting that "he had foresaken the Indian service for a career that now sunk under him; he had burned his ships and could not return".
Wyllie continued to write after his failed election, including Masterly inactivity, published by The Fortnightly Review in December 1869, defending Lawrence's non-interventionist policy towards Afghanistan and opposing occupation of Quetta, Pakistan; and Mischievous activity, published also The Fortnightly Review in March 1870, criticising Lord Mayo's more interventionist external policy. Wyllie also contributed to the Cornhill Magazine, the Edinburgh Review, and the Calcutta Review, and wrote letters for The Times and publications focused on central Asia. On 2 June 1869, he was made a Companion of the Order of the Star of India for Indian Services and, in January 1870, he moved to Paris to improve his French and study French politics. While there, he suffered from a cold, then inflammation of the lungs and recurred malarial fever, before dying aged 34 at the Hôtel Vouillemont on 15 March 1870. He was temporarily interred at Montmartre, before his remains were moved to Kensal Green Cemetery.