but subsequently, when Li Qi refused an imperial summons to pay homage to Emperor Xianzong in 807, he ordered Li Shen to draft his petition refusing the summons; Li Shen initially pretended to be unable to write due to extreme shock, but eventually told Li Qi that he would rather die than to draft such a petition; Li Qi thereafter threw him into jail, and he was only released after Li Qi was defeated. During Emperor Muzong's reign As of the ascension of reign of Emperor Xianzong's son Emperor Muzong, Li Shen was serving as You Shiyi (), a low-level advisory official at the legislative bureau of government (中書省, Zhongshu Sheng), when Emperor Muzong also made him an imperial scholar (翰林學士, Hanlin Xueshi). He and his colleagues Yuan Zhen and Li Deyu were known for their talent and friendship. He was also promoted, in his legislative bureau position, from You Shiyi to the higher rank of You Bujue (). In 821, he was made Sixun Yuanwailang (), a low-level official at the ministry of civil service affairs (吏部, Libu), and put in charge of drafting edicts. He was also involved in an incident that was traditionally considered a cause of the later Niu-Li Factional Struggles. Both Li Shen and the former chancellor Duan Wenchang had submitted a list of examinees that they hoped would be passed to Qian Hui (), one of the officials in charge of the examinations that season, but once the results were published, the examinees that Duan and Li Shen recommended did not pass, while those who passed included the several relatives of other officials – Zheng Tan's brother Zheng Lang; Pei Du's son Pei Zhuan (); Li Zongmin's son-in-law Su Chao (); and Yang Yinshi (), brother to the other official in charge of the examinations that year, Yang Rushi (). Duan complained to Emperor Muzong that the examinations that year were not fair. When Emperor Muzong consulted imperial scholars, several imperial scholars who were political enemies of Li Zongmin, including Li Deyu and Yuan, and Li Shen, all agreed with Duan. Emperor Muzong thus ordered a reexamination, while demoting Qian, Li Zongmin, and Yang Rushi, along with 10 examinees who passed based on perceived influence. When Qian's friends subsequently suggested that he submit Duan's and Li Shen's letters trying to influence the examinations to the emperor to show that they were the ones trying