Nairaishi (Palace Etiquette Office) was one of the institutions belonging to Nakatsukasasho (Ministry of Central Affairs) in the Ritsuryo system (a system of centralized government based on the ritsuryo code) in Japan.
Nairaishi corrected the manner in the Imperial Court and prosecuted the breaking of the law as its official duty. To prosecute the breaking, six members of shurai was put as tomo no miyatsuko (Servant of the Court administering a group). Shurai was the nearest post to honkan among tomo no miyatsuko. If the law was broken, the exposure was reported to the related institutions through Nakatsukasasho. (Sodan) It was a kind of special force police unit in the Imperial Court, but as for jurisdiction, it just judged a misdemeanor in the organization as well as the other institutions. There was Danjodai (Board of Censors) as a similar institution, but it prosecuted outside of the Imperial Court. In addition to the institution which had "inside" and "outside" like this, there were Daizenshiki (Office of the Palace Table) and Naizenshi (Imperial Table Office), Naiyakushi (private doctors for the Emperor) and Tenyakuryo (the Bureau of Medicine), Uchi no Kanimori no Tsukasa (Inner House Keeping Office) and Kanimori no Tsukasa (Housekeeping Office), and Efu (a palace guard) and so on. Nairaishi was incorporated into Danjodai in 806.
Kami (director) (corresponding to Shorokuinoge [Senior Sixth Rank, Lower Grade]) one member. Jo (secretary) (corresponding to Shohachiinojo [Senior Eighth Rank, Upper Grade]) one member. Reishi (corresponding to Daihatsuinoge [Greater Initial Rank, Lower Grade]) one member.
Shibu (low rank bureaucrats)
Shurai six members.