
thumb|right|alt=Tokugawa Yoshimune|Tokugawa Yoshimune The or was a group of government-employed undercover agents (onmitsu), established by the 8th Tokugawa shōgun, Tokugawa Yoshimune (1684–1751). 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
thumb|right|alt=Tokugawa Yoshimune|Tokugawa Yoshimune The or was a group of government-employed undercover agents (onmitsu), established by the 8th Tokugawa shōgun, Tokugawa Yoshimune (1684–1751). 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.
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).