As a newly elected member of the Riksdag in 2006, Hansson became an alternate for the Justice committee and the Industry and Trade committee. During the spring of 2008, Hansson was even an alternate for the Joint Committee on Justice and Social Affairs. In the general election of 2010 Hansson left the Joint Committee on Justice and Social Affairs to become a member of the Defense Committee until the general election of 2014, when he left the Defense Committee to join the Justice Committee. In the recent 2018 general election Hansson left the Justice Committee to work in the Transport and Communications committee.[3]
Ahead of the 2014 parliamentary election, Hansson made himself known as one of four parliamentary candidates for the Moderates who want to introduce a ban on begging.[4]
Hansson said as early as April 2015 that he was set on breaking the Decemberöverenskommelsen [sv] (December agreement) on the grounds that loyalty to voters outweighed loyalty to the party.[5] In the budget vote in the spring of 2015, Hansson and party colleague Finn Bengtsson were the only moderates who opposed the party leadership's decision and voted in favor of the Alliance's budget proposal.[6]