Oniwaban
The Oniwaban or niwaban was a group of government-employed undercover agents, established by the 8th Tokugawa shōgun, Tokugawa Yoshimune. They were under the direct command of the shōgun and were in charge of assassination of high-value targets, clandestine operation, counterintelligence, executive protection, providing security at Edo Castle areas, and undercover intelligence operations. In actuality, their work consisted more often of reporting any news about the city of Edo to the shōgun or remaining incognito to inspect and report on the states of affairs in the countryside. Their activities were comparable to those of the inspectors and general inspectors of the shogunate albeit under the direct orders from the shōgun.
Most historical plays and novels of the era depicted them as spies or ninjas, a tradition that continues to this time in popular culture. Oniwaban were male servers in the inner palace of the shōgun during the Edo shogunate where they served under the command of junior elders. They were the guards of the Edo castle who kept the security and checked every single thing for the sake of the Shogun's safety. There were restrictions placed on them regarding their contact with outsiders. They could only marry within their profession.
Intelligence gathering was originally conducted by the Iga and Kōka mono guards, who arrived to Edo years after Tokugawa Ieyasu's escape through the Iga and Kōka regions in 1582, where they were placed under the command of Hattori Hanzo Masanari. However, as the Edo period progressed, the Iga and Kōka mono were tasked less with intelligence gathering, and more with guard work and criminal capture. When Yoshimune arrived from Kii, he had given his niwaban guards the same rank as the Iga mono guards. While relatively low in ranking, they could directly communicate with the shōgun. As such, some among their ranks were able to become close advisors or sent as diplomatic envoys.
The character "niwa" in their name, meaning garden or yard, refers to the rumor that they were quartered in the garden of Edo Castle.
History
During the Edo period, onmitsu acted as secret agents in security agency and espionage functions, mainly assassination of high-value targets, counterintelligence, intelligence gathering, and providing security at Edo Castle areas, sometimes with aid of kobushikata, small groups of lower-class agents posing as mobile manual laborers and working under Iga ninja supervisors. The oniwaban followed a strict set of regulations, which, in some cases, forbade them from socializing with the general public.Tokugawa Yoshimune established the Oniwaban as an elite cadre of originally about 20 handpicked onmitsu, providing him with information about daimyō feudal lords and shogunate officials, while also protecting high-ranking officials of the government and acting as security guards in the Edo Castle. They were possibly quartered in the garden of the castle, hence the name.
In popular culture
The Oniwaban have been depicted as the main characters in the television series Ōedo Sōsamō and Shōgun no Onmitsu! Kage Jūhachi and in the film Oniwaban. They were also featured in the TV series Abarenbō Shōgun, as well as in the manga/anime series Ga-rei, Gintama, Lone Wolf and Cub, Peace Maker, Samurai Champloo, The Dagger of Kamui and Yoshimune. The first Shadow Warriors TV series has Oniwaban existing under Tokugawa Ietsuna, the fourth Tokugawa Shogun, but they are Kouga Ninja working against the Iga Ninja. The Oniwaban also appears in One Piece where they work for the Shogun Orochi.Some depictions feature the oniwaban in a time period following end of the shogunate, like the manga/anime series Rurouni Kenshin and Yokujō Climax ; others take place in an altogether fictional alternative worlds, even in the futuristic science fiction setting, such as in the case of the anime Chou SD Sengokuden Bushin Kirahagane, the video game Red Earth, and the miniatures game Infinity. In the anime series Sailor Moon the name of the villain of the week Oniwabandana is also an obvious pun on the oniwaban.