Yang was ranked at 36 on the National Party list for the 2011 New Zealand general election. He was the highest ranked new candidate on the list and was seen as a replacement for Pansy Wong, a Chinese MP who had resigned since the previous election. Yang was re-elected on the party list in 2014 and 2017. During his parliamentary career, Yang was the deputy chair of the Health select committee from 2013–14, the chair of the Education and Science committee from 2014–2017 and the chair of Governance and Administration committee from 2017–2020. He was additionally appointed a Parliamentary Private Secretary to the Minister for Ethnic Communities in 2017 and the National Party opposition spokesperson for statistics from 2017–2020. In 2019, it was reported that Yang organised a meeting between National Party leaderSimon Bridges and Guo Shengkun, the head of the Chinese Communist Party secret police during a visit to China. While he was initially re-selected as a National Party list candidate in March 2020 for that year's general election, Yang later announced his retirement from politics following renewed pressure from New Zealand First MP Winston Peters over his alleged links to Chinese military intelligence.
Spy allegations
On 13 September 2017 accusations were raised in the media that Yang taught English to Chinese spies in the 1980s and 1990s. Yang admitted he had a background as a civilian, or non-ranking, officer in the Chinese military. In response to the accusations, the National Party released a copy of Yang's CV from 2012, which mentioned his time at the Air Force Engineering College and Luoyang People's Liberation Army University of Foreign Languages. The Financial Times says the Foreign Languages Institute is part of China's military intelligence apparatus run by the People's Liberation Army, training linguists to intercept foreign communications. It was also reported that Yang attracted the attention of the New Zealand Security Intelligence Service three years prior to these revelations. Yang was a lecturer at the Foreign Language Institute and his immigration file shows he taught the English language and American studies. Yang claimed he taught his students to simply monitor communications, rather than carry out "the physical act of spying". He conceded he could be seen as having taught spies. The New Zealand Herald later reported that Yang did not disclose his links to the schools in his citizenship applications and instead substituted "partner" universities. Yang also confirmed that he had been a member of the Chinese Communist Party but claimed to be inactive since moving to New Zealand in 1994. In late June 2020, Yang came under further criticism from media and New Zealand First leader Winston Peters for refusing to give English-language interviews since the spy allegations surfaced and only granting interviews to local ethnic Chinese media.