The purpose of this study is to go through "The Tang Code: Section on Guardian Palace" to investigate it's political and legal meaning and function. In order to examine if The Tang Code can be put into effect. The author believes the main purpose of "The Tang Code: Section on Guardian Palace" is to protect the emperor's safety and to maintain the safety of the palace is less important. Analyzing sixteen real legal cases of threatening personal safety in Tang dynasty found that final sentences don't seem to conform to the regulation of the statute. There are two possibilities. Firstly, it is tremendously serious crime when someone tried to threaten the emperor's personal safety. The emperor usually brought criminal to trial in person and the most of criminal would increase of penalty. Secondly, most of legal cases in historical records are special cases. Finally, according to ten cases of palace coup in this essay, we can find that the function of "The Tang Code" in prevention of usurping the throne is more effective in earlier stage then in later stage.